From f63530205840868d242105a70ad8bb028a8fb35c Mon Sep 17 00:00:00 2001 From: Seeker4 Date: Thu, 25 Jul 2019 06:26:19 -0700 Subject: [PATCH] Improve performance of enabling or disabling pie chart option --- oscar/mainwindow.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/oscar/mainwindow.cpp b/oscar/mainwindow.cpp index 7f2da0ca..f803b77c 100644 --- a/oscar/mainwindow.cpp +++ b/oscar/mainwindow.cpp @@ -111,8 +111,11 @@ MainWindow::MainWindow(QWidget *parent) : } +bool setupRunning = false; + void MainWindow::SetupGUI() { + setupRunning = true; QString version = getBranchVersion(); setWindowTitle(STR_TR_OSCAR + QString(" %1").arg(version)); @@ -241,6 +244,7 @@ void MainWindow::SetupGUI() help = new Help(this); ui->tabWidget->addTab(help, tr("Help Browser")); #endif + setupRunning = false; } void MainWindow::logMessage(QString msg) @@ -2469,8 +2473,9 @@ void MainWindow::on_actionLine_Cursor_toggled(bool b) void MainWindow::on_actionPie_Chart_toggled(bool visible) { AppSetting->setShowPieChart(visible); - if (daily && ui->tabWidget->currentWidget() == daily) { - daily->ReloadGraphs(); + if (!setupRunning && daily) { + daily->updateLeftSidebar(); +// daily->ReloadGraphs(); } }