mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +08:00
fix
This commit is contained in:
parent
7e2bc7cc87
commit
792dad2bc1
@ -84,7 +84,7 @@ namespace Configs {
|
||||
int max_log_line = 200;
|
||||
QString splitter_state = "";
|
||||
bool enable_stats = true;
|
||||
QString stats_tab = ""; // either connection or log
|
||||
int stats_tab = 0; // either connection or log
|
||||
int speed_test_mode = TestConfig::FULL;
|
||||
QString simple_dl_url = "http://cachefly.cachefly.net/1mb.test";
|
||||
|
||||
|
||||
@ -308,7 +308,7 @@ namespace Configs {
|
||||
_add(new configItem("windows_set_admin", &windows_set_admin, itemType::boolean));
|
||||
_add(new configItem("disable_win_admin", &disable_run_admin, itemType::boolean));
|
||||
_add(new configItem("enable_stats", &enable_stats, itemType::boolean));
|
||||
_add(new configItem("stats_tab", &stats_tab, itemType::string));
|
||||
_add(new configItem("stats_tab", &stats_tab, itemType::integer));
|
||||
_add(new configItem("proxy_scheme", &proxy_scheme, itemType::string));
|
||||
_add(new configItem("disable_privilege_req", &disable_privilege_req, itemType::boolean));
|
||||
_add(new configItem("enable_tun_routing", &enable_tun_routing, itemType::boolean));
|
||||
|
||||
@ -229,18 +229,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
|
||||
// setup connection UI
|
||||
setupConnectionList();
|
||||
for (int i=0;i<ui->stats_widget->tabBar()->count();i++)
|
||||
{
|
||||
if (ui->stats_widget->tabBar()->tabText(i) == Configs::dataStore->stats_tab)
|
||||
{
|
||||
ui->stats_widget->tabBar()->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ui->stats_widget->tabBar()->setCurrentIndex(Configs::dataStore->stats_tab);
|
||||
connect(ui->stats_widget->tabBar(), &QTabBar::currentChanged, this, [=](int index)
|
||||
{
|
||||
auto tabText = ui->stats_widget->tabBar()->tabText(index);
|
||||
Configs::dataStore->stats_tab = tabText;
|
||||
Configs::dataStore->stats_tab = ui->stats_widget->tabBar()->currentIndex();
|
||||
});
|
||||
connect(ui->connections->horizontalHeader(), &QHeaderView::sectionClicked, this, [=](int index)
|
||||
{
|
||||
@ -1054,7 +1046,9 @@ void MainWindow::UpdateDataView(bool force)
|
||||
QString html;
|
||||
if (showDownloadData)
|
||||
{
|
||||
qint64 count = 10*currentDownloadReport.downloadedSize / currentDownloadReport.totalSize;
|
||||
qint64 count = 0;
|
||||
if(currentDownloadReport.totalSize > 0)
|
||||
count = 10 * currentDownloadReport.downloadedSize / currentDownloadReport.totalSize;
|
||||
QString progressText;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user