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";
25 static int main (string[] args) {
28 // parser = Parser(usage="usage: %prog [options]",
29 // version="%prog "+ VERSION,
30 // description="Simple interactive interface for the OpenMoko")
31 // parser.add_option("-v", "--verbose", action="store_true", help="verbose mode")
33 // (opts, args) = parser.parse_args()
35 // if not opts.verbose:
38 // # Read configuration
39 // zavai.info("Loading configuration")
40 // conf = zavai.Config()
43 // dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
44 // dbus_system_bus = dbus.SystemBus()
47 zavai.config = new zavai.Config();
48 zavai.registry = new zavai.Registry();
49 zavai.app = new zavai.Zavai();
51 zavai.registry.register_resource("zavai", zavai.app);
55 zavai.registry.register_menu("menu.main", new zavai.Menu("Main menu"));
57 // TODO: register the rest of menus here
61 zavai.ui.debug.init();
63 zavai.app.show_applet("menu.main");
65 // # Register main factories
66 // registry.register(conf, "conf")
67 // registry.register_factory(zavai.GPX, "gpx")
68 // registry.register_factory(zavai.Audio, "audio")
71 // zavai.info("Loading plugins")
72 // for p in zavai.load_plugins(nick="zavai"):
74 // p.init(conf = conf, registry = registry)
75 // except Exception, e:
76 // print >>sys.stderr, "Exception caught loading plugin %s: skipping plugin" % p
77 // print >>sys.stderr, "Exception details:"
79 // details = traceback.format_exc()
80 // print >>sys.stderr, "\t"+details.rstrip().replace("\n", "\n\t")
82 // # Shutdown the main loop on SIGINT
83 // def on_kill(signum, frame):
85 // signal.signal(signal.SIGINT, on_kill)
86 // signal.signal(signal.SIGTERM, on_kill)
88 // zavai.info("Starting")
89 // app = registry.resource("app")
90 // app.connect("destroy", gtk.main_quit)
95 //registry.loop.run();
97 // zavai.info("Shutting down")
98 zavai.registry.shutdown();