From c84ef319a2d83affbd4a0f2f7c391cdfb25d09ee Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 6 Feb 2014 11:38:28 -0200 Subject: Create a toolbox on the left side of the new profile For quick acess of preferences the show / hide stuff from the Settings dialog is now in that toolbox and in the future we can put a few more, like 'Show Notifications Panel' and 'Enable Legend' Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 60 +++++++ qt-ui/mainwindow.h | 15 ++ qt-ui/mainwindow.ui | 452 +++++++++++++++++++++++++++++++++++++++++++++++++- qt-ui/preferences.cpp | 7 +- qt-ui/preferences.h | 1 + 5 files changed, 524 insertions(+), 11 deletions(-) diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 4330636ed..e9041653a 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -912,3 +912,63 @@ void MainWindow::editCurrentDive() ui.InfoWidget->enableEdition(MainTab::MANUALLY_ADDED_DIVE); } } + +#define TOOLBOX_PREF_PROFILE(PREFS)\ + QSettings s; \ + s.beginGroup("TecDetails"); \ + s.setValue(#PREFS, triggered); \ + PreferencesDialog::instance()->emitSettingsChanged(); + +void MainWindow::on_profCalcAllTissues_clicked(bool triggered) +{ + TOOLBOX_PREF_PROFILE(calcalltissues); +} +void MainWindow::on_profCalcCeiling_clicked(bool triggered) +{ + TOOLBOX_PREF_PROFILE(calcceiling); +} +void MainWindow::on_profDcCeiling_clicked(bool triggered) +{ + TOOLBOX_PREF_PROFILE(dcceiling); +} +void MainWindow::on_profEad_clicked(bool triggered) +{ + TOOLBOX_PREF_PROFILE(ead); +} +void MainWindow::on_profIncrement3m_clicked(bool triggered) +{ + TOOLBOX_PREF_PROFILE(calcceiling3m); +} +void MainWindow::on_profMod_clicked(bool triggered) +{ + TOOLBOX_PREF_PROFILE(mod); +} +void MainWindow::on_profNtl_tts_clicked(bool triggered) +{ + TOOLBOX_PREF_PROFILE(calcndltts); +} +void MainWindow::on_profPhe_clicked(bool triggered) +{ + TOOLBOX_PREF_PROFILE(phegraph); +} +void MainWindow::on_profPn2_clicked(bool triggered) +{ + TOOLBOX_PREF_PROFILE(pn2graph); +} +void MainWindow::on_profPO2_clicked(bool triggered) +{ + TOOLBOX_PREF_PROFILE(po2graph); +} +void MainWindow::on_profRuler_clicked(bool triggered) +{ + TOOLBOX_PREF_PROFILE(rulergraph); +} +void MainWindow::on_profSAC_clicked(bool triggered) +{ + TOOLBOX_PREF_PROFILE(show_sac); +} +void MainWindow::on_profUnusedTanks_clicked(bool triggered) +{ + TOOLBOX_PREF_PROFILE(display_unused_tanks); +} +#undef TOOLBOX_PREF_PROFILE \ No newline at end of file diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 67b0cc0d9..c9d20056f 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -105,6 +105,21 @@ private slots: void on_actionImportDiveLog_triggered(); + /* TODO: Move those slots below to it's own class */ + void on_profCalcAllTissues_clicked(bool triggered); + void on_profCalcCeiling_clicked(bool triggered); + void on_profDcCeiling_clicked(bool triggered); + void on_profEad_clicked(bool triggered); + void on_profIncrement3m_clicked(bool triggered); + void on_profMod_clicked(bool triggered); + void on_profNtl_tts_clicked(bool triggered); + void on_profPO2_clicked(bool triggered); + void on_profPhe_clicked(bool triggered); + void on_profPn2_clicked(bool triggered); + void on_profRuler_clicked(bool triggered); + void on_profSAC_clicked(bool triggered); + void on_profUnusedTanks_clicked(bool triggered); + protected: void closeEvent(QCloseEvent *); diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index 853ff8bf9..5b1280c65 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 763 - 548 + 667 @@ -15,7 +15,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -36,7 +45,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -49,7 +67,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -67,13 +94,22 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 - 0 + 1 @@ -90,6 +126,393 @@ New Profile + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 2 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Enable the pO2 Graph + + + ... + + + + :/icon_depth:/icon_depth + + + + 24 + 24 + + + + true + + + true + + + + + + + Enable the pn2 Graph + + + ... + + + + :/average:/average + + + + 24 + 24 + + + + true + + + true + + + + + + + Enable the phe graph + + + ... + + + + :/plus:/plus + + + + 24 + 24 + + + + true + + + true + + + + + + + Enable MOD + + + ... + + + + :/maximum:/maximum + + + + 24 + 24 + + + + true + + + true + + + + + + + Enable EAD, EED, END + + + ... + + + + :/minimum:/minimum + + + + 24 + 24 + + + + true + + + true + + + + + + + Show the DC Reported Ceiling + + + ... + + + + :/ruler:/ruler + + + + 24 + 24 + + + + true + + + true + + + + + + + Show the Calculated Ceiling + + + ... + + + + :/subsurface-icon:/subsurface-icon + + + + 24 + 24 + + + + true + + + true + + + + + + + Show Calculated Ceiling with 3m Increments + + + ... + + + + :/star:/star + + + + 24 + 24 + + + + true + + + true + + + + + + + Show NTL / TTS + + + ... + + + + :/trash:/trash + + + + 24 + 24 + + + + true + + + true + + + + + + + Calculate All Tissues + + + ... + + + + :/subsurface-icon:/subsurface-icon + + + + 24 + 24 + + + + true + + + true + + + + + + + Show SAC Rate + + + ... + + + + :/warning:/warning + + + + 24 + 24 + + + + true + + + true + + + + + + + Show Unused Tanks + + + ... + + + + :/advanced:/advanced + + + + 24 + 24 + + + + true + + + true + + + + + + + Enable / Disable the Ruler + + + ... + + + + :/flag:/flag + + + + 24 + 24 + + + + true + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + @@ -104,7 +527,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -159,7 +591,7 @@ 0 0 763 - 26 + 25 @@ -551,6 +983,8 @@
qt-ui/profile/profilewidget2.h
- + + + diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index 34a165cea..ab9c9fa39 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -223,8 +223,6 @@ void PreferencesDialog::buttonClicked(QAbstractButton* button) break; // ignore warnings. } } - - #undef SB void PreferencesDialog::on_chooseFile_clicked() @@ -232,3 +230,8 @@ void PreferencesDialog::on_chooseFile_clicked() QFileInfo fi(system_default_filename()); ui.defaultfilename->setText(QFileDialog::getOpenFileName(this, tr("Open Default Log File"), fi.absolutePath(), tr("Subsurface XML files (*.ssrf *.xml *.XML)"))); } + +void PreferencesDialog::emitSettingsChanged() +{ + emit settingsChanged(); +} diff --git a/qt-ui/preferences.h b/qt-ui/preferences.h index d75cf4bfd..a30914181 100644 --- a/qt-ui/preferences.h +++ b/qt-ui/preferences.h @@ -14,6 +14,7 @@ Q_OBJECT public: static PreferencesDialog* instance(); void showEvent(QShowEvent* ); + void emitSettingsChanged(); signals: void settingsChanged(); public slots: -- cgit v1.2.3-70-g09d2