[gnome-clocks/wip/geoinfo] Add gsetting to toggle geolocation support



commit 1cf0d2d769efafeb1cb0eb4fe3a81016505c934e
Author: Evgeny Bobkin <evgen ibqn gmail com>
Date:   Wed Sep 11 10:10:22 2013 +0200

    Add gsetting to toggle geolocation support

 data/org.gnome.clocks.gschema.xml.in.in |    7 +++++++
 src/world.vala                          |    8 +++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/data/org.gnome.clocks.gschema.xml.in.in b/data/org.gnome.clocks.gschema.xml.in.in
index b7b24e0..63aaa0a 100644
--- a/data/org.gnome.clocks.gschema.xml.in.in
+++ b/data/org.gnome.clocks.gschema.xml.in.in
@@ -21,6 +21,13 @@
         Configured timer duration in seconds.
       </_description>
     </key>
+    <key name="geolocation" type="b">
+      <default>true</default>
+      <_summary>Geolocation support</_summary>
+      <_description>
+        Turns geolocation support on and off, respectively.
+      </_description>
+    </key>
   </schema>
   <enum id="org.gnome.clocks.panelid">
     <value nick="world" value="0"/>
diff --git a/src/world.vala b/src/world.vala
index 39ca2c9..c7e708f 100644
--- a/src/world.vala
+++ b/src/world.vala
@@ -321,9 +321,11 @@ public class MainPanel : Gtk.Stack, Clocks.Clock {
 
         load ();
 
-        use_geolocation.begin ((obj, res) => {
-            use_geolocation.end (res);
-        });
+        if (settings.get_boolean ("geolocation")) {
+            use_geolocation.begin ((obj, res) => {
+                use_geolocation.end (res);
+            });
+        }
 
         notify["visible-child"].connect (() => {
             if (visible_child == content_view) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]