diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-09-25 17:07:04 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-30 10:36:50 -0700 |
commit | 57d7b59bdc62a5b01fa420bc420dbdcf1414a23a (patch) | |
tree | 779d151e52950f882713fd17ab93042639dd7f5d /desktop-widgets | |
parent | c53615315e151a2790218c13898f128d561df1b9 (diff) | |
download | subsurface-57d7b59bdc62a5b01fa420bc420dbdcf1414a23a.tar.gz |
Preferences: move units to the new dialog
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/preferences.cpp | 39 | ||||
-rw-r--r-- | desktop-widgets/preferences.ui | 489 | ||||
-rw-r--r-- | desktop-widgets/preferences/CMakeLists.txt | 1 | ||||
-rw-r--r-- | desktop-widgets/preferences/preferences_units.cpp | 60 | ||||
-rw-r--r-- | desktop-widgets/preferences/preferences_units.h | 21 | ||||
-rw-r--r-- | desktop-widgets/preferences/preferences_units.ui | 251 | ||||
-rw-r--r-- | desktop-widgets/preferences/preferencesdialog.cpp | 2 |
7 files changed, 336 insertions, 527 deletions
diff --git a/desktop-widgets/preferences.cpp b/desktop-widgets/preferences.cpp index 2ce96bd77..672d75906 100644 --- a/desktop-widgets/preferences.cpp +++ b/desktop-widgets/preferences.cpp @@ -146,7 +146,6 @@ void PreferencesDialog::setUiFromPrefs() ui.pn2Threshold->setValue(prefs.pp_graphs.pn2_threshold); ui.maxpo2->setValue(prefs.modpO2); ui.red_ceiling->setChecked(prefs.redceiling); - ui.units_group->setEnabled(ui.personalize->isChecked()); ui.gflow->setValue(prefs.gflow); ui.gfhigh->setValue(prefs.gfhigh); @@ -157,31 +156,8 @@ void PreferencesDialog::setUiFromPrefs() ui.psro2rate->setValue(prefs.o2consumption / 1000.0); ui.pscrfactor->setValue(rint(1000.0 / prefs.pscr_ratio)); - // units - if (prefs.unit_system == METRIC) - ui.metric->setChecked(true); - else if (prefs.unit_system == IMPERIAL) - ui.imperial->setChecked(true); - else - ui.personalize->setChecked(true); - ui.gpsTraditional->setChecked(prefs.coordinates_traditional); - ui.gpsDecimal->setChecked(!prefs.coordinates_traditional); - - ui.celsius->setChecked(prefs.units.temperature == units::CELSIUS); - ui.fahrenheit->setChecked(prefs.units.temperature == units::FAHRENHEIT); - ui.meter->setChecked(prefs.units.length == units::METERS); - ui.feet->setChecked(prefs.units.length == units::FEET); - ui.bar->setChecked(prefs.units.pressure == units::BAR); - ui.psi->setChecked(prefs.units.pressure == units::PSI); - ui.liter->setChecked(prefs.units.volume == units::LITER); - ui.cuft->setChecked(prefs.units.volume == units::CUFT); - ui.kg->setChecked(prefs.units.weight == units::KG); - ui.lbs->setChecked(prefs.units.weight == units::LBS); - ui.display_unused_tanks->setChecked(prefs.display_unused_tanks); ui.show_average_depth->setChecked(prefs.show_average_depth); - ui.vertical_speed_minutes->setChecked(prefs.units.vertical_speed_time == units::MINUTES); - ui.vertical_speed_seconds->setChecked(prefs.units.vertical_speed_time == units::SECONDS); QSettings s; @@ -237,20 +213,6 @@ void PreferencesDialog::syncSettings() SAVE_OR_REMOVE("show_average_depth", default_prefs.show_average_depth, ui.show_average_depth->isChecked()); s.endGroup(); - // Units - s.beginGroup("Units"); - QString unitSystem[] = {"metric", "imperial", "personal"}; - short unitValue = ui.metric->isChecked() ? METRIC : (ui.imperial->isChecked() ? IMPERIAL : PERSONALIZE); - SAVE_OR_REMOVE_SPECIAL("unit_system", default_prefs.unit_system, unitValue, unitSystem[unitValue]); - s.setValue("temperature", ui.fahrenheit->isChecked() ? units::FAHRENHEIT : units::CELSIUS); - s.setValue("length", ui.feet->isChecked() ? units::FEET : units::METERS); - s.setValue("pressure", ui.psi->isChecked() ? units::PSI : units::BAR); - s.setValue("volume", ui.cuft->isChecked() ? units::CUFT : units::LITER); - 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("coordinates", ui.gpsTraditional->isChecked()); - s.endGroup(); - // Defaults s.beginGroup("GeneralSettings"); s.setValue("defaultsetpoint", rint(ui.defaultSetpoint->value() * 1000.0)); @@ -391,7 +353,6 @@ void PreferencesDialog::buttonClicked(QAbstractButton *button) void PreferencesDialog::on_resetSettings_clicked() { QSettings s; - QMessageBox response(this); response.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); response.setDefaultButton(QMessageBox::Cancel); diff --git a/desktop-widgets/preferences.ui b/desktop-widgets/preferences.ui index a799d966c..12ba10d4b 100644 --- a/desktop-widgets/preferences.ui +++ b/desktop-widgets/preferences.ui @@ -85,16 +85,6 @@ </property> <item> <property name="text"> - <string>Units</string> - </property> - <property name="icon"> - <iconset> - <normalon>:/units</normalon> - </iconset> - </property> - </item> - <item> - <property name="text"> <string>Graph</string> </property> <property name="icon"> @@ -134,309 +124,8 @@ </sizepolicy> </property> <property name="currentIndex"> - <number>3</number> + <number>0</number> </property> - <widget class="QWidget" name="units_page"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>5</number> - </property> - <property name="margin"> - <number>5</number> - </property> - <item> - <widget class="QGroupBox" name="groupBox_units"> - <property name="title"> - <string>Unit system</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="label_6"> - <property name="text"> - <string>System</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="metric"> - <property name="text"> - <string>&Metric</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_6</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="imperial"> - <property name="text"> - <string>Imperial</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_6</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="personalize"> - <property name="text"> - <string>Personali&ze</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_6</string> - </attribute> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="units_group"> - <property name="title"> - <string>Individual settings</string> - </property> - <property name="checkable"> - <bool>false</bool> - </property> - <property name="checked"> - <bool>false</bool> - </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Depth</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QRadioButton" name="meter"> - <property name="text"> - <string>meter</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup</string> - </attribute> - </widget> - </item> - <item row="0" column="2"> - <widget class="QRadioButton" name="feet"> - <property name="text"> - <string>feet</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup</string> - </attribute> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Pressure</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QRadioButton" name="bar"> - <property name="text"> - <string>bar</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_2</string> - </attribute> - </widget> - </item> - <item row="1" column="2"> - <widget class="QRadioButton" name="psi"> - <property name="text"> - <string>psi</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_2</string> - </attribute> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Volume</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QRadioButton" name="liter"> - <property name="text"> - <string>&liter</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_3</string> - </attribute> - </widget> - </item> - <item row="2" column="2"> - <widget class="QRadioButton" name="cuft"> - <property name="text"> - <string>cu ft</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_3</string> - </attribute> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_4"> - <property name="text"> - <string>Temperature</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QRadioButton" name="celsius"> - <property name="text"> - <string>celsius</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_4</string> - </attribute> - </widget> - </item> - <item row="3" column="2"> - <widget class="QRadioButton" name="fahrenheit"> - <property name="text"> - <string>fahrenheit</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_4</string> - </attribute> - </widget> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="label_5"> - <property name="text"> - <string>Weight</string> - </property> - </widget> - </item> - <item row="4" column="1"> - <widget class="QRadioButton" name="kg"> - <property name="text"> - <string>kg</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_5</string> - </attribute> - </widget> - </item> - <item row="4" column="2"> - <widget class="QRadioButton" name="lbs"> - <property name="text"> - <string>lbs</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_5</string> - </attribute> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <layout class="QHBoxLayout"> - <item> - <widget class="QGroupBox" name="groupBox"> - <property name="title"> - <string>Time units</string> - </property> - <layout class="QGridLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="label13"> - <property name="text"> - <string>Ascent/descent speed denominator</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QRadioButton" name="vertical_speed_minutes"> - <property name="text"> - <string>Minutes</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">verticalSpeed</string> - </attribute> - </widget> - </item> - <item row="0" column="2"> - <widget class="QRadioButton" name="vertical_speed_seconds"> - <property name="text"> - <string>Seconds</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">verticalSpeed</string> - </attribute> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QGroupBox" name="groupBox_11"> - <property name="title"> - <string>GPS coordinates</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_12"> - <item> - <widget class="QLabel" name="label_27"> - <property name="text"> - <string>Location Display</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="gpsTraditional"> - <property name="text"> - <string>traditional (dms)</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_7</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="gpsDecimal"> - <property name="text"> - <string>decimal</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_7</string> - </attribute> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> <widget class="QWidget" name="graph_page"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> @@ -1121,182 +810,6 @@ </hints> </connection> <connection> - <sender>personalize</sender> - <signal>toggled(bool)</signal> - <receiver>units_group</receiver> - <slot>setEnabled(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>185</x> - <y>19</y> - </hint> - <hint type="destinationlabel"> - <x>186</x> - <y>23</y> - </hint> - </hints> - </connection> - <connection> - <sender>imperial</sender> - <signal>toggled(bool)</signal> - <receiver>feet</receiver> - <slot>setChecked(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>164</x> - <y>19</y> - </hint> - <hint type="destinationlabel"> - <x>175</x> - <y>34</y> - </hint> - </hints> - </connection> - <connection> - <sender>metric</sender> - <signal>toggled(bool)</signal> - <receiver>meter</receiver> - <slot>setChecked(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>142</x> - <y>19</y> - </hint> - <hint type="destinationlabel"> - <x>153</x> - <y>34</y> - </hint> - </hints> - </connection> - <connection> - <sender>imperial</sender> - <signal>toggled(bool)</signal> - <receiver>psi</receiver> - <slot>setChecked(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>164</x> - <y>19</y> - </hint> - <hint type="destinationlabel"> - <x>175</x> - <y>33</y> - </hint> - </hints> - </connection> - <connection> - <sender>metric</sender> - <signal>toggled(bool)</signal> - <receiver>bar</receiver> - <slot>setChecked(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>142</x> - <y>19</y> - </hint> - <hint type="destinationlabel"> - <x>153</x> - <y>33</y> - </hint> - </hints> - </connection> - <connection> - <sender>imperial</sender> - <signal>toggled(bool)</signal> - <receiver>cuft</receiver> - <slot>setChecked(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>164</x> - <y>19</y> - </hint> - <hint type="destinationlabel"> - <x>175</x> - <y>31</y> - </hint> - </hints> - </connection> - <connection> - <sender>metric</sender> - <signal>toggled(bool)</signal> - <receiver>liter</receiver> - <slot>setChecked(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>142</x> - <y>19</y> - </hint> - <hint type="destinationlabel"> - <x>153</x> - <y>31</y> - </hint> - </hints> - </connection> - <connection> - <sender>imperial</sender> - <signal>toggled(bool)</signal> - <receiver>fahrenheit</receiver> - <slot>setChecked(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>164</x> - <y>19</y> - </hint> - <hint type="destinationlabel"> - <x>175</x> - <y>29</y> - </hint> - </hints> - </connection> - <connection> - <sender>metric</sender> - <signal>toggled(bool)</signal> - <receiver>celsius</receiver> - <slot>setChecked(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>142</x> - <y>19</y> - </hint> - <hint type="destinationlabel"> - <x>153</x> - <y>29</y> - </hint> - </hints> - </connection> - <connection> - <sender>imperial</sender> - <signal>toggled(bool)</signal> - <receiver>lbs</receiver> - <slot>setChecked(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>164</x> - <y>19</y> - </hint> - <hint type="destinationlabel"> - <x>175</x> - <y>28</y> - </hint> - </hints> - </connection> - <connection> - <sender>metric</sender> - <signal>toggled(bool)</signal> - <receiver>kg</receiver> - <slot>setChecked(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>142</x> - <y>19</y> - </hint> - <hint type="destinationlabel"> - <x>153</x> - <y>28</y> - </hint> - </hints> - </connection> - <connection> <sender>proxyAuthRequired</sender> <signal>toggled(bool)</signal> <receiver>proxyUsername</receiver> diff --git a/desktop-widgets/preferences/CMakeLists.txt b/desktop-widgets/preferences/CMakeLists.txt index c55d7b881..8ea4bd79c 100644 --- a/desktop-widgets/preferences/CMakeLists.txt +++ b/desktop-widgets/preferences/CMakeLists.txt @@ -15,6 +15,7 @@ set(SUBSURFACE_PREFERENCES_LIB_SRCS preferences_language.cpp preferences_georeference.cpp preferences_defaults.cpp + preferences_units.cpp ) source_group("Subsurface Preferences" FILES ${SUBSURFACE_PREFERENCES_LIB_SRCS}) diff --git a/desktop-widgets/preferences/preferences_units.cpp b/desktop-widgets/preferences/preferences_units.cpp new file mode 100644 index 000000000..76f2078d7 --- /dev/null +++ b/desktop-widgets/preferences/preferences_units.cpp @@ -0,0 +1,60 @@ +#include "preferences_units.h" +#include "ui_preferences_units.h" +#include "prefs-macros.h" +#include "qthelper.h" + +#include <QSettings> + +PreferencesUnits::PreferencesUnits(): AbstractPreferencesWidget(tr("Units"),QIcon(":units"),1), ui(new Ui::PreferencesUnits()) +{ + ui->setupUi(this); +} + +PreferencesUnits::~PreferencesUnits() +{ + +} + +void PreferencesUnits::refreshSettings() +{ + QSettings s; + s.beginGroup("Units"); + QString unitSystem[] = {"metric", "imperial", "personal"}; + short unitValue = ui->metric->isChecked() ? METRIC : (ui->imperial->isChecked() ? IMPERIAL : PERSONALIZE); + SAVE_OR_REMOVE_SPECIAL("unit_system", default_prefs.unit_system, unitValue, unitSystem[unitValue]); + s.setValue("temperature", ui->fahrenheit->isChecked() ? units::FAHRENHEIT : units::CELSIUS); + s.setValue("length", ui->feet->isChecked() ? units::FEET : units::METERS); + s.setValue("pressure", ui->psi->isChecked() ? units::PSI : units::BAR); + s.setValue("volume", ui->cuft->isChecked() ? units::CUFT : units::LITER); + 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("coordinates", ui->gpsTraditional->isChecked()); + s.endGroup(); +} + +void PreferencesUnits::syncSettings() +{ + switch(prefs.unit_system) { + case METRIC: ui->metric->setChecked(true); break; + case IMPERIAL: ui->imperial->setChecked(true); break; + default: ui->personalize->setChecked(true); break; + } + + ui->gpsTraditional->setChecked(prefs.coordinates_traditional); + ui->gpsDecimal->setChecked(!prefs.coordinates_traditional); + + ui->celsius->setChecked(prefs.units.temperature == units::CELSIUS); + ui->fahrenheit->setChecked(prefs.units.temperature == units::FAHRENHEIT); + ui->meter->setChecked(prefs.units.length == units::METERS); + ui->feet->setChecked(prefs.units.length == units::FEET); + ui->bar->setChecked(prefs.units.pressure == units::BAR); + ui->psi->setChecked(prefs.units.pressure == units::PSI); + ui->liter->setChecked(prefs.units.volume == units::LITER); + ui->cuft->setChecked(prefs.units.volume == units::CUFT); + ui->kg->setChecked(prefs.units.weight == units::KG); + ui->lbs->setChecked(prefs.units.weight == units::LBS); + ui->units_group->setEnabled(ui->personalize->isChecked()); + + ui->vertical_speed_minutes->setChecked(prefs.units.vertical_speed_time == units::MINUTES); + ui->vertical_speed_seconds->setChecked(prefs.units.vertical_speed_time == units::SECONDS); +} diff --git a/desktop-widgets/preferences/preferences_units.h b/desktop-widgets/preferences/preferences_units.h new file mode 100644 index 000000000..21a7f4404 --- /dev/null +++ b/desktop-widgets/preferences/preferences_units.h @@ -0,0 +1,21 @@ +#ifndef PREFERENCES_UNITS_H +#define PREFERENCES_UNITS_H + +#include "abstractpreferenceswidget.h" + +namespace Ui { + class PreferencesUnits; +} + +class PreferencesUnits : public AbstractPreferencesWidget { + Q_OBJECT +public: + PreferencesUnits(); + virtual ~PreferencesUnits(); + virtual void refreshSettings(); + virtual void syncSettings(); +private: + Ui::PreferencesUnits *ui; +}; + +#endif
\ No newline at end of file diff --git a/desktop-widgets/preferences/preferences_units.ui b/desktop-widgets/preferences/preferences_units.ui new file mode 100644 index 000000000..bb1ffba66 --- /dev/null +++ b/desktop-widgets/preferences/preferences_units.ui @@ -0,0 +1,251 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>PreferencesUnits</class> + <widget class="QWidget" name="PreferencesUnits"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>374</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="groupBox_units"> + <property name="title"> + <string>Unit system</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label_6"> + <property name="text"> + <string>System</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="metric"> + <property name="text"> + <string>&Metric</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="imperial"> + <property name="text"> + <string>Imperial</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="personalize"> + <property name="text"> + <string>Personali&ze</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="units_group"> + <property name="title"> + <string>Individual settings</string> + </property> + <property name="checkable"> + <bool>false</bool> + </property> + <property name="checked"> + <bool>false</bool> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Depth</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QRadioButton" name="meter"> + <property name="text"> + <string>meter</string> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QRadioButton" name="feet"> + <property name="text"> + <string>feet</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Pressure</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QRadioButton" name="bar"> + <property name="text"> + <string>bar</string> + </property> + </widget> + </item> + <item row="1" column="2"> + <widget class="QRadioButton" name="psi"> + <property name="text"> + <string>psi</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Volume</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QRadioButton" name="liter"> + <property name="text"> + <string>&liter</string> + </property> + </widget> + </item> + <item row="2" column="2"> + <widget class="QRadioButton" name="cuft"> + <property name="text"> + <string>cu ft</string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>Temperature</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QRadioButton" name="celsius"> + <property name="text"> + <string>celsius</string> + </property> + </widget> + </item> + <item row="3" column="2"> + <widget class="QRadioButton" name="fahrenheit"> + <property name="text"> + <string>fahrenheit</string> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>Weight</string> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QRadioButton" name="kg"> + <property name="text"> + <string>kg</string> + </property> + </widget> + </item> + <item row="4" column="2"> + <widget class="QRadioButton" name="lbs"> + <property name="text"> + <string>lbs</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>Time units</string> + </property> + <layout class="QGridLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="label13"> + <property name="text"> + <string>Ascent/descent speed denominator</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QRadioButton" name="vertical_speed_minutes"> + <property name="text"> + <string>Minutes</string> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QRadioButton" name="vertical_speed_seconds"> + <property name="text"> + <string>Seconds</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_11"> + <property name="title"> + <string>GPS coordinates</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_12"> + <item> + <widget class="QLabel" name="label_27"> + <property name="text"> + <string>Location Display</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="gpsTraditional"> + <property name="text"> + <string>traditional (dms)</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="gpsDecimal"> + <property name="text"> + <string>decimal</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/desktop-widgets/preferences/preferencesdialog.cpp b/desktop-widgets/preferences/preferencesdialog.cpp index 6f66d856d..7d9e17d7e 100644 --- a/desktop-widgets/preferences/preferencesdialog.cpp +++ b/desktop-widgets/preferences/preferencesdialog.cpp @@ -4,6 +4,7 @@ #include "preferences_language.h" #include "preferences_georeference.h" #include "preferences_defaults.h" +#include "preferences_units.h" #include <QVBoxLayout> #include <QHBoxLayout> @@ -37,6 +38,7 @@ PreferencesDialogV2::PreferencesDialogV2() addPreferencePage(new PreferencesLanguage()); addPreferencePage(new PreferencesGeoreference()); addPreferencePage(new PreferencesDefaults()); + addPreferencePage(new PreferencesUnits()); refreshPages(); connect(pagesList, &QListWidget::currentRowChanged, |