ui tweak: combobo for useragent

This commit is contained in:
DuckSoft 2020-06-24 00:09:42 +08:00
parent 7c178c9e7c
commit df844da03f
No known key found for this signature in database
GPG Key ID: 7A3A9FA6E4FD4A8D
3 changed files with 29 additions and 11 deletions

View File

@ -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;
}

View File

@ -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:
//

View File

@ -357,10 +357,28 @@ For example, for updating subscriptions.</string>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="qvNetworkUATxt">
<property name="text">
<string/>
<widget class="QComboBox" name="qvNetworkUATxt">
<property name="editable">
<bool>true</bool>
</property>
<property name="text">
<string notr="true">Qv2ray/$VERSION WebRequestHelper</string>
</property>
<item>
<property name="text">
<string notr="true">Qv2ray/$VERSION WebRequestHelper</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Mozilla/5.0 (X11; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0</string>
</property>
</item>
<item>
<property name="text">
<string notr="true"></string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">