From 6a2b7038414d2ffdd64ba1a7edeef49587e21ae3 Mon Sep 17 00:00:00 2001 From: "Leroy.H.Y" Date: Tue, 3 Sep 2019 13:22:39 +0800 Subject: [PATCH] Bumped to version 1.3.5 Former-commit-id: d4f54a70ec6fdca8adb599930acc1ee99d50a792 --- src/Qv2rayBase.h | 8 +- src/main.cpp | 16 ++- src/w_MainWindow.cpp | 2 +- src/w_PrefrencesWindow.ui | 3 - translations/en-US.ts | 232 +++++++++++++++++++++++--------------- translations/zh-CN.ts | 232 +++++++++++++++++++++++--------------- 6 files changed, 297 insertions(+), 196 deletions(-) diff --git a/src/Qv2rayBase.h b/src/Qv2rayBase.h index 292acc9e..acd5f046 100644 --- a/src/Qv2rayBase.h +++ b/src/Qv2rayBase.h @@ -5,7 +5,7 @@ #include "QvTinyLog.h" #include "QvCoreConfigObjects.h" -#define QV2RAY_VERSION_STRING "v" QV_MAJOR_VERSION ".4.2" +#define QV2RAY_VERSION_STRING "v" QV_MAJOR_VERSION ".5" #define QV2RAY_CONFIG_VERSION 2 #define QV2RAY_CONFIG_DIR_PATH (Qv2ray::Utils::GetConfigDirPath() + "/") @@ -62,7 +62,8 @@ namespace Qv2ray bool http_useAuth; AccountObject httpAccount; Qv2rayBasicInboundsConfig(): listenip(), socks_port(), socks_useAuth(), socksAccount(), http_port(), http_useAuth(), httpAccount() {} - Qv2rayBasicInboundsConfig(string listen, int socksPort, int httpPort): Qv2rayBasicInboundsConfig() { + Qv2rayBasicInboundsConfig(string listen, int socksPort, int httpPort): Qv2rayBasicInboundsConfig() + { socks_port = socksPort; http_port = httpPort; listenip = listen; @@ -96,7 +97,8 @@ namespace Qv2ray map subscribes; MuxObject mux; Qv2rayConfig(): config_version(QV2RAY_CONFIG_VERSION), runAsRoot(false), logLevel(), proxyDefault(), proxyCN(), withLocalDNS(), inBoundSettings(), configs(), subscribes(), mux() { } - Qv2rayConfig(string lang, string exePath, string assetsPath, int log, Qv2rayBasicInboundsConfig _inBoundSettings): Qv2rayConfig() { + Qv2rayConfig(string lang, string exePath, string assetsPath, int log, Qv2rayBasicInboundsConfig _inBoundSettings): Qv2rayConfig() + { // These settings below are defaults. ignoredVersion = ""; autoStartConfig = ""; diff --git a/src/main.cpp b/src/main.cpp index 405ab5ee..1dd4dc4e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,7 +56,9 @@ bool initQv() return false; } } + QFile configFile(QV2RAY_CONFIG_FILE_PATH); + if (!configFile.exists()) { // This is first run! // @@ -74,9 +76,11 @@ bool initQv() auto conf = JSONFromString(StringFromFile(&configFile)); auto confVersion = conf["config_version"].toVariant().toString(); auto newVersion = QSTRING(to_string(QV2RAY_CONFIG_VERSION)); - if(QString::compare(confVersion, newVersion) != 0) { + + if (QString::compare(confVersion, newVersion) != 0) { conf = UpgradeConfig(stoi(conf["config_version"].toString().toStdString()), QV2RAY_CONFIG_VERSION, conf); } + auto confObject = StructFromJSONString(JSONToString(conf)); SetGlobalConfig(confObject); SaveGlobalConfig(); @@ -135,17 +139,18 @@ int main(int argc, char *argv[]) "DEBUG_VERSION" #endif ); - -#ifdef __WIN32 +#ifndef __APPLE__ auto osslReqVersion = QSslSocket::sslLibraryBuildVersionString().toStdString(); auto osslCurVersion = QSslSocket::sslLibraryVersionString().toStdString(); - if (osslCurVersion != osslReqVersion){ + LOG(MODULE_NETWORK, "Current OpenSSL version: " + osslCurVersion) + + if (osslCurVersion != osslReqVersion) { LOG(MODULE_NETWORK, "Required OpenSSL version: " + osslReqVersion) - LOG(MODULE_NETWORK, "Current OpenSSL version: " + osslCurVersion) QvMessageBox(nullptr, QObject::tr("DependencyMissing"), QObject::tr("osslDependMissing,PleaseReDownload")); LOG(MODULE_NETWORK, "OpenSSL library MISSING, Quitting.") return -2; } + #endif if (!guard.isSingleInstance()) { @@ -153,6 +158,7 @@ int main(int argc, char *argv[]) QvMessageBox(nullptr, "Qv2ray", QObject::tr("#AnotherInstanceRunning")); return -1; } + // Show MainWindow MainWindow w; return _qApp.exec(); diff --git a/src/w_MainWindow.cpp b/src/w_MainWindow.cpp index ae935ef6..c31cbb0b 100644 --- a/src/w_MainWindow.cpp +++ b/src/w_MainWindow.cpp @@ -207,7 +207,6 @@ void MainWindow::on_startButton_clicked() void MainWindow::on_stopButton_clicked() { if (vinstance->Status != STOPPED) { - LOG(MODULE_VCORE, "Disconnected: " + CurrentConnectionName.toStdString()) this->vinstance->Stop(); hTray->setToolTip(TRAY_TOOLTIP_PREFIX); QFile(QV2RAY_GENERATED_FILE_PATH).remove(); @@ -304,6 +303,7 @@ void MainWindow::QTextScrollToBottom() void MainWindow::ShowAndSetConnection(int index, bool SetConnection, bool ApplyConnection) { if (index < 0) return; + auto guiConnectionName = ui->connectionListWidget->item(index)->text(); // --------- BRGIN Show Connection auto outBoundRoot = (connections[guiConnectionName])["outbounds"].toArray().first().toObject(); diff --git a/src/w_PrefrencesWindow.ui b/src/w_PrefrencesWindow.ui index ab20d2bb..45ed01a2 100644 --- a/src/w_PrefrencesWindow.ui +++ b/src/w_PrefrencesWindow.ui @@ -553,9 +553,6 @@ 10 - - #QvVersion - diff --git a/translations/en-US.ts b/translations/en-US.ts index 46afc48d..8a2ffecb 100644 --- a/translations/en-US.ts +++ b/translations/en-US.ts @@ -211,14 +211,14 @@ Key - - + + #JsonPrettify Prettify JSON - - + + #JsonContainsError JSON is in a bad syntax @@ -297,18 +297,18 @@ Open Config File - + #NotValidVMessProtocolString VMess connection string is invalid - - + + #VMessCheck VMess connection string check - + #INTERNAL_ERROR Internal Error @@ -444,7 +444,7 @@ Connected - + #Disconnected Disconnected @@ -492,7 +492,7 @@ - + #Hide Hide @@ -578,8 +578,8 @@ - - + + #Show Show @@ -588,83 +588,83 @@ PrefrencesWindow - - + + Prefrences Preferences - + #General General - + #Language Language - + zh-CN - + en-US - + #RunAsRoot Run v2ray as root - - - - - - - - - - + + + + + + + + + + #Enabled Enabled - + #LogLevel Log Level - + debug Debug - + info Info - + warning Warning - + error Error - - + + #Select Select - + #AutoStartEntry Auto Connect To @@ -679,45 +679,40 @@ Cancel Ignore - + #ProxyGlobal Use Proxy as Default - + #ProxyCN Use Proxy for China Mainland - + #WithLocalDNS Use localhost DNS - + #DNSList DNS Address List - + #About About - + Qv2ray Qv2ray - + #Version: Version: - - - #QvVersion - - #OfficialRepo: @@ -744,96 +739,96 @@ - + none Do not use - + #VCoreExePath V2ray Kernal Path - + #VCoreAssetsPath V2ray Assets Path - + #MuxSettings Mux Settings - + #InBoundSettings Inbound Settings - + #ListenIP Listen IP - + #HTTPInBoundSettings HTTP Inbound Settings - + #SOCKSBoundSettings SOCKS Inbound Settings - + #RouteSettings Route Settings - + #Concurrency Maximum Connections - - + + #Port Port - - + + #Username Username - - + + #Auth Authentication - - + + #Password Password - + PortNumbersCannotBeSame Port numbers cannot be the same - + RunAsRootNotOnWindows Run as root is not avaliable on Windows Platform - + #OpenVCoreFile Open v2rat-core file - + OpenVAssetsDir Open v2ray assets folder @@ -841,17 +836,17 @@ QObject - + DependencyMissing Dependency Missing - + osslDependMissing,PleaseReDownload OpenSSL DLL is missing from the directory where Qv2ray.exe is located in, Please ReDownload the application, or contact support - + #AnotherInstanceRunning Another instance is already running @@ -876,6 +871,49 @@ VMess string decode error + + RouteEditor + + + Dialog + + + + + #Outbounds + + + + + #OutboundDetail + + + + + #Tag + + + + + #Type + Type + + + + #Address + + + + + #Port + Port + + + + #EditCurrentOutbound + + + w_SubscribeEditor @@ -884,49 +922,59 @@ - + + #Port + Port + + + #SubsGroupName - + #SubsGroupURL - - #ConfigList + + #AddConnection + Add a connection + + + + A - + + #RemoveConnection + Remove a connection + + + + R + + + + #ConfigDetail Detailed Config Info - + #Type Type - + #Server - + #Config - - - + - - - - - - - - diff --git a/translations/zh-CN.ts b/translations/zh-CN.ts index d0455473..bd4b0240 100644 --- a/translations/zh-CN.ts +++ b/translations/zh-CN.ts @@ -211,14 +211,14 @@ 密钥 - - + + #JsonPrettify 格式化 JSON - - + + #JsonContainsError JSON 包含语法错误 @@ -297,18 +297,18 @@ 打开配置文件 - + #NotValidVMessProtocolString VMess 连接字符串不合法 - - + + #VMessCheck VMess 连接字符串检查 - + #INTERNAL_ERROR 内部错误 @@ -444,7 +444,7 @@ 已连接 - + #Disconnected 已断开连接 @@ -492,7 +492,7 @@ - + #Hide 隐藏 @@ -578,8 +578,8 @@ - - + + #Show 显示 @@ -588,83 +588,83 @@ PrefrencesWindow - - + + Prefrences 首选项 - + #General 一般 - + #Language 语言 - + zh-CN - + en-US - + #RunAsRoot 使用 root 启动 - - - - - - - - - - + + + + + + + + + + #Enabled 启用 - + #LogLevel 日志等级 - + debug 调试 - + info 信息 - + warning 警告 - + error 错误 - - + + #Select 选择 - + #AutoStartEntry 自动连接到 @@ -679,45 +679,40 @@ 取消忽略 - + #ProxyGlobal 默认走代理 - + #ProxyCN 中国大陆使用代理 - + #WithLocalDNS 使用本地 DNS - + #DNSList DNS 列表 - + #About 关于 - + Qv2ray Qv2ray - + #Version: 版本号: - - - #QvVersion - - #OfficialRepo: @@ -744,96 +739,96 @@ - + none 不使用 - + #VCoreExePath v2ray 内核程序位置 - + #VCoreAssetsPath v2ray 资源文件夹 - + #MuxSettings Mux 设置 - + #InBoundSettings 入站设置 - + #ListenIP 监听 IP - + #HTTPInBoundSettings HTTP 入站设置 - + #SOCKSBoundSettings SOCKS 入站设置 - + #RouteSettings 路由配置 - + #Concurrency 最大并发连接数 - - + + #Port 端口 - - + + #Username 用户名 - - + + #Auth 鉴权 - - + + #Password 密码 - + PortNumbersCannotBeSame 端口号不能相同 - + RunAsRootNotOnWindows Windows 平台不支持这个选项 - + #OpenVCoreFile 打开 v2ray 内核文件 - + OpenVAssetsDir 打开 v2ray 资源文件夹 @@ -841,17 +836,17 @@ QObject - + DependencyMissing 依赖项缺失 - + osslDependMissing,PleaseReDownload OpenSSL 部分文件缺失,Qv2ray 将不能正常工作,请重新下载程序,或联系支持 - + #AnotherInstanceRunning 另一个实例正在运行 @@ -876,6 +871,49 @@ VMess 解码失败 + + RouteEditor + + + Dialog + + + + + #Outbounds + + + + + #OutboundDetail + + + + + #Tag + + + + + #Type + 类型 + + + + #Address + + + + + #Port + 端口 + + + + #EditCurrentOutbound + + + w_SubscribeEditor @@ -884,49 +922,59 @@ - + + #Port + 端口 + + + #SubsGroupName - + #SubsGroupURL - - #ConfigList + + #AddConnection + 添加连接 + + + + A - + + #RemoveConnection + 删除连接 + + + + R + + + + #ConfigDetail 配置详细信息 - + #Type 类型 - + #Server - + #Config - - - + - - - - - - - -