is not merged yet, this is a followup patch,

On Wed, Feb 5, 2014 at 4:17 PM, Tomaz Canabrava <tcanabr...@kde.org> wrote:

> last one.
>
>
> On Wed, Feb 5, 2014 at 4:01 PM, Tomaz Canabrava <tcanabr...@kde.org>wrote:
>
>> I'm gonna be irooon like a lioooon in zioooon.
>>
>>
>
From 4edb02baf0a574e16de9c46cd6151c3f3703e101 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <tcanabr...@kde.org>
Date: Thu, 6 Feb 2014 11:38:28 -0200
Subject: [PATCH 7/7] Create a Toolbox on the left side of the new profile

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 on that toolbox, and
in the future we can put a few more, like 'Show Notifications
Panel' and 'Enable Legend'

Signed-off-by: Tomaz Canabrava <tcanabr...@kde.org>
---
 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 4330636..e904165 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 67b0cc0..c9d2005 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 853ff8b..5b1280c 100644
--- a/qt-ui/mainwindow.ui
+++ b/qt-ui/mainwindow.ui
@@ -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>
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index 34a165c..ab9c9fa 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 d75cf4b..a309141 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:
-- 
1.8.5.3

_______________________________________________
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to