mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
feat: hide dashboard at startup
This commit is contained in:
@@ -234,11 +234,11 @@ namespace NekoRay {
|
||||
{"inboundTag", QJsonArray{"socks-in", "http-in"}},
|
||||
{"outboundTag", "dns-out"},
|
||||
};
|
||||
status->routingRules += QJsonObject{
|
||||
{"type", "field"},
|
||||
{"inboundTag", QJsonArray{"dns-in"}},
|
||||
{"outboundTag", "dns-out"},
|
||||
};
|
||||
// status->routingRules += QJsonObject{
|
||||
// {"type", "field"},
|
||||
// {"inboundTag", QJsonArray{"dns-in"}},
|
||||
// {"outboundTag", "dns-out"},
|
||||
// };
|
||||
}
|
||||
|
||||
// custom inbound
|
||||
|
||||
@@ -68,6 +68,7 @@ namespace NekoRay {
|
||||
_add(new configItem("sub_insecure", &sub_insecure, itemType::boolean));
|
||||
_add(new configItem("enable_js_hook", &enable_js_hook, itemType::integer));
|
||||
_add(new configItem("log_ignore", &log_ignore, itemType::stringList));
|
||||
_add(new configItem("start_minimal", &start_minimal, itemType::boolean));
|
||||
}
|
||||
|
||||
void DataStore::UpdateStartedId(int id) {
|
||||
|
||||
@@ -77,6 +77,7 @@ namespace NekoRay {
|
||||
bool check_include_pre = false;
|
||||
QString system_proxy_format = "";
|
||||
QStringList log_ignore = {};
|
||||
bool start_minimal = false;
|
||||
|
||||
// Subscription
|
||||
QString user_agent = "Nekoray/1.0 (Prefer Clash Format)";
|
||||
|
||||
@@ -146,6 +146,9 @@ int main(int argc, char *argv[]) {
|
||||
NekoRay::dataStore->Save();
|
||||
}
|
||||
|
||||
// Datastore & Flags
|
||||
if (NekoRay::dataStore->start_minimal) NekoRay::dataStore->flag_tray = true;
|
||||
|
||||
// load routing
|
||||
NekoRay::dataStore->routing->fn = ROUTES_PREFIX + NekoRay::dataStore->active_routing;
|
||||
isLoaded = NekoRay::dataStore->routing->Load();
|
||||
|
||||
@@ -207,6 +207,10 @@
|
||||
<source>Enable hook.js</source>
|
||||
<translation>启用 hook.js 功能</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hide dashboard at startup</source>
|
||||
<translation>启动时不显示仪表盘</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DialogEditGroup</name>
|
||||
|
||||
@@ -100,6 +100,7 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent)
|
||||
//
|
||||
D_LOAD_BOOL(check_include_pre)
|
||||
D_LOAD_BOOL(connection_statistics)
|
||||
D_LOAD_BOOL(start_minimal)
|
||||
//
|
||||
if (NekoRay::dataStore->traffic_loop_interval == 500) {
|
||||
ui->rfsh_r->setCurrentIndex(0);
|
||||
@@ -254,6 +255,7 @@ void DialogBasicSettings::accept() {
|
||||
NekoRay::dataStore->language = ui->language->currentIndex();
|
||||
D_SAVE_BOOL(connection_statistics)
|
||||
D_SAVE_BOOL(check_include_pre)
|
||||
D_SAVE_BOOL(start_minimal)
|
||||
|
||||
if (ui->rfsh_r->currentIndex() == 0) {
|
||||
NekoRay::dataStore->traffic_loop_interval = 500;
|
||||
|
||||
@@ -336,11 +336,37 @@
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_20">
|
||||
<item>
|
||||
<widget class="QPushButton" name="set_custom_icon">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Set custom icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="start_minimal">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hide dashboard at startup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user