Managed to export a proper dbus interface for alarm notification
[gregoa/zavai.git] / src / clock.vala
index edc1ca17c642b663ce0bdeb6de4b9bba94418f62..5a22847a7ba13f247ac3217ddf650e462670bbc2 100644 (file)
@@ -147,15 +147,12 @@ public class AlarmNotification : Object {
        public void Alarm () {
                clock.check_alarms();
        }
-       public void AtAlarm (string label) {
-               clock.notify(label);
-       }
 }
 
 [DBus (name = "org.enricozini.zavai.Alarm")]
-public class ZavaiAlarm : Object {
-       public void Notify () {
-               clock.notify("ciao");
+public class ZavaiClock : Object {
+       public void Notify (string label) {
+               clock.notify(label);
        }
 }
 
@@ -170,7 +167,7 @@ public class Clock: zavai.Service
        protected time_t chosen_time;
        protected SourceType chosen_type;
        protected AlarmNotification listener;
-       protected ZavaiAlarm listener1;
+       protected ZavaiClock dbusClock;
 
        protected dynamic DBus.Object otimed_alarm;
        protected dynamic DBus.Object rtc;
@@ -185,7 +182,7 @@ public class Clock: zavai.Service
                Object(name: "clock");
                alarms = null;
                listener = new AlarmNotification();
-               listener1 = new ZavaiAlarm();
+               dbusClock = new ZavaiClock();
                last_minute = 0;
                last_gps_time = 0;
                last_gps_time_system_time = 0;
@@ -209,7 +206,7 @@ public class Clock: zavai.Service
                                "org.freesmartphone.Device.RealtimeClock");
 
                zavai.registry.sbus.register_object("/", listener);
-
+               zavai.registry.sbus.register_object("/org/enricozini/Zavai/Clock", dbusClock);
        }
 
        public void notify(string label)