mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Create a drop down to choose default cylinder
This also renames the ui element to match. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a25d351b64
commit
d0fbfc7a9c
3 changed files with 9 additions and 4 deletions
|
@ -208,7 +208,7 @@ int add_gas(struct dive *dive, int o2, int he)
|
||||||
if (i == MAX_CYLINDERS) {
|
if (i == MAX_CYLINDERS) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* let's make it our default cylinder (right now hardcoded as AL80) */
|
/* let's make it our default cylinder */
|
||||||
fill_default_cylinder(cyl);
|
fill_default_cylinder(cyl);
|
||||||
mix->o2.permille = o2;
|
mix->o2.permille = o2;
|
||||||
mix->he.permille = he;
|
mix->he.permille = he;
|
||||||
|
|
|
@ -78,7 +78,12 @@ void PreferencesDialog::setUiFromPrefs()
|
||||||
ui.font->setFont(QString(prefs.divelist_font));
|
ui.font->setFont(QString(prefs.divelist_font));
|
||||||
ui.fontsize->setValue(prefs.font_size);
|
ui.fontsize->setValue(prefs.font_size);
|
||||||
ui.defaultfilename->setText(prefs.default_filename);
|
ui.defaultfilename->setText(prefs.default_filename);
|
||||||
ui.defaultcylinder->setText(prefs.default_cylinder);
|
ui.default_cylinder->clear();
|
||||||
|
for(int i=0; tank_info[i].name != NULL; i++) {
|
||||||
|
ui.default_cylinder->addItem(tank_info[i].name);
|
||||||
|
if (prefs.default_cylinder && strcmp(tank_info[i].name, prefs.default_cylinder) == 0)
|
||||||
|
ui.default_cylinder->setCurrentIndex(i);
|
||||||
|
}
|
||||||
ui.displayinvalid->setChecked(prefs.display_invalid_dives);
|
ui.displayinvalid->setChecked(prefs.display_invalid_dives);
|
||||||
ui.show_sac->setChecked(prefs.show_sac);
|
ui.show_sac->setChecked(prefs.show_sac);
|
||||||
ui.vertical_speed_minutes->setChecked(prefs.units.vertical_speed_time == units::MINUTES);
|
ui.vertical_speed_minutes->setChecked(prefs.units.vertical_speed_time == units::MINUTES);
|
||||||
|
@ -140,7 +145,7 @@ void PreferencesDialog::syncSettings()
|
||||||
// Defaults
|
// Defaults
|
||||||
s.beginGroup("GeneralSettings");
|
s.beginGroup("GeneralSettings");
|
||||||
s.setValue("default_filename", ui.defaultfilename->text());
|
s.setValue("default_filename", ui.defaultfilename->text());
|
||||||
s.setValue("default_cylinder", ui.defaultcylinder->text());
|
s.setValue("default_cylinder", ui.default_cylinder->currentText());
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
s.beginGroup("Display");
|
s.beginGroup("Display");
|
||||||
|
|
|
@ -209,7 +209,7 @@
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="defaultcylinder"/>
|
<widget class="QComboBox" name="default_cylinder"/>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Add table
Reference in a new issue