diff --git a/db/TrafficLooper.cpp b/db/TrafficLooper.cpp index 09e69fb..b10e5ee 100644 --- a/db/TrafficLooper.cpp +++ b/db/TrafficLooper.cpp @@ -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 diff --git a/main/NekoRay_DataStore.hpp b/main/NekoRay_DataStore.hpp index 002c27c..e52db53 100644 --- a/main/NekoRay_DataStore.hpp +++ b/main/NekoRay_DataStore.hpp @@ -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 = ""; diff --git a/translations/fa_IR.ts b/translations/fa_IR.ts index 47b9ee0..bf59b53 100644 --- a/translations/fa_IR.ts +++ b/translations/fa_IR.ts @@ -100,14 +100,6 @@ Statistics refresh rate نرخ تازه سازی آمار ترافیک - - Fast - سریع - - - Slow - کند - Off خاموش diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts index 31dd760..21ad5c6 100644 --- a/translations/zh_CN.ts +++ b/translations/zh_CN.ts @@ -99,14 +99,6 @@ Statistics refresh rate 流量统计刷新率 - - Fast - - - - Slow - - Off 关闭 diff --git a/ui/dialog_basic_settings.cpp b/ui/dialog_basic_settings.cpp index 3c63ab6..43b4ff1 100644 --- a/ui/dialog_basic_settings.cpp +++ b/ui/dialog_basic_settings.cpp @@ -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; } diff --git a/ui/dialog_basic_settings.ui b/ui/dialog_basic_settings.ui index f27cda4..e347cb1 100644 --- a/ui/dialog_basic_settings.ui +++ b/ui/dialog_basic_settings.ui @@ -367,12 +367,27 @@ - Fast + 500ms - Slow + 1s + + + + + 2s + + + + + 3s + + + + + 5s