~thisfred/ubuntuone-control-panel/gui-service

« back to all changes in this revision

Viewing changes to bin/ubuntuone-control-panel-gtk

  • Committer: Tarmac
  • Author(s): eric.casteleijn at canonical
  • Date: 2011-03-21 14:01:51 UTC
  • mfrom: (93.1.6 dbusify)
  • Revision ID: tarmac-20110321140151-zkjdhcek0ks67xcd
* Added service file template (will need a packaging branch to actually install it)
* Make bin/ubuntuone-control-panel-gtk not open a new panel if one is already open

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from optparse import OptionParser
28
28
 
29
29
from ubuntuone.controlpanel.gtk.gui import ControlPanelWindow
 
30
from ubuntuone.controlpanel.gtk import DBUS_BUS_NAME
30
31
 
31
32
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
32
33
 
47
48
 
48
49
 
49
50
if __name__ == "__main__":
 
51
    bus = dbus.SessionBus()
 
52
    name = bus.request_name(DBUS_BUS_NAME,
 
53
                            dbus.bus.NAME_FLAG_DO_NOT_QUEUE)
 
54
    if name == dbus.bus.REQUEST_NAME_REPLY_EXISTS:
 
55
        sys.exit(0)
 
56
 
 
57
    bus_name = dbus.service.BusName(DBUS_BUS_NAME, bus=dbus.SessionBus())
50
58
    parser = parser_options()
51
59
    (options, args) = parser.parse_args(sys.argv)
52
 
    gui = ControlPanelWindow(switch_to=options.switch_to, alert=options.alert)
 
60
    gui = ControlPanelWindow(
 
61
        switch_to=options.switch_to, alert=options.alert)
53
62
    gui.main()