diff --git a/.gitignore b/.gitignore index bda01f2a..ae06ddaf 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,7 @@ v2ctl v2ray v2ray.sig v2ctl.sig - +./.vscode build/ +python37/ +tools/python-3.7.3.exe diff --git a/Hv2ray.pro b/Hv2ray.pro index e3e6d2d6..c7942720 100644 --- a/Hv2ray.pro +++ b/Hv2ray.pro @@ -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 diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..3cf54f58 --- /dev/null +++ b/appveyor.yml @@ -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 diff --git a/src/confedit.cpp b/src/confedit.cpp index d4409879..21babf72 100644 --- a/src/confedit.cpp +++ b/src/confedit.cpp @@ -1,13 +1,9 @@ #include "confedit.h" #include "ui_confedit.h" #include -#include -#include #include "mainwindow.h" #include -#include #include -#include "db.h" #include 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(); -} diff --git a/src/confedit.h b/src/confedit.h index a37de774..d1dc6c1e 100644 --- a/src/confedit.h +++ b/src/confedit.h @@ -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; diff --git a/src/confedit.ui b/src/confedit.ui index dd9b0d06..78bb0646 100644 --- a/src/confedit.ui +++ b/src/confedit.ui @@ -6,239 +6,854 @@ 0 0 - 982 - 652 + 854 + 629 + + + 0 + 0 + + ConfEdit - - - - 20 - 30 - 951 - 611 - - - - - - - - - 0 - - - 0 - - - - - 15 - - - - - - - Transport - - - - - - - - TCP (tcp) - - - - - HTTP (http) - - - - - WebSocket (ws) - - - - - mKCP (kcp) - - - - - Domain Socket (domainsocket) - - - - - Quick UDP Internet Connection (quic) - - - - - - - - AlterID: - - - - - - - Security: - - - - - - - IP Address : - - - - - - - - - - 80 - - - - - - - Alias: - - - - - - - UUID: - - - - - - - - auto - - - - - aes-128-gcm - - - - - chacha20-poly1305 - - - - - none - - - - - - - - Port: - - - - - - - - - - 36 - - - - - - - 5 - - - - - - - 5 - - - - - - - - - Qt::LeftToRight - - - Transport Settings - - - - - 10 - 30 - 601 - 241 - + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + 0 - + + 0 + + + + + 15 + + + + + + + Transport + + + + + + + + tcp (TCP) + + + + + http (HTTP) + + + + + ws (WebSocket) + + + + + kcp (mKCP) + + + + + domainsocket (Domain Socket) + + + + + quic (Quick UDP Internet Connection) + + + + + + + + Alter ID + + + + + + + Security + + + + + + + + + + 80 + + + + + + + Name + + + + + + + UUID + + + + + + + + auto + + + + + aes-128-gcm + + + + + chacha20-poly1305 + + + + + none + + + + + + + + Port + + + + + + + + + + 36 + + + + + + + 5 + + + + + + + 5 + + + + + + + Host + + + + + + + + + Qt::LeftToRight + + + Transport Settings (StreamSettingsObject) + + - - 0 + + + 0 + 0 + - + + + 0 + 0 + + + + + 0 + 0 + + + + 3 + + + true + + - TCP Settings + TCP + + + + + + + + + + none (NoneHeaderObject) + + + + + http (HttpHeaderobject) + + + + + + + + type + + + + + + + + + + + + + request (HTTPRequestObject) + + + + + + + QPlainTextEdit::NoWrap + + + { + "version": "1.1", + "method": "GET", + "path": ["/"], + "headers": { + "Host": ["www.baidu.com", "www.bing.com"], + "User-Agent": [ + "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36", + "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46" + ], + "Accept-Encoding": ["gzip, deflate"], + "Connection": ["keep-alive"], + "Pragma": "no-cache" + } +} + + + + false + + + + + + + + + + + response (HTTPResponseObject) + + + + + + + QPlainTextEdit::NoWrap + + + { + "version": "1.1", + "status": "200", + "reason": "OK", + "headers": { + "Content-Type": ["application/octet-stream", "video/mpeg"], + "Transfer-Encoding": ["chunked"], + "Connection": ["keep-alive"], + "Pragma": "no-cache" + } +} + + + + + + + + + + - + - Tab 2 + HTTP + + + + + + + + v2ray.com + + + + + + + + host + + + + + + + path + + + + + + + / + + + + + + + + + + WebSocket + + + + + + + + + + path + + + + + + + / + + + + + + + + + headers (Key Value Pair) + + + + + + + + + + 0 + 0 + + + + QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked + + + QAbstractItemView::ScrollPerPixel + + + QAbstractItemView::ScrollPerPixel + + + QListView::ListMode + + + true + + + -1 + + + + Host + + + + + + + + + 0 + 0 + + + + QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked + + + + v2ray.com + + + + + + + + + + + + + mKCP + + + + + + + + + + uplinkCapaciry + + + + + + + 4096 + + + 5 + + + + + + + + + + + tti + + + + + + + 10 + + + 100 + + + 50 + + + + + + + + + + + downlinkCapacity + + + + + + + 4096 + + + 20 + + + + + + + + + + + readBufferSize + + + + + + + 1024 + + + 2 + + + + + + + + + + + mtu + + + + + + + 576 + + + 1460 + + + 1350 + + + + + + + + + + + writeBufferSize + + + + + + + 1024 + + + 2 + + + + + + + + + + + congestion + + + + + + + Enabled + + + + + + + + + + + header (Header Object) + + + + + + type + + + + + + + + 0 + 0 + + + + + none (None) + + + + + srtp (SRTP, FaceTime) + + + + + utp (BitTorrent) + + + + + wechat-video (WeChat Video Message) + + + + + dtls (DTLS 1.2) + + + + + wireguard (WireGuard fake packets) + + + + + + + + + + + + DomainSocket + + + + + + + + path + + + + + + + /path/to/ds/file + + + + + + + + + + QUIC + + + + + + + + security + + + + + + + + 0 + 0 + + + + + none + + + + + aes-128-gcm + + + + + chacha20-poly1305 + + + + + + + + key + + + + + + + xxxxx + + + + + + + header + + + + + + + + 0 + 1 + + + + header (HeaderObject) + + + + + + + + type + + + + + + + + 0 + 0 + + + + + none (None) + + + + + srtp (SRTP, FaceTime) + + + + + utp (BitTorrent) + + + + + wechat-video (WeChat Video Message) + + + + + dtls (DTLS 1.2) + + + + + wireguard (WireGuard fake packets) + + + + + + + + + + + + - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - + + + + + + + + + diff --git a/src/db.cpp b/src/db.cpp deleted file mode 100644 index 9f5eb56e..00000000 --- a/src/db.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "db.h" -#include -#include -#include "mainwindow.h" -#include - -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(); -} diff --git a/src/db.h b/src/db.h deleted file mode 100644 index 1b2d371e..00000000 --- a/src/db.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef DB_H -#define DB_H -#include - -class SQLiteDB -{ -public: - SQLiteDB(); - QSqlQuery myQuery; - void DoQuery(QString queryString); - -}; - -#endif // DB_H diff --git a/src/inbound_settings.cpp b/src/inbound_settings.cpp index f429faf3..25674045 100644 --- a/src/inbound_settings.cpp +++ b/src/inbound_settings.cpp @@ -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"); diff --git a/src/main.cpp b/src/main.cpp index c4d60192..0f91c4f4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,9 +2,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -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; } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 49ff82d6..2440c053 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -8,11 +8,10 @@ #include #include -#include "db.h" #include "import_vmess.h" #include "inbound_settings.h" #include "mainwindow.h" -#include "ui_mainwindow.h" +#include #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() diff --git a/src/mainwindow.h b/src/mainwindow.h index d813aa07..a122a6c2 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -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(); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 3451315d..f68fb3ce 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 1060 - 643 + 867 + 519 @@ -20,11 +20,11 @@ 0 - - - - - + + + + + @@ -44,6 +44,9 @@ Restart + + false + @@ -54,14 +57,7 @@ - - - Refresh Table - - - - - + Qt::Horizontal @@ -73,26 +69,116 @@ + + + + Log Level + + + + + + + + 0 + 0 + + + + + 138 + 0 + + + + + debug + + + + + info + + + + + warning + + + + + error + + + + + none + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + - - - - true - - + + + + + + + + + Config Detail + + + + + 30 + 60 + 85 + 33 + + + + PushButton + + + + + + 180 + 60 + 111 + 33 + + + + Restart To + + + QToolButton::DelayedPopup + + + + + - - - - - - - Qt::Horizontal - - - - + @@ -111,7 +197,7 @@ 0 0 - 1060 + 867 29 @@ -135,9 +221,16 @@ + + + + About + + + diff --git a/src/runguard.cpp b/src/runguard.cpp index ab054cc4..486941d1 100644 --- a/src/runguard.cpp +++ b/src/runguard.cpp @@ -52,7 +52,7 @@ bool RunGuard::isAnotherRunning() return isRunning; } -bool RunGuard::tryToRun() +bool RunGuard::isSingleInstance() { if ( isAnotherRunning() ) { // Extra check return false; diff --git a/src/runguard.h b/src/runguard.h index 3095e586..45e7e3ba 100644 --- a/src/runguard.h +++ b/src/runguard.h @@ -14,7 +14,7 @@ public: ~RunGuard(); bool isAnotherRunning(); - bool tryToRun(); + bool isSingleInstance(); void release(); private: diff --git a/tools/FixPythonWithMinGW.bat b/tools/FixPythonWithMinGW.bat new file mode 100644 index 00000000..3ab8766a --- /dev/null +++ b/tools/FixPythonWithMinGW.bat @@ -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%\..\ diff --git a/tools/WindowsInstallDependencies.bat b/tools/WindowsInstallDependencies.bat new file mode 100644 index 00000000..75e1df43 --- /dev/null +++ b/tools/WindowsInstallDependencies.bat @@ -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 \ No newline at end of file diff --git a/tools/wget.exe.REMOVED.git-id b/tools/wget.exe.REMOVED.git-id new file mode 100644 index 00000000..df6f2392 --- /dev/null +++ b/tools/wget.exe.REMOVED.git-id @@ -0,0 +1 @@ +e21dde78d551a377ba813f6079ed610deaafadd8 \ No newline at end of file