Attempt to GET the alarm response
authorEnrico Zini <enrico@enricozini.org>
Mon, 17 Aug 2009 16:12:33 +0000 (17:12 +0100)
committerEnrico Zini <enrico@enricozini.org>
Mon, 17 Aug 2009 16:12:33 +0000 (17:12 +0100)
src/clock.vala

index 8504f918b717120f770fd0716da0c67006357e0f..963638f4184a751937bf4a358a47309cb3757f68 100644 (file)
@@ -48,6 +48,13 @@ private int alarm_compare(void* a, void* b)
     return (int)(((Alarm*)a)->deadline - ((Alarm*)b)->deadline);
 }
 
+[DBus (name = "org.freesmartphone.Notification")]
+public class TestAlarmListener : Object {
+    public void Alarm () {
+stderr.printf("GOT ALARMAMAMAMAM!\n");        
+    }
+}
+
 public class Clock: zavai.Service
 {
     protected time_t last_gps_time;
@@ -58,6 +65,7 @@ public class Clock: zavai.Service
     protected time_t last_minute;
     protected time_t chosen_time;
     protected SourceType chosen_type;
+    protected TestAlarmListener listener;
 
        protected dynamic DBus.Object otimed_alarm;
        protected dynamic DBus.Object notification;
@@ -70,6 +78,7 @@ public class Clock: zavai.Service
        {
                name = "clock";
         alarms = null;
+        listener = new TestAlarmListener();
         last_minute = 0;
         last_gps_time = 0;
         last_gps_time_system_time = 0;
@@ -88,11 +97,14 @@ public class Clock: zavai.Service
                        "org.freesmartphone.Time.Alarm");
         if (otimed_alarm == null)
             zavai.log.error("ALARM IS NULL");
-        notification = zavai.registry.sbus.get_object(
-            "org.freesmartphone",
-            "org/freesmartphone/Notification",
-            "org.freesmartphone.Notification");
-        notification.Alarm += on_alarm;
+
+        zavai.registry.sbus.register_object("/", listener);
+
+        //notification = zavai.registry.sbus.get_object(
+        //    "org.freesmartphone",
+        //    "org/freesmartphone/Notification",
+        //    "org.freesmartphone.Notification");
+        //notification.Alarm += on_alarm;
        }
 
     public void schedule(Alarm a)