diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-11-23 15:34:17 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-11-23 22:01:11 -0800 |
commit | 8e5c222e98bc9cc5ce9dfd29733b6d5bba2c108a (patch) | |
tree | e106f5c00a5c9e589f14090c90a1fac1d6e5345d | |
parent | 03a0678b00856e10e18559a41be2f67f839fe44d (diff) | |
download | subsurface-8e5c222e98bc9cc5ce9dfd29733b6d5bba2c108a.tar.gz |
Create a text entry for default cylinder in preferences
We don't do anything with this just yet.
And frankly, a drop down of the cylinders that we know of would be even
better. But hey, it's a start.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | pref.h | 1 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 1 | ||||
-rw-r--r-- | qt-ui/preferences.cpp | 2 | ||||
-rw-r--r-- | qt-ui/preferences.ui | 33 |
4 files changed, 32 insertions, 5 deletions
@@ -18,6 +18,7 @@ typedef struct { struct preferences { const char *divelist_font; const char *default_filename; + const char *default_cylinder; double font_size; partial_pressure_graphs_t pp_graphs; short mod; diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 1b18b00db..68d23dffe 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -652,6 +652,7 @@ void MainWindow::readSettings() s.beginGroup("GeneralSettings"); GET_TXT("default_filename", default_filename); + GET_TXT("default_cylinder", default_cylinder); s.endGroup(); s.beginGroup("Display"); diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index 0249c894f..0740d3f51 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -78,6 +78,7 @@ void PreferencesDialog::setUiFromPrefs() ui.font->setFont(QString(prefs.divelist_font)); ui.fontsize->setValue(prefs.font_size); ui.defaultfilename->setText(prefs.default_filename); + ui.defaultcylinder->setText(prefs.default_cylinder); ui.displayinvalid->setChecked(prefs.display_invalid_dives); ui.show_sac->setChecked(prefs.show_sac); ui.vertical_speed_minutes->setChecked(prefs.units.vertical_speed_time == units::MINUTES); @@ -139,6 +140,7 @@ void PreferencesDialog::syncSettings() // Defaults s.beginGroup("GeneralSettings"); s.value("default_filename", ui.defaultfilename->text()); + s.value("default_cylinder", ui.defaultcylinder->text()); s.endGroup(); s.beginGroup("Display"); diff --git a/qt-ui/preferences.ui b/qt-ui/preferences.ui index 581670c91..d30752829 100644 --- a/qt-ui/preferences.ui +++ b/qt-ui/preferences.ui @@ -163,7 +163,7 @@ </widget> </item> <item row="0" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_3"> + <layout class="QHBoxLayout" name="horizontalLayout_3b"> <item> <widget class="QLineEdit" name="defaultfilename"/> </item> @@ -194,6 +194,29 @@ </widget> </item> <item> + <widget class="QGroupBox" name="groupBox_6"> + <property name="title"> + <string>Default Cylinder</string> + </property> + <layout class="QFormLayout" name="formLayout_6"> + <item row="0" column="0"> + <widget class="QLabel" name="label_11"> + <property name="text"> + <string>Use Default Cylinder</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QLineEdit" name="defaultcylinder"/> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> <spacer name="verticalSpacer_2"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -252,7 +275,7 @@ </layout> </item> <item> - <widget class="QGroupBox" name="groupBox"> + <widget class="QGroupBox" name="groupBox11"> <property name="title"> <string/> </property> @@ -404,13 +427,13 @@ <item> <layout class="QHBoxLayout"> <item> - <widget class="QGroupBox"> + <widget class="QGroupBox" name="groupBox"> <property name="title"> <string>Time units</string> </property> <layout class="QGridLayout"> <item row="0" column="0"> - <widget class="QLabel"> + <widget class="QLabel" name="label13"> <property name="text"> <string>Ascent/Descent speed denominator</string> </property> @@ -717,7 +740,7 @@ <bool>false</bool> </property> <property name="text"> - <string>Calculate NDL/TTS</string> + <string>Calculate NDL/TTS</string> </property> </widget> </item> |