mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Remove check option to show units in text label
Currently the feature to show temperature units while adding dive is provided through checkbox in preferences->units section. This patch disables this checkbox and always enables this feature. Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d6af09b269
commit
ecc8c1d995
6 changed files with 5 additions and 24 deletions
1
pref.h
1
pref.h
|
@ -41,7 +41,6 @@ struct preferences {
|
||||||
bool display_unused_tanks;
|
bool display_unused_tanks;
|
||||||
bool show_average_depth;
|
bool show_average_depth;
|
||||||
bool zoomed_plot;
|
bool zoomed_plot;
|
||||||
bool text_label_with_units;
|
|
||||||
};
|
};
|
||||||
enum unit_system_values {
|
enum unit_system_values {
|
||||||
METRIC,
|
METRIC,
|
||||||
|
|
|
@ -202,7 +202,7 @@ void MainTab::hideMessage()
|
||||||
ui.diveEquipmentMessage->animatedHide();
|
ui.diveEquipmentMessage->animatedHide();
|
||||||
ui.diveInfoMessage->animatedHide();
|
ui.diveInfoMessage->animatedHide();
|
||||||
ui.diveStatisticsMessage->animatedHide();
|
ui.diveStatisticsMessage->animatedHide();
|
||||||
updateTextLabels();
|
updateTextLabels(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainTab::closeMessage()
|
void MainTab::closeMessage()
|
||||||
|
@ -224,12 +224,12 @@ void MainTab::displayMessage(QString str)
|
||||||
ui.diveInfoMessage->animatedShow();
|
ui.diveInfoMessage->animatedShow();
|
||||||
ui.diveStatisticsMessage->setText(str);
|
ui.diveStatisticsMessage->setText(str);
|
||||||
ui.diveStatisticsMessage->animatedShow();
|
ui.diveStatisticsMessage->animatedShow();
|
||||||
updateTextLabels(true);
|
updateTextLabels();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainTab::updateTextLabels(bool showUnits)
|
void MainTab::updateTextLabels(bool showUnits)
|
||||||
{
|
{
|
||||||
if (showUnits && prefs.text_label_with_units) {
|
if (showUnits) {
|
||||||
ui.airTempLabel->setText(tr("Air temp [%1]").arg(get_temp_unit()));
|
ui.airTempLabel->setText(tr("Air temp [%1]").arg(get_temp_unit()));
|
||||||
ui.waterTempLabel->setText(tr("Water temp [%1]").arg(get_temp_unit()));
|
ui.waterTempLabel->setText(tr("Water temp [%1]").arg(get_temp_unit()));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -94,7 +94,7 @@ slots:
|
||||||
void displayMessage(QString str);
|
void displayMessage(QString str);
|
||||||
void enableEdition(EditMode newEditMode = NONE);
|
void enableEdition(EditMode newEditMode = NONE);
|
||||||
void toggleTriggeredColumn();
|
void toggleTriggeredColumn();
|
||||||
void updateTextLabels(bool showUnits = false);
|
void updateTextLabels(bool showUnits = true);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainTab ui;
|
Ui::MainTab ui;
|
||||||
|
|
|
@ -75,7 +75,6 @@ void PreferencesDialog::setUiFromPrefs()
|
||||||
ui.cuft->setChecked(prefs.units.volume == units::CUFT);
|
ui.cuft->setChecked(prefs.units.volume == units::CUFT);
|
||||||
ui.kg->setChecked(prefs.units.weight == units::KG);
|
ui.kg->setChecked(prefs.units.weight == units::KG);
|
||||||
ui.lbs->setChecked(prefs.units.weight == units::LBS);
|
ui.lbs->setChecked(prefs.units.weight == units::LBS);
|
||||||
ui.text_label_with_units->setChecked(prefs.text_label_with_units);
|
|
||||||
|
|
||||||
ui.font->setCurrentFont(QString(prefs.divelist_font));
|
ui.font->setCurrentFont(QString(prefs.divelist_font));
|
||||||
ui.fontsize->setValue(prefs.font_size);
|
ui.fontsize->setValue(prefs.font_size);
|
||||||
|
@ -198,7 +197,6 @@ void PreferencesDialog::syncSettings()
|
||||||
s.setValue("volume", ui.cuft->isChecked() ? units::CUFT : units::LITER);
|
s.setValue("volume", ui.cuft->isChecked() ? units::CUFT : units::LITER);
|
||||||
s.setValue("weight", ui.lbs->isChecked() ? units::LBS : units::KG);
|
s.setValue("weight", ui.lbs->isChecked() ? units::LBS : units::KG);
|
||||||
s.setValue("vertical_speed_time", ui.vertical_speed_minutes->isChecked() ? units::MINUTES : units::SECONDS);
|
s.setValue("vertical_speed_time", ui.vertical_speed_minutes->isChecked() ? units::MINUTES : units::SECONDS);
|
||||||
SB("text_label_with_units", ui.text_label_with_units);
|
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
// Defaults
|
// Defaults
|
||||||
s.beginGroup("GeneralSettings");
|
s.beginGroup("GeneralSettings");
|
||||||
|
@ -255,7 +253,6 @@ void PreferencesDialog::loadSettings()
|
||||||
GET_UNIT("weight", weight, units::LBS, units::KG);
|
GET_UNIT("weight", weight, units::LBS, units::KG);
|
||||||
}
|
}
|
||||||
GET_UNIT("vertical_speed_time", vertical_speed_time, units::MINUTES, units::SECONDS);
|
GET_UNIT("vertical_speed_time", vertical_speed_time, units::MINUTES, units::SECONDS);
|
||||||
GET_BOOL("text_label_with_units", text_label_with_units);
|
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
s.beginGroup("TecDetails");
|
s.beginGroup("TecDetails");
|
||||||
GET_BOOL("po2graph", pp_graphs.po2);
|
GET_BOOL("po2graph", pp_graphs.po2);
|
||||||
|
|
|
@ -512,20 +512,6 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="text_label_with_units_hbox">
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="text_label_with_units">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Show units in text labels</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|
|
@ -30,8 +30,7 @@ struct preferences default_prefs = {
|
||||||
.display_invalid_dives = false,
|
.display_invalid_dives = false,
|
||||||
.show_sac = false,
|
.show_sac = false,
|
||||||
.display_unused_tanks = false,
|
.display_unused_tanks = false,
|
||||||
.show_average_depth = true,
|
.show_average_depth = true
|
||||||
.text_label_with_units = false
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct units *get_units()
|
struct units *get_units()
|
||||||
|
|
Loading…
Add table
Reference in a new issue