~ubuntu-branches/ubuntu/wily/docky/wily-proposed

« back to all changes in this revision

Viewing changes to scripts/docky/docky.py

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane
  • Date: 2010-05-04 16:15:39 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100504161539-fxt02zw6oprun9gi
Tags: 2.0.3.1-1
* New upstream release 2.0.3.1 "You should have heard from us by now",
  changes include:
  + fix gnome-keyring related crash in Lucid caused by GMail docklet
    (LP: #555562)
  + catch exception for read-failure of cxoffice launcher (LP: #573294)
  + check if authentication is used before using network proxy
  + make sure to update screen regions when showing menus
  + make transparent themed docks still glow in configuration mode
    (LP: #572416)
  + Memory Leaks
    - some unlinked handlers and pixbufs (DockItemMenu, WindowDockItem, ...)
    - proper disposal of tile-widgets in preferences dialog
    - properly using DesktopAppInfo for launching application
  + GMail: fix exception when reloading (LP: #573991)
  + CLOCK: popup menu must always show icons (LP: #574003)
  + helpers crash when dbus isn't available (LP: #540688)
* debian/rules: Don't byte compile python helpers as this causes them to
  appear in the prefs window twice (and the compiled ones don't work) 
* debian/control: Add dep on librsvg2-common to fix installability when this
  isn't otherwise available.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
                self.bus = dbus.SessionBus()
40
40
                self.id_map = {}
41
41
                
42
 
                obj = self.bus.get_object(dockybus, self.path)
43
 
                self.iface = dbus.Interface(obj, itemiface)
44
 
        
45
 
                self.bus.add_signal_receiver(self.menu_pressed_signal, "MenuItemActivated", itemiface, dockybus, self.path)
46
 
                self.bus.add_signal_receiver(self.item_confirmation_needed, "ItemConfirmationNeeded", itemiface, dockybus, self.path)
 
42
                try:
 
43
                        obj = self.bus.get_object(dockybus, self.path)
 
44
                        self.iface = dbus.Interface(obj, itemiface)
 
45
 
 
46
                        self.bus.add_signal_receiver(self.menu_pressed_signal, "MenuItemActivated", itemiface, dockybus, self.path)
 
47
                        self.bus.add_signal_receiver(self.item_confirmation_needed, "ItemConfirmationNeeded", itemiface, dockybus, self.path)
 
48
                except dbus.DBusException, e:
 
49
                        print "DockyItem(): %s" % e
 
50
                        sys.exit(0)
47
51
 
48
52
        def menu_pressed_signal(self, menu_id):
49
53
                if self.id_map.has_key(menu_id):
76
80
                try:
77
81
                        obj = self.bus.get_object(dockybus, dockypath)
78
82
                        self._iface = dbus.Interface(obj, dockyiface)
 
83
 
 
84
                        paths = self._iface.DockItemPaths()
 
85
 
 
86
                        self.bus.add_signal_receiver(self.item_added,   "ItemAdded",    dockyiface, dockybus, dockypath)
 
87
                        self.bus.add_signal_receiver(self.item_removed, "ItemRemoved",  dockyiface, dockybus, dockypath)
 
88
                        self.bus.add_signal_receiver(self.shut_down,    "ShuttingDown", dockyiface, dockybus, dockypath)
 
89
 
 
90
                        for pathtoitem in paths:
 
91
                                obj = self.bus.get_object(dockybus, pathtoitem)
 
92
                                item = dbus.Interface(obj, itemiface)
 
93
                                self.item_path_found(pathtoitem, item)
 
94
 
 
95
                        self.bus.add_signal_receiver(self.name_owner_changed_cb, dbus_interface='org.freedesktop.DBus', signal_name='NameOwnerChanged')
79
96
                except dbus.DBusException, e:
80
97
                        print "DockySink(): %s" % e
81
98
                        sys.exit(0)
82
99
 
83
 
                paths = self._iface.DockItemPaths()
84
 
                
85
 
                self.bus.add_signal_receiver(self.item_added,   "ItemAdded",    dockyiface, dockybus, dockypath)
86
 
                self.bus.add_signal_receiver(self.item_removed, "ItemRemoved",  dockyiface, dockybus, dockypath)
87
 
                self.bus.add_signal_receiver(self.shut_down,    "ShuttingDown", dockyiface, dockybus, dockypath)
88
 
                
89
 
                for pathtoitem in paths:
90
 
                        obj = self.bus.get_object(dockybus, pathtoitem)
91
 
                        item = dbus.Interface(obj, itemiface)
92
 
                        self.item_path_found(pathtoitem, item)
93
 
 
94
 
                self.bus.add_signal_receiver(self.name_owner_changed_cb, dbus_interface='org.freedesktop.DBus', signal_name='NameOwnerChanged')
95
 
 
96
100
        def name_owner_changed_cb(self, name, old_owner, new_owner):
97
101
                if name == dockybus and not new_owner:
98
102
                        print "DockyDBus %s is gone, quitting now..." % name