aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-09-10 22:22:30 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-09-10 22:22:30 +0200
commitef13b2219106edb7783077149cac6d1b816e9bf4 (patch)
tree3fec039f71b9f337f9be8ae994515514cf199d26
parenta41ed61c886626d87397f4b9c47097c724198bfb (diff)
parent533a38d48252b464a5376d19011fdb09b2040304 (diff)
downloadayatana-indicator-display-ef13b2219106edb7783077149cac6d1b816e9bf4.tar.gz
ayatana-indicator-display-ef13b2219106edb7783077149cac6d1b816e9bf4.tar.bz2
ayatana-indicator-display-ef13b2219106edb7783077149cac6d1b816e9bf4.zip
Merge branch 'tari01-pr/store-geolocation'
Attributes GH PR #76: https://github.com/AyatanaIndicators/ayatana-indicator-display/pull/76
-rw-r--r--data/org.ayatana.indicator.display.gschema.xml12
-rw-r--r--src/rotation-lock.cpp8
2 files changed, 18 insertions, 2 deletions
diff --git a/data/org.ayatana.indicator.display.gschema.xml b/data/org.ayatana.indicator.display.gschema.xml
index ededac4..9218b64 100644
--- a/data/org.ayatana.indicator.display.gschema.xml
+++ b/data/org.ayatana.indicator.display.gschema.xml
@@ -57,5 +57,17 @@
<summary>Theme profile</summary>
<description>The current theme temperature profile being used by the indicator.</description>
</key>
+ <key name="latitude" type="d">
+ <range min="-90.0" max="90.0"/>
+ <default>51.4825766</default>
+ <summary>Current geographic latitude</summary>
+ <description>Stores the last recorded geographic latitude of the device.</description>
+ </key>
+ <key name="longitude" type="d">
+ <range min="-180.0" max="180.0"/>
+ <default>-0.0076589</default>
+ <summary>Current geographic longitude</summary>
+ <description>Stores the last recorded geographic longitude of the device.</description>
+ </key>
</schema>
</schemalist>
diff --git a/src/rotation-lock.cpp b/src/rotation-lock.cpp
index 9ca7218..9e2971b 100644
--- a/src/rotation-lock.cpp
+++ b/src/rotation-lock.cpp
@@ -177,6 +177,8 @@ public:
{
if (!this->bTest)
{
+ this->fLatitude = g_settings_get_double (this->m_settings, "latitude");
+ this->fLongitude = g_settings_get_double (this->m_settings, "longitude");
gclue_simple_new ("ayatana-indicator-display", GCLUE_ACCURACY_LEVEL_CITY, NULL, onGeoClueLoaded, this);
this->nCallback = g_timeout_add_seconds (60, updateColor, this);
updateColor (this);
@@ -371,6 +373,8 @@ private:
GClueLocation *pLocation = gclue_simple_get_location (pSimple);
pImpl->fLatitude = gclue_location_get_latitude (pLocation);
pImpl->fLongitude = gclue_location_get_longitude (pLocation);
+ g_settings_set_double (pImpl->m_settings, "latitude", pImpl->fLatitude);
+ g_settings_set_double (pImpl->m_settings, "longitude", pImpl->fLongitude);
}
updateColor (pImpl);
@@ -702,8 +706,8 @@ private:
std::shared_ptr<SimpleProfile> m_desktop;
std::shared_ptr<GIcon> m_icon;
#ifdef COLOR_TEMP_ENABLED
- gdouble fLatitude = 51.4825766;
- gdouble fLongitude = -0.0076589;
+ gdouble fLatitude = 0.0;
+ gdouble fLongitude = 0.0;
gboolean bAutoSliderUpdate = FALSE;
guint nCallback = 0;
gdouble fLastBrightness = 0.0;