From 39542ba7db4d2cab54b8e4b7a9a7c27dd5f379ae Mon Sep 17 00:00:00 2001 From: Seeker4 Date: Sat, 13 Jul 2019 14:53:57 -0700 Subject: [PATCH] Move Pie Chart option from Preferences dialog to View menu. --- oscar/mainwindow.cpp | 13 ++++++++-- oscar/mainwindow.h | 4 ++- oscar/mainwindow.ui | 52 +++++++++++++++++++++++++++++++------ oscar/preferencesdialog.cpp | 4 +-- oscar/preferencesdialog.ui | 16 +----------- 5 files changed, 61 insertions(+), 28 deletions(-) diff --git a/oscar/mainwindow.cpp b/oscar/mainwindow.cpp index 4fe1bb7a..5f3bb66e 100644 --- a/oscar/mainwindow.cpp +++ b/oscar/mainwindow.cpp @@ -122,7 +122,8 @@ void MainWindow::SetupGUI() ui->action_Preferences->setShortcuts(QKeySequence::Preferences); #endif - ui->actionToggle_Line_Cursor->setChecked(AppSetting->lineCursorMode()); + ui->actionLine_Cursor->setChecked(AppSetting->lineCursorMode()); + ui->actionPie_Chart->setChecked(AppSetting->graphSnapshots()); ui->actionDebug->setChecked(AppSetting->showDebug()); ui->actionShow_Performance_Counters->setChecked(AppSetting->showPerformance()); @@ -2451,7 +2452,7 @@ void MainWindow::on_importButton_clicked() } -void MainWindow::on_actionToggle_Line_Cursor_toggled(bool b) +void MainWindow::on_actionLine_Cursor_toggled(bool b) { AppSetting->setLineCursorMode(b); if (ui->tabWidget->currentWidget() == daily) { @@ -2461,6 +2462,14 @@ void MainWindow::on_actionToggle_Line_Cursor_toggled(bool b) } } +void MainWindow::on_actionPie_Chart_toggled(bool visible) +{ + AppSetting->setGraphSnapshots(visible); + if (daily && ui->tabWidget->currentWidget() == daily) { + daily->ReloadGraphs(); + } +} + void MainWindow::on_actionLeft_Daily_Sidebar_toggled(bool visible) { if (daily) daily->setSidebarVisible(visible); diff --git a/oscar/mainwindow.h b/oscar/mainwindow.h index 25fe95bf..a5253ec4 100644 --- a/oscar/mainwindow.h +++ b/oscar/mainwindow.h @@ -305,12 +305,14 @@ class MainWindow : public QMainWindow void on_importButton_clicked(); - void on_actionToggle_Line_Cursor_toggled(bool arg1); + void on_actionLine_Cursor_toggled(bool arg1); void on_actionLeft_Daily_Sidebar_toggled(bool arg1); void on_actionDaily_Calendar_toggled(bool arg1); + void on_actionPie_Chart_toggled(bool arg1); + void on_actionExport_Journal_triggered(); void on_actionShow_Performance_Counters_toggled(bool arg1); diff --git a/oscar/mainwindow.ui b/oscar/mainwindow.ui index c5048eb3..5676d96d 100644 --- a/oscar/mainwindow.ui +++ b/oscar/mainwindow.ui @@ -2838,7 +2838,8 @@ p, li { white-space: pre-wrap; } - + + @@ -2932,6 +2933,9 @@ p, li { white-space: pre-wrap; } View &Daily + + Show Daily view + F5 @@ -2940,6 +2944,9 @@ p, li { white-space: pre-wrap; } View &Overview + + Show Overview view + F6 @@ -2980,6 +2987,9 @@ p, li { white-space: pre-wrap; } &Maximize Toggle + + Maximize window + F11 @@ -2999,6 +3009,9 @@ p, li { white-space: pre-wrap; } &Reset Graph Layout + + Reset sizes of graphs + @@ -3055,12 +3068,12 @@ p, li { white-space: pre-wrap; } true - - true - Right &Sidebar + + Show Right Sidebar + F10 @@ -3073,7 +3086,7 @@ p, li { white-space: pre-wrap; } View Statistics - View Statistics + Show Statistics view F4 @@ -3114,7 +3127,7 @@ p, li { white-space: pre-wrap; } Current Days - + true @@ -3135,11 +3148,14 @@ p, li { white-space: pre-wrap; } true - true + false Daily Sidebar + + Show Daily Left Sidebar + F8 @@ -3149,11 +3165,14 @@ p, li { white-space: pre-wrap; } true - true + false Daily Calendar + + Show Daily Calendar + F9 @@ -3191,6 +3210,23 @@ p, li { white-space: pre-wrap; } System Information + + + true + + + false + + + Toggle &Pie Chart + + + Show Pie Chart on Daily page + + + Ctrl+P + + diff --git a/oscar/preferencesdialog.cpp b/oscar/preferencesdialog.cpp index 9ce13106..9aa0b1bf 100644 --- a/oscar/preferencesdialog.cpp +++ b/oscar/preferencesdialog.cpp @@ -210,7 +210,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) : ui->useAntiAliasing->setChecked(AppSetting->antiAliasing()); ui->usePixmapCaching->setChecked(AppSetting->usePixmapCaching()); ui->useSquareWavePlots->setChecked(AppSetting->squareWavePlots()); - ui->enableGraphSnapshots->setChecked(AppSetting->graphSnapshots()); +// ui->enableGraphSnapshots->setChecked(AppSetting->graphSnapshots()); ui->graphTooltips->setChecked(AppSetting->graphTooltips()); ui->allowYAxisScaling->setChecked(AppSetting->allowYAxisScaling()); @@ -808,7 +808,7 @@ bool PreferencesDialog::Save() AppSetting->setAntiAliasing(ui->useAntiAliasing->isChecked()); AppSetting->setUsePixmapCaching(ui->usePixmapCaching->isChecked()); AppSetting->setSquareWavePlots(ui->useSquareWavePlots->isChecked()); - AppSetting->setGraphSnapshots(ui->enableGraphSnapshots->isChecked()); +// AppSetting->setGraphSnapshots(ui->enableGraphSnapshots->isChecked()); AppSetting->setLineThickness(float(ui->lineThicknessSlider->value()) / 2.0); profile->general->setSkipEmptyDays(ui->skipEmptyDays->isChecked()); diff --git a/oscar/preferencesdialog.ui b/oscar/preferencesdialog.ui index 64e72200..892b5a0c 100644 --- a/oscar/preferencesdialog.ui +++ b/oscar/preferencesdialog.ui @@ -57,7 +57,7 @@ - 1 + 0 @@ -2651,20 +2651,6 @@ Try it and see if you like it. - - - - Allows graphs to be "screenshotted" for display purposes. -The Event Breakdown PIE chart uses this method, as does -the printing code. -Unfortunately some older computers/versions of Qt can cause -this application to be unstable with this feature enabled. - - - Show event breakdown pie chart - - -