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