first attempt at packaging -- a few rough edges
[gregoa/zavai.git] / plugins / 50_sat_monitor.py
index 8f82d1f49ea3bafd2d5d53595e374354ac1178dd..e44108463806dbf3b5c363fddecf2586d8f11318 100644 (file)
@@ -33,8 +33,10 @@ SAT_QI_NAMES = {
 }
 
 class SatelliteMonitor(zavai.Applet):
 }
 
 class SatelliteMonitor(zavai.Applet):
-    def __init__(self, registry, name, **kw):
-        super(SatelliteMonitor, self).__init__(registry, name, _("Satellite monitor"))
+    def __init__(self, registry, **kw):
+        super(SatelliteMonitor, self).__init__(registry,
+                "menu.main.gps.satellite_monitor",
+                _("Satellite monitor"))
 
         self.gps = None
 
 
         self.gps = None
 
@@ -56,10 +58,10 @@ class SatelliteMonitor(zavai.Applet):
     def start(self, *args):
         if self.gps is None:
             self.init()
     def start(self, *args):
         if self.gps is None:
             self.init()
-        self.gps.monitor.connect(self.on_ubxdebug_packet)
+        self.gps.monitor.connect("satellites", self.on_ubxdebug_packet)
 
     def stop(self, *args):
 
     def stop(self, *args):
-        self.gps.monitor.disconnect(self.on_ubxdebug_packet)
+        self.gps.monitor.disconnect("satellites", self.on_ubxdebug_packet)
 
     def on_ubxdebug_packet(self, clid, length, data):
         # In zhone it is cbUBXDebugPacket
 
     def on_ubxdebug_packet(self, clid, length, data):
         # In zhone it is cbUBXDebugPacket
@@ -100,5 +102,4 @@ class SatelliteMonitor(zavai.Applet):
                 qi])
 
 def init(conf = None, registry = None, **kw):
                 qi])
 
 def init(conf = None, registry = None, **kw):
-    name = "menu.main.gps.satellite_monitor"
-    registry.register(name, SatelliteMonitor(registry, name))
+    registry.register(SatelliteMonitor(registry))