mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 19:00:22 +08:00
[UI] Several code refactors and formats, removed a too-long translation.
Former-commit-id: f466c2e29d
This commit is contained in:
parent
a715bd7314
commit
c11c724210
@ -17,43 +17,43 @@ PrefrencesWindow::PrefrencesWindow(QWidget *parent) : QDialog(parent),
|
|||||||
ui->qvVersion->setText(QV2RAY_VERSION_STRING);
|
ui->qvVersion->setText(QV2RAY_VERSION_STRING);
|
||||||
CurrentConfig = GetGlobalConfig();
|
CurrentConfig = GetGlobalConfig();
|
||||||
//
|
//
|
||||||
ui->languageComboBox->setCurrentText(QString::fromStdString(CurrentConfig.language));
|
ui->languageComboBox->setCurrentText(QSTRING(CurrentConfig.language));
|
||||||
ui->logLevelComboBox->setCurrentIndex(CurrentConfig.logLevel);
|
ui->logLevelComboBox->setCurrentIndex(CurrentConfig.logLevel);
|
||||||
ui->runAsRootCheckBox->setChecked(CurrentConfig.runAsRoot);
|
ui->runAsRootCheckBox->setChecked(CurrentConfig.runAsRoot);
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
ui->listenIPTxt->setText(QString::fromStdString(CurrentConfig.inBoundSettings.listenip));
|
ui->listenIPTxt->setText(QSTRING(CurrentConfig.inBoundSettings.listenip));
|
||||||
//
|
//
|
||||||
bool have_http = CurrentConfig.inBoundSettings.http_port != 0;
|
bool have_http = CurrentConfig.inBoundSettings.http_port != 0;
|
||||||
ui->httpCB->setChecked(have_http);
|
ui->httpCB->setChecked(have_http);
|
||||||
ui->httpPortLE->setText(QString::fromStdString(to_string(CurrentConfig.inBoundSettings.http_port)));
|
ui->httpPortLE->setText(QSTRING(to_string(CurrentConfig.inBoundSettings.http_port)));
|
||||||
ui->httpAuthCB->setChecked(CurrentConfig.inBoundSettings.http_useAuth);
|
ui->httpAuthCB->setChecked(CurrentConfig.inBoundSettings.http_useAuth);
|
||||||
//
|
//
|
||||||
ui->httpAuthCB->setEnabled(have_http);
|
ui->httpAuthCB->setEnabled(have_http);
|
||||||
ui->httpAuthCB->setChecked(CurrentConfig.inBoundSettings.http_useAuth);
|
ui->httpAuthCB->setChecked(CurrentConfig.inBoundSettings.http_useAuth);
|
||||||
ui->httpAuthUsernameTxt->setEnabled(have_http && CurrentConfig.inBoundSettings.http_useAuth);
|
ui->httpAuthUsernameTxt->setEnabled(have_http && CurrentConfig.inBoundSettings.http_useAuth);
|
||||||
ui->httpAuthPasswordTxt->setEnabled(have_http && CurrentConfig.inBoundSettings.http_useAuth);
|
ui->httpAuthPasswordTxt->setEnabled(have_http && CurrentConfig.inBoundSettings.http_useAuth);
|
||||||
ui->httpAuthUsernameTxt->setText(QString::fromStdString(CurrentConfig.inBoundSettings.httpAccount.user));
|
ui->httpAuthUsernameTxt->setText(QSTRING(CurrentConfig.inBoundSettings.httpAccount.user));
|
||||||
ui->httpAuthPasswordTxt->setText(QString::fromStdString(CurrentConfig.inBoundSettings.httpAccount.pass));
|
ui->httpAuthPasswordTxt->setText(QSTRING(CurrentConfig.inBoundSettings.httpAccount.pass));
|
||||||
ui->httpPortLE->setValidator(new QIntValidator());
|
ui->httpPortLE->setValidator(new QIntValidator());
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
bool have_socks = CurrentConfig.inBoundSettings.socks_port != 0;
|
bool have_socks = CurrentConfig.inBoundSettings.socks_port != 0;
|
||||||
ui->socksCB->setChecked(have_socks);
|
ui->socksCB->setChecked(have_socks);
|
||||||
ui->socksPortLE->setText(QString::fromStdString(to_string(CurrentConfig.inBoundSettings.socks_port)));
|
ui->socksPortLE->setText(QSTRING(to_string(CurrentConfig.inBoundSettings.socks_port)));
|
||||||
ui->socksAuthCB->setChecked(CurrentConfig.inBoundSettings.socks_useAuth);
|
ui->socksAuthCB->setChecked(CurrentConfig.inBoundSettings.socks_useAuth);
|
||||||
//
|
//
|
||||||
ui->socksAuthCB->setEnabled(have_socks);
|
ui->socksAuthCB->setEnabled(have_socks);
|
||||||
ui->socksAuthCB->setChecked(CurrentConfig.inBoundSettings.socks_useAuth);
|
ui->socksAuthCB->setChecked(CurrentConfig.inBoundSettings.socks_useAuth);
|
||||||
ui->socksAuthUsernameTxt->setEnabled(have_socks && CurrentConfig.inBoundSettings.socks_useAuth);
|
ui->socksAuthUsernameTxt->setEnabled(have_socks && CurrentConfig.inBoundSettings.socks_useAuth);
|
||||||
ui->socksAuthPasswordTxt->setEnabled(have_socks && CurrentConfig.inBoundSettings.socks_useAuth);
|
ui->socksAuthPasswordTxt->setEnabled(have_socks && CurrentConfig.inBoundSettings.socks_useAuth);
|
||||||
ui->socksAuthUsernameTxt->setText(QString::fromStdString(CurrentConfig.inBoundSettings.socksAccount.user));
|
ui->socksAuthUsernameTxt->setText(QSTRING(CurrentConfig.inBoundSettings.socksAccount.user));
|
||||||
ui->socksAuthPasswordTxt->setText(QString::fromStdString(CurrentConfig.inBoundSettings.socksAccount.pass));
|
ui->socksAuthPasswordTxt->setText(QSTRING(CurrentConfig.inBoundSettings.socksAccount.pass));
|
||||||
ui->socksPortLE->setValidator(new QIntValidator());
|
ui->socksPortLE->setValidator(new QIntValidator());
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
ui->vCoreExePathTxt->setText(QString::fromStdString(CurrentConfig.v2CorePath));
|
ui->vCoreExePathTxt->setText(QSTRING(CurrentConfig.v2CorePath));
|
||||||
ui->vCoreAssetsPathTxt->setText(QString::fromStdString(CurrentConfig.v2AssetsPath));
|
ui->vCoreAssetsPathTxt->setText(QSTRING(CurrentConfig.v2AssetsPath));
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
ui->muxEnabledCB->setChecked(CurrentConfig.mux.enabled);
|
ui->muxEnabledCB->setChecked(CurrentConfig.mux.enabled);
|
||||||
@ -74,11 +74,12 @@ PrefrencesWindow::PrefrencesWindow(QWidget *parent) : QDialog(parent),
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (auto connection, CurrentConfig.configs) {
|
foreach (auto connection, CurrentConfig.configs) {
|
||||||
ui->autoStartCombo->addItem(QString::fromStdString(connection));
|
ui->autoStartCombo->addItem(QSTRING(connection));
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->autoStartCombo->setCurrentText(QString::fromStdString(CurrentConfig.autoStartConfig));
|
ui->autoStartCombo->setCurrentText(QSTRING(CurrentConfig.autoStartConfig));
|
||||||
ui->cancelIgnoreVersionBtn->setEnabled(CurrentConfig.ignoredVersion != "");
|
ui->cancelIgnoreVersionBtn->setEnabled(CurrentConfig.ignoredVersion != "");
|
||||||
|
ui->ignoredNextVersion->setText(QSTRING(CurrentConfig.ignoredVersion));
|
||||||
finishedLoading = true;
|
finishedLoading = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>700</width>
|
<width>709</width>
|
||||||
<height>370</height>
|
<height>370</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -25,8 +25,11 @@
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
|
<property name="tabShape">
|
||||||
|
<enum>QTabWidget::Rounded</enum>
|
||||||
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -727,6 +730,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="ignoredNextVersion">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -19,73 +19,15 @@
|
|||||||
<property name="modal">
|
<property name="modal">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout" rowstretch="1,1,0,0" columnstretch="6,4">
|
|
||||||
<item row="0" column="0" rowspan="3">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="addBtn">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>+</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="removeBtn">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>-</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QTableWidget" name="subsribeTable">
|
|
||||||
<property name="rowCount">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>#SubsGroupName</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>#SubsGroupURL</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>6</x>
|
||||||
|
<y>446</y>
|
||||||
|
<width>174</width>
|
||||||
|
<height>34</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -93,21 +35,15 @@
|
|||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
|
||||||
<property name="title">
|
|
||||||
<string>#ConfigList</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QListWidget" name="subscribeList"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>433</x>
|
||||||
|
<y>226</y>
|
||||||
|
<width>281</width>
|
||||||
|
<height>214</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>#ConfigDetail</string>
|
<string>#ConfigDetail</string>
|
||||||
</property>
|
</property>
|
||||||
@ -140,22 +76,127 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>#Config</string>
|
<string>#Config</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QTextBrowser" name="jsonConfigTxt"/>
|
<widget class="QTextBrowser" name="jsonConfigTxt"/>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>#Port</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<widget class="QListWidget" name="subscribeList">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>530</x>
|
||||||
|
<y>101</y>
|
||||||
|
<width>181</width>
|
||||||
|
<height>121</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QTableWidget" name="subsribeTable">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>50</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>371</width>
|
||||||
|
<height>431</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="rowCount">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>#SubsGroupName</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>#SubsGroupURL</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>8</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>34</width>
|
||||||
|
<height>361</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="addSubsButton">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>#AddConnection</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>A</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../resources.qrc">
|
||||||
|
<normaloff>:/icons/add_connection_btn.png</normaloff>:/icons/add_connection_btn.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="removeSubsButton">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>#RemoveConnection</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>R</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../resources.qrc">
|
||||||
|
<normaloff>:/icons/remove_connection_btn.png</normaloff>:/icons/remove_connection_btn.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../resources.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
|
@ -198,12 +198,12 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../src/w_ConnectionEditWindow.ui" line="529"/>
|
<location filename="../src/w_ConnectionEditWindow.ui" line="529"/>
|
||||||
<source>#ReadBufferSize (MB)</source>
|
<source>#ReadBufferSize (MB)</source>
|
||||||
<translation>读取缓冲区大小 (MB)</translation>
|
<translation>读取缓冲区 (MB)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/w_ConnectionEditWindow.ui" line="552"/>
|
<location filename="../src/w_ConnectionEditWindow.ui" line="552"/>
|
||||||
<source>#WriteBufferSize (MB)</source>
|
<source>#WriteBufferSize (MB)</source>
|
||||||
<translation>写入缓冲区大小 (MB)</translation>
|
<translation>写入缓冲区 (MB)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/w_ConnectionEditWindow.ui" line="682"/>
|
<location filename="../src/w_ConnectionEditWindow.ui" line="682"/>
|
||||||
@ -214,13 +214,13 @@
|
|||||||
<location filename="../src/w_ConnectionEditWindow.cpp" line="395"/>
|
<location filename="../src/w_ConnectionEditWindow.cpp" line="395"/>
|
||||||
<location filename="../src/w_ConnectionEditWindow.cpp" line="406"/>
|
<location filename="../src/w_ConnectionEditWindow.cpp" line="406"/>
|
||||||
<source>#JsonPrettify</source>
|
<source>#JsonPrettify</source>
|
||||||
<translation>美化 JSON</translation>
|
<translation>格式化 JSON</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/w_ConnectionEditWindow.cpp" line="395"/>
|
<location filename="../src/w_ConnectionEditWindow.cpp" line="395"/>
|
||||||
<location filename="../src/w_ConnectionEditWindow.cpp" line="406"/>
|
<location filename="../src/w_ConnectionEditWindow.cpp" line="406"/>
|
||||||
<source>#JsonContainsError</source>
|
<source>#JsonContainsError</source>
|
||||||
<translation>JSON 格式错误</translation>
|
<translation>JSON 包含语法错误</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
|
Loading…
Reference in New Issue
Block a user