Skip to content

Commit

Permalink
minor ui improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a committed May 22, 2023
1 parent 68fecb7 commit f18d1c9
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 40 deletions.
2 changes: 1 addition & 1 deletion db/ConfigBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ namespace NekoGui {

// mux common
auto needMux = ent->type == "vmess" || ent->type == "trojan" || ent->type == "vless" || ent->type == "shadowsocks";
needMux &= !dataStore->mux_protocol.isEmpty() && dataStore->mux_concurrency > 0;
needMux &= dataStore->mux_concurrency > 0;

if (stream != nullptr) {
if (IS_NEKO_BOX) {
Expand Down
2 changes: 1 addition & 1 deletion fmt/Bean2CoreObj_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace NekoGui_fmt {
tls["reality"] = QJsonObject{
{"enabled", true},
{"public_key", reality_pbk},
{"short_id", reality_sid},
{"short_id", reality_sid.split(",")[0]},
};
}
outbound->insert("tls", tls);
Expand Down
12 changes: 12 additions & 0 deletions translations/fa_IR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,14 @@ For NekoBox, this rewrites the underlying(localhost) DNS in VPN mode, normal mod
<source>Confirm</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server support is required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reality short id. Accept only one value.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DialogFirstSetup</name>
Expand Down Expand Up @@ -889,6 +897,10 @@ This needs to be run NekoBox with administrator privileges.</source>
<source>Plugin</source>
<translation>پلاگین</translation>
</message>
<message>
<source>Server support is required</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditSocksHttp</name>
Expand Down
12 changes: 12 additions & 0 deletions translations/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,14 @@ For NekoBox, this rewrites the underlying(localhost) DNS in VPN mode, normal mod
<source>Confirm</source>
<translation>确认</translation>
</message>
<message>
<source>Server support is required</source>
<translation>需要服务器支持</translation>
</message>
<message>
<source>Reality short id. Accept only one value.</source>
<translation>Reality short id. 只接受一个值。</translation>
</message>
</context>
<context>
<name>DialogFirstSetup</name>
Expand Down Expand Up @@ -891,6 +899,10 @@ This needs to be run NekoBox with administrator privileges.</source>
<source>Plugin</source>
<translation>插件</translation>
</message>
<message>
<source>Server support is required</source>
<translation>需要服务器支持</translation>
</message>
</context>
<context>
<name>EditSocksHttp</name>
Expand Down
4 changes: 2 additions & 2 deletions ui/dialog_basic_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent)
ui->groupBox_http->hide();
ui->inbound_socks_port_l->setText(ui->inbound_socks_port_l->text().replace("Socks", "Mixed (SOCKS+HTTP)"));
ui->log_level->addItems(QString("trace debug info warn error fatal panic").split(" "));
ui->mux_protocol->addItems({"", "h2mux", "smux", "yamux"});
ui->mux_protocol->addItems({"h2mux", "smux", "yamux"});
} else {
ui->log_level->addItems({"debug", "info", "warning", "none"});
ui->mux_protocol->addItems({"", "mux.cool"});
ui->mux_protocol->hide();
}

refresh_auth();
Expand Down
16 changes: 8 additions & 8 deletions ui/dialog_vpn_settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hide_console">
<property name="text">
<string>Hide Console</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="single_core">
<property name="toolTip">
Expand All @@ -132,6 +125,13 @@ This needs to be run NekoBox with administrator privileges.</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hide_console">
<property name="text">
<string>Hide Console</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -212,8 +212,8 @@ This needs to be run NekoBox with administrator privileges.</string>
<tabstop>vpn_ipv6</tabstop>
<tabstop>strict_route</tabstop>
<tabstop>fake_dns</tabstop>
<tabstop>hide_console</tabstop>
<tabstop>single_core</tabstop>
<tabstop>hide_console</tabstop>
<tabstop>vpn_rule_cidr</tabstop>
<tabstop>vpn_rule_process</tabstop>
<tabstop>whitelist_mode</tabstop>
Expand Down
52 changes: 29 additions & 23 deletions ui/edit/dialog_edit_profile.ui
Original file line number Diff line number Diff line change
Expand Up @@ -160,29 +160,29 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QPushButton" name="apply_to_group">
<property name="text">
<string>Apply settings to this group</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
<widget class="QPushButton" name="apply_to_group">
<property name="text">
<string>Apply settings to this group</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
Expand Down Expand Up @@ -327,6 +327,9 @@
</item>
<item row="3" column="0">
<widget class="QLabel" name="multiplex_l">
<property name="toolTip">
<string>Server support is required</string>
</property>
<property name="text">
<string>Multiplex</string>
</property>
Expand Down Expand Up @@ -572,6 +575,9 @@ security (QUIC)</string>
</item>
<item row="2" column="0">
<widget class="QLabel" name="reality_sid_l">
<property name="toolTip">
<string>Reality short id. Accept only one value.</string>
</property>
<property name="text">
<string notr="true">Reality Sid</string>
</property>
Expand Down
8 changes: 3 additions & 5 deletions ui/edit/edit_shadowsocks.ui
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,13 @@
<string notr="true">v2ray-plugin</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">ssr</string>
</property>
</item>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="uot">
<property name="toolTip">
<string>Server support is required</string>
</property>
<property name="text">
<string notr="true">UDP over TCP</string>
</property>
Expand Down
1 change: 1 addition & 0 deletions ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
if (NekoGui::dataStore->log_level == "warning") NekoGui::dataStore->log_level = "info";
if (!Preset::SingBox::DomainStrategy.contains(NekoGui::dataStore->routing->domain_strategy)) NekoGui::dataStore->routing->domain_strategy = "";
if (!Preset::SingBox::DomainStrategy.contains(NekoGui::dataStore->routing->outbound_domain_strategy)) NekoGui::dataStore->routing->outbound_domain_strategy = "";
if (NekoGui::dataStore->mux_protocol.isEmpty()) NekoGui::dataStore->mux_protocol = "h2mux";
//
if (QDir("dashboard").count() == 0) {
QDir().mkdir("dashboard");
Expand Down

0 comments on commit f18d1c9

Please sign in to comment.