Update GSM info when turning it off
authorEnrico Zini <enrico@enricozini.org>
Fri, 26 Mar 2010 19:25:36 +0000 (19:25 +0000)
committerEnrico Zini <enrico@enricozini.org>
Fri, 26 Mar 2010 19:25:36 +0000 (19:25 +0000)
src/app_main.vala
zavai/gsm.vala

index ae1735fceb63cad2ea4aaf8b970a77824736a730..ce1eeaaa7ae6bd41e54d5c71ffbd4fd2b6b7e773 100644 (file)
@@ -152,7 +152,10 @@ public class Status : Applet
 
         zavai.gsm.gsm.status_changed += (msg) => { gsm_status.set_text(msg); };
         zavai.gsm.gsm.info_changed += () => {
-            gsm_info.set_text("%s %d%%".printf(zavai.gsm.gsm.info_provider, zavai.gsm.gsm.info_signal_strength));
+            if (zavai.gsm.gsm.info_signal_strength != -1)
+                gsm_info.set_text("%s %d%%".printf(zavai.gsm.gsm.info_provider, zavai.gsm.gsm.info_signal_strength));
+            else
+                gsm_info.set_text(zavai.gsm.gsm.info_provider);
         };
     }
 }
index 6829a291380b9cdfc5959bf86e74496584d4495d..a73e9f8a0e8d0a7424b4e8786506a551504998a5 100644 (file)
@@ -230,6 +230,9 @@ public class GSM: zavai.ScriptMonitorService
         script_stop();
 
         status_changed("");
+        info_provider = "";
+        info_signal_strength = -1;
+        info_changed();
     }
 
     protected override void cleanup_after_script_stop()