2 * zavai - simple interface to the OpenMoko (or to the FSO stack)
4 * Copyright (C) 2009 Enrico Zini <enrico@enricozini.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 //string VERSION = "0.1";
27 stderr.printf("RETURNED\n");
30 static int main (string[] args) {
33 // parser = Parser(usage="usage: %prog [options]",
34 // version="%prog "+ VERSION,
35 // description="Simple interactive interface for the OpenMoko")
36 // parser.add_option("-v", "--verbose", action="store_true", help="verbose mode")
38 // (opts, args) = parser.parse_args()
40 // if not opts.verbose:
43 // # Read configuration
44 // zavai.info("Loading configuration")
45 // conf = zavai.Config()
48 // dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
49 // dbus_system_bus = dbus.SystemBus()
53 // Core infrastructure
54 zavai.config = new zavai.Config();
55 zavai.registry = new zavai.Registry();
56 zavai.app = new zavai.Zavai();
58 zavai.registry.register_resource("zavai", zavai.app);
60 // Additional infrastructure
64 zavai.registry.register_menu("menu.main", new zavai.Menu("Main menu"));
70 zavai.ui.powerbutton.init();
71 zavai.ui.debug.init();
73 zavai.app.show_applet("menu.main");
75 // # Register main factories
76 // registry.register(conf, "conf")
77 // registry.register_factory(zavai.GPX, "gpx")
78 // registry.register_factory(zavai.Audio, "audio")
81 // zavai.info("Loading plugins")
82 // for p in zavai.load_plugins(nick="zavai"):
84 // p.init(conf = conf, registry = registry)
85 // except Exception, e:
86 // print >>sys.stderr, "Exception caught loading plugin %s: skipping plugin" % p
87 // print >>sys.stderr, "Exception details:"
89 // details = traceback.format_exc()
90 // print >>sys.stderr, "\t"+details.rstrip().replace("\n", "\n\t")
92 // # Shutdown the main loop on SIGINT
93 // def on_kill(signum, frame):
95 // signal.signal(signal.SIGINT, on_kill)
96 // signal.signal(signal.SIGTERM, on_kill)
98 // zavai.info("Starting")
99 // app = registry.resource("app")
100 // app.connect("destroy", gtk.main_quit)
104 dynamic DBus.Object otime = zavai.registry.sbus.get_object(
105 "org.freesmartphone.otimed",
106 "/org/freesmartphone/Time/Alarm",
107 "org.freesmartphone.Time.Alarm");
110 otime.SetAlarm(time_t() + 10);
112 dynamic DBus.Object notification = zavai.registry.sbus.get_object(
113 "org.freesmartphone",
114 "org/freesmartphone/Notification",
115 "org.freesmartphone.Notification");
116 notification.Alarm += on_alarm;
121 //registry.loop.run();
123 // zavai.info("Shutting down")
124 zavai.registry.shutdown();