From df844da03f2aad2ed5adf841621d83c77967d81e Mon Sep 17 00:00:00 2001 From: DuckSoft Date: Wed, 24 Jun 2020 00:09:42 +0800 Subject: [PATCH] ui tweak: combobo for useragent --- src/ui/windows/w_PreferencesWindow.cpp | 14 +++++++------- src/ui/windows/w_PreferencesWindow.hpp | 2 +- src/ui/windows/w_PreferencesWindow.ui | 24 +++++++++++++++++++++--- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/ui/windows/w_PreferencesWindow.cpp b/src/ui/windows/w_PreferencesWindow.cpp index 0f4aed82..7209f048 100644 --- a/src/ui/windows/w_PreferencesWindow.cpp +++ b/src/ui/windows/w_PreferencesWindow.cpp @@ -151,7 +151,7 @@ PreferencesWindow::PreferencesWindow(QWidget *parent) : QvDialog(parent), Curren qvProxyPortCB->setValue(CurrentConfig.networkConfig.port); qvProxyAddressTxt->setText(CurrentConfig.networkConfig.address); qvProxyTypeCombo->setCurrentText(CurrentConfig.networkConfig.type); - qvNetworkUATxt->setText(CurrentConfig.networkConfig.userAgent); + qvNetworkUATxt->setEditText(CurrentConfig.networkConfig.userAgent); // qvProxyNoProxy->setChecked(CurrentConfig.networkConfig.proxyType == Qv2rayConfig_Network::QVPROXY_NONE); qvProxySystemProxy->setChecked(CurrentConfig.networkConfig.proxyType == Qv2rayConfig_Network::QVPROXY_SYSTEM); @@ -881,12 +881,6 @@ void PreferencesWindow::on_qvProxyPortCB_valueChanged(int arg1) CurrentConfig.networkConfig.port = arg1; } -void PreferencesWindow::on_qvNetworkUATxt_textEdited(const QString &arg1) -{ - LOADINGCHECK - CurrentConfig.networkConfig.userAgent = arg1; -} - void PreferencesWindow::on_setAllowInsecureCB_stateChanged(int arg1) { LOADINGCHECK @@ -1139,3 +1133,9 @@ void PreferencesWindow::on_latencyICMPingRB_clicked() latencyTCPingRB->setChecked(false); #endif } + +void PreferencesWindow::on_qvNetworkUATxt_editTextChanged(const QString &arg1) +{ + LOADINGCHECK + CurrentConfig.networkConfig.userAgent = arg1; +} diff --git a/src/ui/windows/w_PreferencesWindow.hpp b/src/ui/windows/w_PreferencesWindow.hpp index d30f1ecf..76d16884 100644 --- a/src/ui/windows/w_PreferencesWindow.hpp +++ b/src/ui/windows/w_PreferencesWindow.hpp @@ -95,7 +95,6 @@ class PreferencesWindow void on_qvProxyAddressTxt_textEdited(const QString &arg1); void on_qvProxyTypeCombo_currentTextChanged(const QString &arg1); void on_qvProxyPortCB_valueChanged(int arg1); - void on_qvNetworkUATxt_textEdited(const QString &arg1); void on_setAllowInsecureCB_stateChanged(int arg1); void on_setTestLatenctCB_stateChanged(int arg1); void on_setAllowInsecureCiphersCB_stateChanged(int arg1); @@ -122,6 +121,7 @@ class PreferencesWindow void on_fixedAutoConnectRB_clicked(); void on_latencyTCPingRB_clicked(); void on_latencyICMPingRB_clicked(); + void on_qvNetworkUATxt_editTextChanged(const QString &arg1); private: // diff --git a/src/ui/windows/w_PreferencesWindow.ui b/src/ui/windows/w_PreferencesWindow.ui index 02214604..ec735acf 100644 --- a/src/ui/windows/w_PreferencesWindow.ui +++ b/src/ui/windows/w_PreferencesWindow.ui @@ -357,10 +357,28 @@ For example, for updating subscriptions. - - - + + + true + + Qv2ray/$VERSION WebRequestHelper + + + + Qv2ray/$VERSION WebRequestHelper + + + + + Mozilla/5.0 (X11; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0 + + + + + + +