Improve performance of enabling or disabling pie chart option

This commit is contained in:
Seeker4 2019-07-25 06:26:19 -07:00
parent 751df7652a
commit f635302058

View File

@ -111,8 +111,11 @@ MainWindow::MainWindow(QWidget *parent) :
} }
bool setupRunning = false;
void MainWindow::SetupGUI() void MainWindow::SetupGUI()
{ {
setupRunning = true;
QString version = getBranchVersion(); QString version = getBranchVersion();
setWindowTitle(STR_TR_OSCAR + QString(" %1").arg(version)); setWindowTitle(STR_TR_OSCAR + QString(" %1").arg(version));
@ -241,6 +244,7 @@ void MainWindow::SetupGUI()
help = new Help(this); help = new Help(this);
ui->tabWidget->addTab(help, tr("Help Browser")); ui->tabWidget->addTab(help, tr("Help Browser"));
#endif #endif
setupRunning = false;
} }
void MainWindow::logMessage(QString msg) 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) void MainWindow::on_actionPie_Chart_toggled(bool visible)
{ {
AppSetting->setShowPieChart(visible); AppSetting->setShowPieChart(visible);
if (daily && ui->tabWidget->currentWidget() == daily) { if (!setupRunning && daily) {
daily->ReloadGraphs(); daily->updateLeftSidebar();
// daily->ReloadGraphs();
} }
} }