Merge pull request #589 from Qv2ray/dev-refactor-system-proxy

Giving up on attempt to fix Deepin.
This commit is contained in:
DuckSoft 2020-05-08 11:26:15 +08:00 committed by GitHub
commit a6ac091cc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 20 deletions

View File

@ -232,7 +232,7 @@ namespace Qv2ray::components::proxy
QStringList actions; QStringList actions;
actions << QString("gsettings set org.gnome.system.proxy mode '%1'").arg("manual"); actions << QString("gsettings set org.gnome.system.proxy mode '%1'").arg("manual");
bool isKDE = qEnvironmentVariable("XDG_SESSION_DESKTOP") == "KDE"; bool isKDE = qEnvironmentVariable("XDG_SESSION_DESKTOP") == "KDE";
bool isDDE = isKDE ? false : qEnvironmentVariable("XDG_SESSION_DESKTOP") == "deepin"; bool isDDE = isKDE ? false : qEnvironmentVariable("XDG_CURRENT_DESKTOP").toLower() == "deepin";
const auto configPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation); const auto configPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
// Configure HTTP Proxies for HTTP, FTP and HTTPS // Configure HTTP Proxies for HTTP, FTP and HTTPS
@ -315,16 +315,16 @@ namespace Qv2ray::components::proxy
const auto deepinWarnTitle = QObject::tr("Deepin Detected"); const auto deepinWarnTitle = QObject::tr("Deepin Detected");
const auto deepinWarnMessage = const auto deepinWarnMessage =
QObject::tr("Deepin plays smart and sets you the wrong HTTPS_PROXY environment variable. ") + NEWLINE + // QObject::tr("Deepin plays smart and sets you the wrong HTTPS_PROXY, FTP_PROXY environment variable.") + NEWLINE + //
QObject::tr("The original scheme should be http://, but he will replace with https://, causing the problem. ") + NEWLINE + // QObject::tr("The origin scheme http is wrongly replaced by https and ftp, causing the problem.") + NEWLINE + //
QObject::tr("Qv2ray will help you change it back and make things work again. "); QObject::tr("Qv2ray cannot help you change them back. Please don't blame us if things go wrong."); //
QvMessageBoxWarn(nullptr, deepinWarnTitle, deepinWarnMessage); QvMessageBoxWarn(nullptr, deepinWarnTitle, deepinWarnMessage);
} }
// set them back! // set them back! - NOPE. setenv only works within your little program.
const auto httpProxyURL = QString("http://%1:%2").arg(address, QSTRN(httpPort)).toStdString(); // const auto httpProxyURL = QString("http://%1:%2").arg(address, QSTRN(httpPort)).toStdString();
setenv("https_proxy", httpProxyURL.c_str(), true); // setenv("https_proxy", httpProxyURL.c_str(), true);
setenv("ftp_proxy", httpProxyURL.c_str(), true); // setenv("ftp_proxy", httpProxyURL.c_str(), true);
} }
#else #else

View File

@ -2114,15 +2114,15 @@ For example, for updating subscriptions.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<source>Deepin plays smart and sets you the wrong HTTPS_PROXY environment variable. </source> <source>Deepin plays smart and sets you the wrong HTTPS_PROXY, FTP_PROXY environment variable.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<source>The original scheme should be http://, but he will replace with https://, causing the problem. </source> <source>The origin scheme http is wrongly replaced by https and ftp, causing the problem.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<source>Qv2ray will help you change it back and make things work again. </source> <source>Qv2ray cannot help you change them back. Please don&apos;t blame us if things go wrong.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>

View File

