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 <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-02-06 11:38:28 -02:00 committed by Dirk Hohndel
parent 2a9289ac99
commit c84ef319a2
5 changed files with 524 additions and 11 deletions

View file

@ -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

View file

@ -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 *);

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>763</width>
<height>548</height>
<height>667</height>
</rect>
</property>
<widget class="QWidget" name="centralwidget">
@ -15,7 +15,16 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -36,7 +45,16 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -49,7 +67,16 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -67,13 +94,22 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -90,6 +126,393 @@
<string>New Profile</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="profPO2">
<property name="toolTip">
<string>Enable the pO2 Graph</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/icon_depth</normaloff>:/icon_depth</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="profPn2">
<property name="toolTip">
<string>Enable the pn2 Graph</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/average</normaloff>:/average</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="profPhe">
<property name="toolTip">
<string>Enable the phe graph</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/plus</normaloff>:/plus</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="profMod">
<property name="toolTip">
<string>Enable MOD</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/maximum</normaloff>:/maximum</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="profEad">
<property name="toolTip">
<string>Enable EAD, EED, END</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/minimum</normaloff>:/minimum</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="profDcCeiling">
<property name="toolTip">
<string>Show the DC Reported Ceiling</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/ruler</normaloff>:/ruler</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="profCalcCeiling">
<property name="toolTip">
<string>Show the Calculated Ceiling</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/subsurface-icon</normaloff>:/subsurface-icon</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="profIncrement3m">
<property name="toolTip">
<string>Show Calculated Ceiling with 3m Increments</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/star</normaloff>:/star</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="profNtl_tts">
<property name="toolTip">
<string>Show NTL / TTS</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/trash</normaloff>:/trash</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="profCalcAllTissues">
<property name="toolTip">
<string>Calculate All Tissues</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/subsurface-icon</normaloff>:/subsurface-icon</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="profSAC">
<property name="toolTip">
<string>Show SAC Rate</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/warning</normaloff>:/warning</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="profUnusedTanks">
<property name="toolTip">
<string>Show Unused Tanks</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/advanced</normaloff>:/advanced</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="profRuler">
<property name="toolTip">
<string>Enable / Disable the Ruler</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../subsurface.qrc">
<normaloff>:/flag</normaloff>:/flag</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="ProfileWidget2" name="graphicsView"/>
</item>
@ -104,7 +527,16 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -159,7 +591,7 @@
<x>0</x>
<y>0</y>
<width>763</width>
<height>26</height>
<height>25</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@ -551,6 +983,8 @@
<header>qt-ui/profile/profilewidget2.h</header>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="../subsurface.qrc"/>
</resources>
<connections/>
</ui>

View file

@ -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();
}

View file

@ -14,6 +14,7 @@ Q_OBJECT
public:
static PreferencesDialog* instance();
void showEvent(QShowEvent* );
void emitSettingsChanged();
signals:
void settingsChanged();
public slots: