#!/usr/bin/python """ This file is part of Mokonnect. Mokonnect is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation. Mokonnect is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Mokonnect. If not, see . """ # # mokonnect.py # moko connection manager # # Core imports import elementary import e_dbus import qdbus # main menu import mkmenu def exit_func(): menu.SaveConfig() elementary.exit() def shutdown(obj, *args, **kargs): exit_func() def main(): global menu elementary.init() mainloop = e_dbus.DBusEcoreMainLoop() bus = {} bus["connman"] = qdbus.QDBus("org.moblin.connman",mainloop=mainloop,extra_wrap=qdbus.QDBEConnman) bus["connman"].SetInterfaces({ "Manager": "org.moblin.connman.Manager", "Network": "org.moblin.connman.Network", "Device": "org.moblin.connman.Device", "Connection": "org.moblin.connman.Connection", "Service": "org.moblin.connman.Service" }) bus["ousaged"] = qdbus.QDBus("org.freesmartphone.ousaged",mainloop=mainloop) bus["ousaged"].SetInterfaces({ "Usage": "org.freesmartphone.Usage", }) bus["ogsmd"] = qdbus.QDBus("org.freesmartphone.ogsmd",mainloop=mainloop) bus["ogsmd"].SetInterfaces({ "PDP": "org.freesmartphone.GSM.PDP", }) win = elementary.Window("mokonnect", elementary.ELM_WIN_BASIC) win.title_set("Mokonnect") win.callback_destroy_add(shutdown) win.show() bg = elementary.Background(win) win.resize_object_add(bg) bg.show() pager = elementary.Pager(win) win.resize_object_add(pager) pager.show() menu = mkmenu.Menu(win,pager,bus,exit_func) menu.LoadConfig() pager.content_push(menu.BuildMenu()) elementary.run() elementary.shutdown() main()