From 8e5c222e98bc9cc5ce9dfd29733b6d5bba2c108a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 23 Nov 2013 15:34:17 -0800 Subject: 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 --- pref.h | 1 + qt-ui/mainwindow.cpp | 1 + qt-ui/preferences.cpp | 2 ++ qt-ui/preferences.ui | 33 ++++++++++++++++++++++++++++----- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/pref.h b/pref.h index 28e795cd0..37beb8faa 100644 --- a/pref.h +++ b/pref.h @@ -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 @@ - + @@ -193,6 +193,29 @@ + + + + Default Cylinder + + + + + + Use Default Cylinder + + + + + + + + + + + + + @@ -252,7 +275,7 @@ - + @@ -404,13 +427,13 @@ - + Time units - + Ascent/Descent speed denominator @@ -717,7 +740,7 @@ false - Calculate NDL/TTS + Calculate NDL/TTS -- cgit v1.2.3-70-g09d2