mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-21 03:10:24 +08:00
Merge pull request #3 from lhy0403/AppVeyor
Windows Build Support
Former-commit-id: 4245c74d07
This commit is contained in:
commit
877a4d18e5
4
.gitignore
vendored
4
.gitignore
vendored
@ -10,5 +10,7 @@ v2ctl
|
||||
v2ray
|
||||
v2ray.sig
|
||||
v2ctl.sig
|
||||
|
||||
./.vscode
|
||||
build/
|
||||
python37/
|
||||
tools/python-3.7.3.exe
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core gui sql
|
||||
QT += core gui
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
@ -33,7 +33,6 @@ SOURCES += \
|
||||
importconf.cpp \
|
||||
inbound_settings.cpp \
|
||||
vinteract.cpp \
|
||||
db.cpp \
|
||||
import_vmess.cpp \
|
||||
utils.cpp \
|
||||
runguard.cpp
|
||||
@ -44,7 +43,6 @@ HEADERS += \
|
||||
importconf.h \
|
||||
inbound_settings.h \
|
||||
vinteract.h \
|
||||
db.h \
|
||||
import_vmess.h \
|
||||
utils.h \
|
||||
runguard.h
|
||||
@ -95,3 +93,6 @@ unix: exists( "/usr/include/python3.5m/Python.h" ) {
|
||||
unix: equals(WITH_PYTHON, "no") {
|
||||
error("No python libs found, did you install python3 dev package?")
|
||||
}
|
||||
|
||||
win32: LIBS += -L$$PWD/python37/libs/ -lpython37_mingw
|
||||
win32: INCLUDEPATH += $$PWD/python37/include
|
||||
|
19
appveyor.yml
Normal file
19
appveyor.yml
Normal file
@ -0,0 +1,19 @@
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- dev
|
||||
- AppVeyor
|
||||
- ui-implementation
|
||||
|
||||
install:
|
||||
- set QTDIR=C:\Qt\5.10\mingw53_32
|
||||
- choco install -y InnoSetup
|
||||
- set PATH=%QTDIR%\bin;C:\Qt\Tools\mingw730_32\bin;%PATH%;"C:\Program Files (x86)\Inno Setup 5"
|
||||
|
||||
build_script:
|
||||
- mkdir python37 && xcopy C:\Python37 python37 /E /H /Q
|
||||
- tools\FixPythonWithMinGW.bat
|
||||
- cd src
|
||||
- mkdir build && cd build
|
||||
- qmake ..\..\Hv2ray.pro
|
||||
- mingw32-make
|
@ -1,13 +1,9 @@
|
||||
#include "confedit.h"
|
||||
#include "ui_confedit.h"
|
||||
#include <iostream>
|
||||
#include <QSqlDatabase>
|
||||
#include <QSqlQuery>
|
||||
#include "mainwindow.h"
|
||||
#include <QDebug>
|
||||
#include <QSqlError>
|
||||
#include <QFile>
|
||||
#include "db.h"
|
||||
#include <QIntValidator>
|
||||
|
||||
ConfEdit::ConfEdit(QWidget *parent) :
|
||||
@ -15,7 +11,6 @@ ConfEdit::ConfEdit(QWidget *parent) :
|
||||
ui(new Ui::ConfEdit)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(this, SIGNAL(updateConfTable()), parentWidget(), SLOT(updateConfTable()));
|
||||
ui->portLineEdit->setValidator(new QIntValidator());
|
||||
ui->alterLineEdit->setValidator(new QIntValidator());
|
||||
}
|
||||
@ -24,48 +19,9 @@ ConfEdit::~ConfEdit()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
vConfig *vConfig::query(int id)
|
||||
{
|
||||
QString selectQuery = "select * from confs where id = " + QString::number(id) + ";";
|
||||
SQLiteDB myDb = SQLiteDB();
|
||||
myDb.DoQuery(selectQuery);
|
||||
myDb.myQuery.first();
|
||||
this->host = myDb.myQuery.value(1).toString();
|
||||
this->port = myDb.myQuery.value(2).toString();
|
||||
this->alias = myDb.myQuery.value(3).toString();
|
||||
this->uuid = myDb.myQuery.value(4).toString();
|
||||
this->alterid = myDb.myQuery.value(5).toString();
|
||||
this->security = myDb.myQuery.value(6).toString();
|
||||
this->isCustom = myDb.myQuery.value(7).toInt();
|
||||
return this;
|
||||
}
|
||||
int vConfig::save()
|
||||
{
|
||||
QSqlDatabase database;
|
||||
if (QSqlDatabase::contains("qt_sql_default_connection")) {
|
||||
database = QSqlDatabase::database("qt_sql_default_connection");
|
||||
} else {
|
||||
database = QSqlDatabase::addDatabase("QSQLITE");
|
||||
database.setDatabaseName(confDatabase);
|
||||
}
|
||||
if (!database.open()) {
|
||||
qDebug() << "Failed to open database while saving.";
|
||||
return -1;
|
||||
}
|
||||
QSqlQuery myQuery(database);
|
||||
myQuery.prepare("insert into confs (host, port, alias, uuid, alterid, security, isCustom, selected) values(:host, :port, :alias, :uuid, :alterid, :security, :isCustom, :selected)");
|
||||
myQuery.bindValue(":host", this->host);
|
||||
myQuery.bindValue(":port", this->port);
|
||||
myQuery.bindValue(":alias", this->alias);
|
||||
myQuery.bindValue(":uuid", this->uuid);
|
||||
myQuery.bindValue(":alterid", this->alterid);
|
||||
myQuery.bindValue(":security", this->security);
|
||||
myQuery.bindValue(":isCustom", this->isCustom);
|
||||
myQuery.bindValue(":selected", 0);
|
||||
myQuery.exec();
|
||||
myQuery.exec("select last_insert_rowid();");
|
||||
myQuery.first();
|
||||
return myQuery.value(0).toInt();
|
||||
return -1;
|
||||
}
|
||||
|
||||
void vConfig::getConfigFromDialog(Ui::ConfEdit *ui)
|
||||
@ -78,10 +34,3 @@ void vConfig::getConfigFromDialog(Ui::ConfEdit *ui)
|
||||
this->security = ui->securityCombo->currentText();
|
||||
this->isCustom = 0;
|
||||
}
|
||||
void ConfEdit::on_ConfEdit_accepted()
|
||||
{
|
||||
vConfig newConf;
|
||||
newConf.getConfigFromDialog(this->ui);
|
||||
newConf.save();
|
||||
emit updateConfTable();
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ public:
|
||||
QString alterid;
|
||||
QString security;
|
||||
int isCustom;
|
||||
vConfig *query(int id);
|
||||
int save();
|
||||
void getConfigFromDialog(Ui::ConfEdit *ui);
|
||||
private:
|
||||
@ -32,11 +31,6 @@ class ConfEdit : public QDialog
|
||||
public:
|
||||
explicit ConfEdit(QWidget *parent = nullptr);
|
||||
~ConfEdit();
|
||||
signals:
|
||||
void updateConfTable();
|
||||
private slots:
|
||||
void on_ConfEdit_accepted();
|
||||
|
||||
private:
|
||||
Ui::ConfEdit *ui;
|
||||
|
||||
|
1043
src/confedit.ui
1043
src/confedit.ui
File diff suppressed because it is too large
Load Diff
27
src/db.cpp
27
src/db.cpp
@ -1,27 +0,0 @@
|
||||
#include "db.h"
|
||||
#include <QSqlDatabase>
|
||||
#include <QSqlQuery>
|
||||
#include "mainwindow.h"
|
||||
#include <QDebug>
|
||||
|
||||
SQLiteDB::SQLiteDB()
|
||||
{
|
||||
QSqlDatabase database;
|
||||
if (QSqlDatabase::contains("qt_sql_default_connection")) {
|
||||
database = QSqlDatabase::database("qt_sql_default_connection");
|
||||
} else {
|
||||
database = QSqlDatabase::addDatabase("QSQLITE");
|
||||
database.setDatabaseName(confDatabase);
|
||||
}
|
||||
if (!database.open()) {
|
||||
qDebug() << "Failed to open database while querying.";
|
||||
} else {
|
||||
this->myQuery = QSqlQuery(database);
|
||||
}
|
||||
}
|
||||
|
||||
void SQLiteDB::DoQuery(QString queryString)
|
||||
{
|
||||
this->myQuery.prepare(queryString);
|
||||
this->myQuery.exec();
|
||||
}
|
14
src/db.h
14
src/db.h
@ -1,14 +0,0 @@
|
||||
#ifndef DB_H
|
||||
#define DB_H
|
||||
#include <QSqlQuery>
|
||||
|
||||
class SQLiteDB
|
||||
{
|
||||
public:
|
||||
SQLiteDB();
|
||||
QSqlQuery myQuery;
|
||||
void DoQuery(QString queryString);
|
||||
|
||||
};
|
||||
|
||||
#endif // DB_H
|
@ -91,6 +91,8 @@ void inbound_settings_window::on_buttonBox_accepted()
|
||||
inbounds.append(http);
|
||||
}
|
||||
rootObj.insert("inbounds", QJsonValue(inbounds));
|
||||
#ifndef _WIN32
|
||||
// Set UID and GID in *nix
|
||||
QFileInfo ray("v2ray");
|
||||
if(ui->rootCheckbox->isChecked() && ray.ownerId() != 0) {
|
||||
QProcess::execute("pkexec", QStringList() << "bash" << "-c" << "chown root:root " + QCoreApplication::applicationDirPath() + "/v2ray" + ";chmod +s " + QCoreApplication::applicationDirPath() + "/v2ray");
|
||||
@ -101,6 +103,9 @@ void inbound_settings_window::on_buttonBox_accepted()
|
||||
}
|
||||
ray.refresh();
|
||||
rootObj.insert("v2suidEnabled", ray.ownerId() == 0);
|
||||
#else
|
||||
// No such uid gid thing on windows....
|
||||
#endif
|
||||
modifiedDoc.setObject(rootObj);
|
||||
QByteArray byteArray = modifiedDoc.toJson(QJsonDocument::Indented);
|
||||
QFile confFile("conf/Hv2ray.config.json");
|
||||
|
30
src/main.cpp
30
src/main.cpp
@ -2,9 +2,6 @@
|
||||
#include <QDir>
|
||||
#include <iostream>
|
||||
#include <QDebug>
|
||||
#include <QSqlDatabase>
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlError>
|
||||
#include <QFileInfo>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
@ -23,28 +20,6 @@ void firstRunCheck()
|
||||
qDebug() << "Config directory created.";
|
||||
}
|
||||
|
||||
QFileInfo confdb("conf/conf.db");
|
||||
if (!confdb.exists()) {
|
||||
QSqlDatabase database;
|
||||
if (QSqlDatabase::contains("qt_sql_default_connection")) {
|
||||
database = QSqlDatabase::database("qt_sql_default_connection");
|
||||
} else {
|
||||
database = QSqlDatabase::addDatabase("QSQLITE");
|
||||
database.setDatabaseName("conf/conf.db");
|
||||
if(!database.open()) {
|
||||
qDebug() << "Failed to open database while creating.";
|
||||
}
|
||||
}
|
||||
|
||||
QSqlQuery query(database);
|
||||
bool bsuccess =
|
||||
query.exec("create table confs(id INTEGER primary key AUTOINCREMENT, host char(50), port char(5), "
|
||||
"alias char(80), uuid char(36), alterid char(5), security char(12), isCustom int, selected int);");
|
||||
if(!bsuccess) {
|
||||
qDebug() << "Failed to create table.";
|
||||
}
|
||||
}
|
||||
|
||||
QFileInfo hvConfInfo("conf/Hv2ray.config.json");
|
||||
|
||||
// First Run?
|
||||
@ -81,12 +56,13 @@ void firstRunCheck()
|
||||
confFile.close();
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication _qApp(argc, argv);
|
||||
RunGuard guard("Hv2ray");
|
||||
if(!guard.tryToRun()) {
|
||||
alterMessage("Already running", "Another instance of Hv2ray is already running!");
|
||||
if(!guard.isSingleInstance()) {
|
||||
alterMessage("Hv2Ray", "Another instance of Hv2ray is already running!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,10 @@
|
||||
#include <QFileInfo>
|
||||
#include <QInputDialog>
|
||||
|
||||
#include "db.h"
|
||||
#include "import_vmess.h"
|
||||
#include "inbound_settings.h"
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include <ui_mainwindow.h>
|
||||
#include "confedit.h"
|
||||
#include "importconf.h"
|
||||
#include "vinteract.h"
|
||||
@ -25,8 +24,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
this->setWindowIcon(QIcon("Himeki.ico"));
|
||||
ui->setupUi(this);
|
||||
updateConfTable();
|
||||
ui->configTable->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(ui->configTable, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showMenu(QPoint)));
|
||||
// ui->configTable->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
// connect(ui->configTable, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showMenu(QPoint)));
|
||||
this->v2Inst = new v2Instance();
|
||||
hTray = new QSystemTrayIcon();
|
||||
hTray->setToolTip("Hv2ray");
|
||||
@ -36,17 +35,17 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
if(QFileInfo("config.json").exists()) {
|
||||
v2Inst->start(this);
|
||||
}
|
||||
QAction *select = new QAction("Select", ui->configTable);
|
||||
QAction *del = new QAction("Delete", ui->configTable);
|
||||
QAction *rename = new QAction("Rename", ui->configTable);
|
||||
popMenu->addAction(select);
|
||||
popMenu->addAction(del);
|
||||
popMenu->addAction(rename);
|
||||
connect(select, SIGNAL(triggered()), this, SLOT(select_triggered()));
|
||||
connect(del, SIGNAL(triggered()), this, SLOT(delConf()));
|
||||
connect(rename, SIGNAL(triggered()), this, SLOT(renameRow()));
|
||||
connect(ui->logText, SIGNAL(textChanged()), this, SLOT(scrollToBottom()));
|
||||
bar = ui->logText->verticalScrollBar();
|
||||
// QAction *select = new QAction("Select", ui->configTable);
|
||||
// QAction *del = new QAction("Delete", ui->configTable);
|
||||
// QAction *rename = new QAction("Rename", ui->configTable);
|
||||
// popMenu->addAction(select);
|
||||
// popMenu->addAction(del);
|
||||
// popMenu->addAction(rename);
|
||||
// connect(select, SIGNAL(triggered()), this, SLOT(select_triggered()));
|
||||
// connect(del, SIGNAL(triggered()), this, SLOT(delConf()));
|
||||
// connect(rename, SIGNAL(triggered()), this, SLOT(renameRow()));
|
||||
// connect(ui->logText, SIGNAL(textChanged()), this, SLOT(scrollToBottom()));
|
||||
// bar = ui->logText->verticalScrollBar();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
@ -70,73 +69,33 @@ void MainWindow::on_actionExisting_config_triggered()
|
||||
}
|
||||
void MainWindow::showMenu(QPoint pos)
|
||||
{
|
||||
if(ui->configTable->indexAt(pos).column() != -1) {
|
||||
popMenu->move(cursor().pos());
|
||||
popMenu->show();
|
||||
}
|
||||
// if(ui->configTable->indexAt(pos).column() != -1) {
|
||||
// popMenu->move(cursor().pos());
|
||||
// popMenu->show();
|
||||
// }
|
||||
}
|
||||
void MainWindow::select_triggered()
|
||||
{
|
||||
int row = ui->configTable->selectionModel()->currentIndex().row();
|
||||
int idIntable = ui->configTable->model()->data(ui->configTable->model()->index(row, 4)).toInt();
|
||||
this->geneConf(idIntable);
|
||||
if(this->v2Inst->v2Process->state() == QProcess::Running) {
|
||||
this->on_restartButton_clicked();
|
||||
}
|
||||
// int row = ui->configTable->selectionModel()->currentIndex().row();
|
||||
// int idIntable = ui->configTable->model()->data(ui->configTable->model()->index(row, 4)).toInt();
|
||||
// this->geneConf(idIntable);
|
||||
// if(this->v2Inst->v2Process->state() == QProcess::Running) {
|
||||
// this->on_restartButton_clicked();
|
||||
// }
|
||||
}
|
||||
|
||||
void MainWindow::delConf()
|
||||
{
|
||||
int row = ui->configTable->selectionModel()->currentIndex().row();
|
||||
int idIntable = ui->configTable->model()->data(ui->configTable->model()->index(row, 4)).toInt();
|
||||
QString queryString = "delete from confs where id = " + QString::number(idIntable);
|
||||
SQLiteDB myDb;
|
||||
myDb.DoQuery(queryString);
|
||||
QString rmFile = "conf/" + QString::number(idIntable) + ".conf";
|
||||
QFile::remove(rmFile);
|
||||
emit updateConfTable();
|
||||
|
||||
}
|
||||
void MainWindow::updateConfTable()
|
||||
{
|
||||
SQLiteDB myDb;
|
||||
myDb.DoQuery("select COUNT(*) from confs;");
|
||||
myDb.myQuery.first();
|
||||
int rows = myDb.myQuery.value(0).toInt();
|
||||
QStandardItemModel* model = new QStandardItemModel(rows, 5);
|
||||
ui->configTable->setModel(model);
|
||||
model->setHeaderData(0, Qt::Horizontal, "Alias");
|
||||
model->setHeaderData(1, Qt::Horizontal, "Host");
|
||||
model->setHeaderData(2, Qt::Horizontal, "Port");
|
||||
model->setHeaderData(3, Qt::Horizontal, "Checked");
|
||||
model->setHeaderData(4, Qt::Horizontal, "idInTable");
|
||||
ui->configTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
ui->configTable->setColumnHidden(4, true);
|
||||
ui->configTable->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
ui->configTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
myDb.DoQuery("select * from confs");
|
||||
myDb.myQuery.first();
|
||||
for (int i = 0; i < rows; ++i) {
|
||||
model->setItem(i, 0, new QStandardItem(myDb.myQuery.value(3).toString()));
|
||||
model->setItem(i, 1, new QStandardItem(myDb.myQuery.value(1).toString()));
|
||||
model->setItem(i, 2, new QStandardItem(myDb.myQuery.value(2).toString()));
|
||||
model->setItem(i, 4, new QStandardItem(myDb.myQuery.value(0).toString()));
|
||||
if (myDb.myQuery.value(8).toInt() == 1) {
|
||||
model->setItem(i, 3, new QStandardItem("√"));
|
||||
}
|
||||
if (i < rows - 1) {
|
||||
myDb.myQuery.next();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
void MainWindow::geneConf(int idIntable)
|
||||
void MainWindow::generateConfig(int idIntable)
|
||||
{
|
||||
vConfig tmpConf;
|
||||
SQLiteDB myDb;
|
||||
myDb.DoQuery("update confs set selected = 0");
|
||||
QString queryString = "update confs set selected = 1 where id = " + QString::number(idIntable);
|
||||
myDb.DoQuery(queryString);
|
||||
emit updateConfTable();
|
||||
tmpConf.query(idIntable);
|
||||
if (tmpConf.isCustom == 1) {
|
||||
QString src = "conf/" + QString::number(idIntable) + ".conf";
|
||||
overrideInbounds(src);
|
||||
@ -281,13 +240,13 @@ void MainWindow::on_actionExit_triggered()
|
||||
|
||||
void MainWindow::renameRow()
|
||||
{
|
||||
QString text = QInputDialog::getText(this, "Rename config", "New name:", QLineEdit::Normal);
|
||||
int row = ui->configTable->currentIndex().row();
|
||||
int idIntable = ui->configTable->model()->data(ui->configTable->model()->index(row, 4)).toInt();
|
||||
SQLiteDB mydb;
|
||||
QString updateString = "update confs set alias = '" + text + "' where id = " + QString::number(idIntable);
|
||||
mydb.DoQuery(updateString);
|
||||
emit updateConfTable();
|
||||
// QString text = QInputDialog::getText(this, "Rename config", "New name:", QLineEdit::Normal);
|
||||
// int row = ui->configTable->currentIndex().row();
|
||||
// int idIntable = ui->configTable->model()->data(ui->configTable->model()->index(row, 4)).toInt();
|
||||
// SQLiteDB mydb;
|
||||
// QString updateString = "update confs set alias = '" + text + "' where id = " + QString::number(idIntable);
|
||||
// mydb.DoQuery(updateString);
|
||||
// emit updateConfTable();
|
||||
}
|
||||
|
||||
void MainWindow::scrollToBottom()
|
||||
|
@ -42,7 +42,7 @@ private slots:
|
||||
void select_triggered();
|
||||
void on_clbutton_clicked();
|
||||
void on_rtButton_clicked();
|
||||
void geneConf(int idIntable);
|
||||
void generateConfig(int idIntable);
|
||||
void on_actionVmess_triggered();
|
||||
void on_activatedTray(QSystemTrayIcon::ActivationReason reason);
|
||||
void toggleMainWindowVisibility();
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1060</width>
|
||||
<height>643</height>
|
||||
<width>867</width>
|
||||
<height>519</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -20,11 +20,11 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout" rowstretch="0,2,0,0" columnstretch="2,1">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,1,1,1,4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,9,0">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,1,1,0,0,1,4">
|
||||
<item>
|
||||
<widget class="QPushButton" name="startButton">
|
||||
<property name="text">
|
||||
@ -44,6 +44,9 @@
|
||||
<property name="text">
|
||||
<string>Restart</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -54,14 +57,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="rtButton">
|
||||
<property name="text">
|
||||
<string>Refresh Table</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
@ -73,26 +69,116 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Log Level</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>138</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>debug</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>info</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>warning</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>error</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>none</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QTableView" name="configTable">
|
||||
<property name="showGrid">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="1,1">
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Config Detail</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>60</y>
|
||||
<width>85</width>
|
||||
<height>33</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>60</y>
|
||||
<width>111</width>
|
||||
<height>33</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Restart To</string>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::DelayedPopup</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QGraphicsView" name="QR"/>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="logText"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
@ -111,7 +197,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1060</width>
|
||||
<width>867</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -135,9 +221,16 @@
|
||||
</widget>
|
||||
<addaction name="menuNew"/>
|
||||
<addaction name="actionPreferences"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionExit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuAbout">
|
||||
<property name="title">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuAbout"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
<action name="actionEdit">
|
||||
|
@ -52,7 +52,7 @@ bool RunGuard::isAnotherRunning()
|
||||
return isRunning;
|
||||
}
|
||||
|
||||
bool RunGuard::tryToRun()
|
||||
bool RunGuard::isSingleInstance()
|
||||
{
|
||||
if ( isAnotherRunning() ) { // Extra check
|
||||
return false;
|
||||
|
@ -14,7 +14,7 @@ public:
|
||||
~RunGuard();
|
||||
|
||||
bool isAnotherRunning();
|
||||
bool tryToRun();
|
||||
bool isSingleInstance();
|
||||
void release();
|
||||
|
||||
private:
|
||||
|
6
tools/FixPythonWithMinGW.bat
Normal file
6
tools/FixPythonWithMinGW.bat
Normal file
@ -0,0 +1,6 @@
|
||||
set CURRENT_PATH=%~dp0%
|
||||
cd %~dp0\..\python37\libs\
|
||||
echo EXPORTS > python37.def
|
||||
nm python37.lib | grep " T _" | sed "s/.* T _//" >> python37.def
|
||||
dlltool --input-def python37.def --dllname python37 --output-lib libpython37_mingw.a
|
||||
cd %CURRENT_PATH%\..\
|
24
tools/WindowsInstallDependencies.bat
Normal file
24
tools/WindowsInstallDependencies.bat
Normal file
@ -0,0 +1,24 @@
|
||||
@echo off
|
||||
REM Install Python
|
||||
|
||||
ECHO Downloading Python using wget...
|
||||
%~dp0\wget.exe https://www.python.org/ftp/python/3.7.3/python-3.7.3.exe -O %~dp0\python-3.7.3.exe
|
||||
|
||||
REM Get install path
|
||||
CALL :NORMALIZEPATH "\python37\"
|
||||
ECHO INSTALL_PATH=%RETVAL%
|
||||
|
||||
REM Installing Python...
|
||||
start /w "" "%~dp0\python-3.7.3.exe" /quiet TargetDir=%RETVAL%
|
||||
|
||||
:CONTINUE
|
||||
ECHO Python headers and libs are installed!
|
||||
exit 0
|
||||
|
||||
REM ========================================================================================
|
||||
|
||||
REM Path resolving using: https://stackoverflow.com/a/33404867/8364323
|
||||
:: ========== FUNCTIONS ==========
|
||||
:NORMALIZEPATH
|
||||
SET RETVAL=%~dpfn1
|
||||
EXIT /B
|
1
tools/wget.exe.REMOVED.git-id
Normal file
1
tools/wget.exe.REMOVED.git-id
Normal file
@ -0,0 +1 @@
|
||||
e21dde78d551a377ba813f6079ed610deaafadd8
|
Loading…
Reference in New Issue
Block a user