@ -2919,15 +2919,27 @@ For example, for updating subscriptions.</source>
</message> </message>
<message> <message>
<source>Deepin plays smart and sets you the wrong HTTPS_PROXY environment variable. </source> <source>Deepin plays smart and sets you the wrong HTTPS_PROXY environment variable. </source>
<translation>DeepinのバカHTTPS_PROXY環境変数を設定します</translation> <translation type="vanished">DeepinのバカHTTPS_PROXY環境変数を設定します</translation>
</message> </message>
<message> <message>
<source>The original scheme should be http://, but he will replace with https://, causing the problem. </source> <source>The original scheme should be http://, but he will replace with https://, causing the problem. </source>
<translation> http:// であるべきなのですが、彼は https:// に置き換えて問題を引き起こします。</translation> <translation type="vanished"> http:// であるべきなのですが、彼は https:// に置き換えて問題を引き起こします。</translation>
</message> </message>
<message> <message>
<source>Qv2ray will help you change it back and make things work again. </source> <source>Qv2ray will help you change it back and make things work again. </source>
<translation>Qv2rayはそれを元に戻して</translation> <translation type="vanished">Qv2rayはそれを元に戻して</translation>
</message>
<message>
<source>Deepin plays smart and sets you the wrong HTTPS_PROXY, FTP_PROXY environment variable.</source>
<translation>DeepinのバカHTTPS_PROXYとFTP_PROXYの環境変数を設定します</translation>
</message>
<message>
<source>The origin scheme http is wrongly replaced by https and ftp, causing the problem.</source>
<translation>httpがhttpsとftpに間違って置き換えられてしまい</translation>
</message>
<message>
<source>Qv2ray cannot help you change them back. Please don&apos;t blame us if things go wrong.</source>
<translation>Qv2rayでは元に戻すことはできません</translation>
</message> </message>
</context> </context>
<context> <context>

View File

@ -2801,15 +2801,15 @@ For example, for updating subscriptions.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<source>Deepin plays smart and sets you the wrong HTTPS_PROXY environment variable. </source> <source>Deepin plays smart and sets you the wrong HTTPS_PROXY, FTP_PROXY environment variable.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<source>The original scheme should be http://, but he will replace with https://, causing the problem. </source> <source>The origin scheme http is wrongly replaced by https and ftp, causing the problem.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<source>Qv2ray will help you change it back and make things work again. </source> <source>Qv2ray cannot help you change them back. Please don&apos;t blame us if things go wrong.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>

View File

@ -2497,15 +2497,27 @@ For example, for updating subscriptions.</source>
</message> </message>
<message> <message>
<source>Deepin plays smart and sets you the wrong HTTPS_PROXY environment variable. </source> <source>Deepin plays smart and sets you the wrong HTTPS_PROXY environment variable. </source>
<translation>Deepin HTTPS_PROXY </translation> <translation type="vanished">Deepin HTTPS_PROXY </translation>
</message> </message>
<message> <message>
<source>The original scheme should be http://, but he will replace with https://, causing the problem. </source> <source>The original scheme should be http://, but he will replace with https://, causing the problem. </source>
<translation> scheme http://,但 Deepin 将其替换成了 https://,导致 HTTPS 代理无法正常使用。</translation> <translation type="vanished"> scheme http://,但 Deepin 将其替换成了 https://,导致 HTTPS 代理无法正常使用。</translation>
</message> </message>
<message> <message>
<source>Qv2ray will help you change it back and make things work again. </source> <source>Qv2ray will help you change it back and make things work again. </source>
<translation>Qv2ray </translation> <translation type="vanished">Qv2ray </translation>
</message>
<message>
<source>Deepin plays smart and sets you the wrong HTTPS_PROXY, FTP_PROXY environment variable.</source>
<translation>Deepin可能自作聪明 HTTPS_PROXY FTP_PROXY </translation>
</message>
<message>
<source>The origin scheme http is wrongly replaced by https and ftp, causing the problem.</source>
<translation> http:// 可能被错误地替换为 https:// 和 ftp://,导致这个问题。</translation>
</message>
<message>
<source>Qv2ray cannot help you change them back. Please don&apos;t blame us if things go wrong.</source>
<translation>Qv2ray </translation>
</message> </message>
</context> </context>
<context> <context>