mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 12:34:37 +03:00
update traffic_loop_interval
This commit is contained in:
@@ -80,7 +80,7 @@ namespace NekoRay::traffic {
|
||||
elapsedTimer.start();
|
||||
while (true) {
|
||||
auto sleep_ms = dataStore->traffic_loop_interval;
|
||||
if (sleep_ms < 500 || sleep_ms > 2000) sleep_ms = 1000;
|
||||
if (sleep_ms < 500 || sleep_ms > 5000) sleep_ms = 1000;
|
||||
QThread::msleep(sleep_ms);
|
||||
if (dataStore->traffic_loop_interval == 0) continue; // user disabled
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace NekoRay {
|
||||
QString log_level = "warning";
|
||||
QString test_url = "http://cp.cloudflare.com/";
|
||||
int test_concurrent = 5;
|
||||
int traffic_loop_interval = 500;
|
||||
int traffic_loop_interval = 1000;
|
||||
bool connection_statistics = false;
|
||||
int current_group = 0; // group id
|
||||
QString mux_protocol = "";
|
||||
|
||||
@@ -100,14 +100,6 @@
|
||||
<source>Statistics refresh rate</source>
|
||||
<translation>نرخ تازه سازی آمار ترافیک</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Fast</source>
|
||||
<translation>سریع</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Slow</source>
|
||||
<translation>کند</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Off</source>
|
||||
<translation>خاموش</translation>
|
||||
|
||||
@@ -99,14 +99,6 @@
|
||||
<source>Statistics refresh rate</source>
|
||||
<translation>流量统计刷新率</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Fast</source>
|
||||
<translation>快</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Slow</source>
|
||||
<translation>慢</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Off</source>
|
||||
<translation>关闭</translation>
|
||||
|
||||
@@ -110,8 +110,14 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent)
|
||||
ui->rfsh_r->setCurrentIndex(0);
|
||||
} else if (NekoRay::dataStore->traffic_loop_interval == 1000) {
|
||||
ui->rfsh_r->setCurrentIndex(1);
|
||||
} else {
|
||||
} else if (NekoRay::dataStore->traffic_loop_interval == 2000) {
|
||||
ui->rfsh_r->setCurrentIndex(2);
|
||||
} else if (NekoRay::dataStore->traffic_loop_interval == 3000) {
|
||||
ui->rfsh_r->setCurrentIndex(3);
|
||||
} else if (NekoRay::dataStore->traffic_loop_interval == 5000) {
|
||||
ui->rfsh_r->setCurrentIndex(4);
|
||||
} else {
|
||||
ui->rfsh_r->setCurrentIndex(5);
|
||||
}
|
||||
//
|
||||
ui->language->setCurrentIndex(NekoRay::dataStore->language);
|
||||
@@ -274,6 +280,12 @@ void DialogBasicSettings::accept() {
|
||||
NekoRay::dataStore->traffic_loop_interval = 500;
|
||||
} else if (ui->rfsh_r->currentIndex() == 1) {
|
||||
NekoRay::dataStore->traffic_loop_interval = 1000;
|
||||
} else if (ui->rfsh_r->currentIndex() == 2) {
|
||||
NekoRay::dataStore->traffic_loop_interval = 2000;
|
||||
} else if (ui->rfsh_r->currentIndex() == 3) {
|
||||
NekoRay::dataStore->traffic_loop_interval = 3000;
|
||||
} else if (ui->rfsh_r->currentIndex() == 4) {
|
||||
NekoRay::dataStore->traffic_loop_interval = 5000;
|
||||
} else {
|
||||
NekoRay::dataStore->traffic_loop_interval = 0;
|
||||
}
|
||||
|
||||
@@ -367,12 +367,27 @@
|
||||
<widget class="QComboBox" name="rfsh_r">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Fast</string>
|
||||
<string notr="true">500ms</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Slow</string>
|
||||
<string notr="true">1s</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">2s</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">3s</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">5s</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
Reference in New Issue
Block a user