system proxy format (windows)

This commit is contained in:
arm64v8a
2022-10-28 20:12:28 +09:00
parent 68d7ce31c5
commit 570600704b
10 changed files with 61 additions and 32 deletions

View File

@@ -2,6 +2,7 @@
#include "ui_dialog_basic_settings.h"
#include "qv2ray/v2/ui/widgets/editors/w_JsonEditor.hpp"
#include "fmt/Preset.hpp"
#include "ui/ThemeManager.hpp"
#include "main/GuiUtils.hpp"
#include "main/NekoRay.hpp"
@@ -78,6 +79,22 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent)
C_EDIT_JSON_ALLOW_EMPTY(custom_inbound)
});
#ifdef Q_OS_WIN
connect(ui->sys_proxy_format, &QPushButton::clicked, this, [=] {
bool ok;
auto str = QInputDialog::getItem(this, ui->sys_proxy_format->text() + " (Windows)",
tr("Advanced system proxy settings. Please select a format."),
Preset::Windows::system_proxy_format,
Preset::Windows::system_proxy_format.indexOf(
NekoRay::dataStore->system_proxy_format),
false, &ok
);
if (ok) NekoRay::dataStore->system_proxy_format = str;
});
#else
ui->sys_proxy_format->hide();
#endif
// Style
if (IS_NEKO_BOX) {
ui->connection_statistics_box->setDisabled(true);