More test
[gregoa/zavai.git] / src / zavai.vala
index 3a92d78c1958e6ca92d12b6eb05eed0c7bae40bd..956d21213d2338cbceb7b9952029c7f4547422f6 100644 (file)
@@ -38,46 +38,46 @@ static int main (string[] args) {
        // # Read configuration
        // zavai.info("Loading configuration")
        // conf = zavai.Config()
-       // 
-       // # Set up dbus
-       // dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-       // dbus_system_bus = dbus.SystemBus()
 
        // Set up zavai
+
+    // Core infrastructure
        zavai.config = new zavai.Config();
        zavai.registry = new zavai.Registry();
        zavai.app = new zavai.Zavai();
 
        zavai.registry.register_resource("zavai", zavai.app);
 
+    // Additional infrastructure
+       zavai.input.init();
        zavai.gps.init();
+       zavai.clock.init();
+
+       /*
+       zavai.clock.clock.schedule(new zavai.clock.Alarm(123456, "Second"));
+       zavai.clock.clock.schedule(new zavai.clock.Alarm(1234567, "Third"));
+       zavai.clock.clock.schedule(new zavai.clock.Alarm(12345, "First"));
+       zavai.clock.clock.check_alarms();
+       */
 
        zavai.registry.register_menu("menu.main", new zavai.Menu("Main menu"));
 
-       // TODO: register the rest of menus here
+       // User interface
+       zavai.ui.main.init();
        zavai.ui.gps.init();
+       zavai.ui.power.init();
        zavai.ui.kbd.init();
        zavai.ui.wm.init();
+       zavai.ui.polygen.init();
        zavai.ui.debug.init();
 
-       zavai.app.show_applet("menu.main");
-
-       // # Register main factories
-       // registry.register(conf, "conf")
-       // registry.register_factory(zavai.GPX, "gpx")
-       // registry.register_factory(zavai.Audio, "audio")
-
-       // # Load plugins
-       // zavai.info("Loading plugins")
-       // for p in zavai.load_plugins(nick="zavai"):
-       //     try:
-       //         p.init(conf = conf, registry = registry)
-       //     except Exception, e:
-       //         print >>sys.stderr, "Exception caught loading plugin %s: skipping plugin" % p
-       //         print >>sys.stderr, "Exception details:"
-       //         import traceback
-       //         details = traceback.format_exc()
-       //         print >>sys.stderr, "\t"+details.rstrip().replace("\n", "\n\t")
+       //zavai.app.show_applet("menu.main");
+       zavai.app.show_applet("zavai.status");
+
+       zavai.clock.clock.schedule(new zavai.clock.Alarm(time_t() + 10, "Test second"));
+       zavai.clock.clock.schedule(new zavai.clock.Alarm(time_t() + 5, "Test first"));
+
+       //zavai.ui.power.power_menu.toggle();
 
        // # Shutdown the main loop on SIGINT
        // def on_kill(signum, frame):
@@ -90,9 +90,24 @@ static int main (string[] args) {
        // app.connect("destroy", gtk.main_quit)
        // app.run()
 
+/*
+       dynamic DBus.Object otime = zavai.registry.sbus.get_object(
+                       "org.freesmartphone.otimed",
+                       "/org/freesmartphone/Time/Alarm",
+                       "org.freesmartphone.Time.Alarm");
+
+       otime.ClearAlarm();
+       otime.SetAlarm(time_t() + 10);
+
+       dynamic DBus.Object notification = zavai.registry.sbus.get_object(
+                       "org.freesmartphone",
+                       "org/freesmartphone/Notification",
+                       "org.freesmartphone.Notification");
+       notification.Alarm += on_alarm;
+*/
+
        zavai.app.run();
        Gtk.main();
-       //registry.loop.run();
 
        // zavai.info("Shutting down")
        zavai.registry.shutdown();