diff --git a/pref.h b/pref.h
index afc5373fd..2e5bf83c7 100644
--- a/pref.h
+++ b/pref.h
@@ -48,6 +48,7 @@ struct preferences {
short display_invalid_dives;
short unit_system;
struct units units;
+ bool coordinates_traditional;
short show_sac;
short display_unused_tanks;
short show_average_depth;
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index e4f97002e..aeccc961c 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -146,6 +146,8 @@ void PreferencesDialog::setUiFromPrefs()
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);
@@ -306,6 +308,7 @@ void PreferencesDialog::syncSettings()
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
@@ -384,6 +387,7 @@ void PreferencesDialog::loadSettings()
GET_UNIT("weight", weight, units::LBS, units::KG);
}
GET_UNIT("vertical_speed_time", vertical_speed_time, units::MINUTES, units::SECONDS);
+ GET_BOOL("coordinates", coordinates_traditional);
s.endGroup();
s.beginGroup("TecDetails");
GET_BOOL("po2graph", pp_graphs.po2);
diff --git a/qt-ui/preferences.ui b/qt-ui/preferences.ui
index e67925f56..84c90d7ff 100644
--- a/qt-ui/preferences.ui
+++ b/qt-ui/preferences.ui
@@ -21,127 +21,6 @@
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 80
- 0
-
-
-
-
- 80
- 16777215
-
-
-
-
- 40
- 40
-
-
-
- Qt::ElideNone
-
-
- QListView::Static
-
-
- true
-
-
- QListView::Batched
-
-
- 0
-
-
-
- 70
- 60
-
-
-
- QListView::IconMode
-
-
- false
-
-
- true
-
-
- -1
-
-
-
-
- Defaults
-
-
-
- :/subsurface-icon
-
-
-
- -
-
- Units
-
-
-
- :/units
-
-
-
- -
-
- Graph
-
-
-
- :/graph
-
-
-
- -
-
- Language
-
-
-
- :/advanced
-
-
-
- -
-
- Network
-
-
-
- :/network
-
-
-
- -
-
- Facebook
-
-
-
- :/facebook
-
-
-
-
-
-
@@ -584,6 +463,42 @@
+ -
+
+
+ GPS coordinates
+
+
+
-
+
+
+ Location Display
+
+
+
+ -
+
+
+ traditional (dms)
+
+
+ buttonGroup_7
+
+
+
+ -
+
+
+ decimal
+
+
+ buttonGroup_7
+
+
+
+
+
+
-
@@ -1077,6 +992,127 @@
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 80
+ 0
+
+
+
+
+ 80
+ 16777215
+
+
+
+
+ 40
+ 40
+
+
+
+ Qt::ElideNone
+
+
+ QListView::Static
+
+
+ true
+
+
+ QListView::Batched
+
+
+ 0
+
+
+
+ 70
+ 60
+
+
+
+ QListView::IconMode
+
+
+ false
+
+
+ true
+
+
+ -1
+
+
-
+
+ Defaults
+
+
+
+ :/subsurface-icon
+
+
+
+ -
+
+ Units
+
+
+
+ :/units
+
+
+
+ -
+
+ Graph
+
+
+
+ :/graph
+
+
+
+ -
+
+ Language
+
+
+
+ :/advanced
+
+
+
+ -
+
+ Network
+
+
+
+ :/network
+
+
+
+ -
+
+ Facebook
+
+
+
+ :/facebook
+
+
+
+
+
-
@@ -1431,12 +1467,13 @@
-
+
+
-
+
diff --git a/qthelper.cpp b/qthelper.cpp
index 030ed94c9..bbe908e6f 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -84,19 +84,23 @@ extern "C" const char *printGPSCoords(int lat, int lon)
if (!lat && !lon)
return strdup("");
- lath = lat >= 0 ? translate("gettextFromC", "N") : translate("gettextFromC", "S");
- lonh = lon >= 0 ? translate("gettextFromC", "E") : translate("gettextFromC", "W");
- lat = abs(lat);
- lon = abs(lon);
- latdeg = lat / 1000000U;
- londeg = lon / 1000000U;
- latmin = (lat % 1000000U) * 60U;
- lonmin = (lon % 1000000U) * 60U;
- latsec = (latmin % 1000000) * 60;
- lonsec = (lonmin % 1000000) * 60;
- result.sprintf("%u%s%02d\'%06.3f\"%s %u%s%02d\'%06.3f\"%s",
- latdeg, UTF8_DEGREE, latmin / 1000000, latsec / 1000000, lath.toUtf8().data(),
- londeg, UTF8_DEGREE, lonmin / 1000000, lonsec / 1000000, lonh.toUtf8().data());
+ if (prefs.coordinates_traditional) {
+ lath = lat >= 0 ? translate("gettextFromC", "N") : translate("gettextFromC", "S");
+ lonh = lon >= 0 ? translate("gettextFromC", "E") : translate("gettextFromC", "W");
+ lat = abs(lat);
+ lon = abs(lon);
+ latdeg = lat / 1000000U;
+ londeg = lon / 1000000U;
+ latmin = (lat % 1000000U) * 60U;
+ lonmin = (lon % 1000000U) * 60U;
+ latsec = (latmin % 1000000) * 60;
+ lonsec = (lonmin % 1000000) * 60;
+ result.sprintf("%u%s%02d\'%06.3f\"%s %u%s%02d\'%06.3f\"%s",
+ latdeg, UTF8_DEGREE, latmin / 1000000, latsec / 1000000, lath.toUtf8().data(),
+ londeg, UTF8_DEGREE, lonmin / 1000000, lonsec / 1000000, lonh.toUtf8().data());
+ } else {
+ result.sprintf("%f %f", (double) lat / 1000000.0, (double) lon / 1000000.0);
+ }
return strdup(result.toUtf8().data());
}
diff --git a/subsurfacestartup.c b/subsurfacestartup.c
index d7a7ede4d..886365a16 100644
--- a/subsurfacestartup.c
+++ b/subsurfacestartup.c
@@ -7,6 +7,7 @@ struct preferences prefs;
struct preferences default_prefs = {
.units = SI_UNITS,
.unit_system = METRIC,
+ .coordinates_traditional = true,
.pp_graphs = {
.po2 = false,
.pn2 = false,