Added button to reset the GPS
authorEnrico Zini <enrico@enricozini.org>
Sun, 6 Sep 2009 19:44:14 +0000 (20:44 +0100)
committerEnrico Zini <enrico@enricozini.org>
Sun, 6 Sep 2009 19:44:14 +0000 (20:44 +0100)
README
src/app_gps.vala

diff --git a/README b/README
index cb8cdc83d12c46b22de4586e284ac522eba42e41..270c1e271fed74cfb072a02c40da55c38363fd80 100644 (file)
--- a/README
+++ b/README
@@ -122,10 +122,6 @@ TODO list / wish list
  http://git.freesmartphone.org/?p=specs.git;a=blob_plain;f=html/index.html;hb=HEAD
 
  * Features to add:
- - "GPS has crashed" button that turns off and on the GPS
-    - After pushing, turn into a "GPS crashed AGAIN" button that turns the GPS
-      off, removes /var/lib/freesmartphone/ogpsd.pickle and then turns it back
-      on again.
  - icon linking to "current apps" in the main screen
  - alarm
     - vibrate at alarm trigger
index 72545bcfd10a5f1a16a29f71643a36b9ea799449..e1b8f842c61761f4ed72368d9ba7441551de80dc 100644 (file)
@@ -160,6 +160,34 @@ public class GPSRequestLink : Gtk.ToggleButton
        }
 }
 
+public class GPSStuck : Gtk.Button
+{
+       protected bool happened;
+
+       public GPSStuck()
+       {
+               label = "The GPS is stuck";
+               happened = false;
+               clicked += on_clicked;
+               set_size_request(0, zavai.config.min_button_height);
+       }
+
+       public void on_clicked()
+       {
+               if (!happened)
+               {
+                       zavai.app.run_script(zavai.config.homedir + "/reset_gps");
+                       label = "The GPS is stuck AGAIN";
+               }
+               else
+               {
+                       zavai.app.run_script(zavai.config.homedir + "/reset_gps again");
+                       label = "The GPS is stuck";
+               }
+               happened = !happened;
+       }
+}
+
 public void init()
 {
     /*
@@ -176,6 +204,7 @@ public void init()
     menu_gps.add_applet("ui.gps.monitor");
     menu_gps.add_widget(menu_waypoint);
     menu_gps.add_widget(menu_gpsrequest);
+    menu_gps.add_widget(new GPSStuck());
 }
 
 }