Merge lp:~bilalakhtar/update-manager/unity-quicklist into lp:update-manager

Proposed by Bilal Akhtar
Status: Merged
Merged at revision: 2103
Proposed branch: lp:~bilalakhtar/update-manager/unity-quicklist
Merge into: lp:update-manager
Diff against target: 77 lines (+30/-1)
1 file modified
UpdateManager/UpdateManager.py (+30/-1)
To merge this branch: bzr merge lp:~bilalakhtar/update-manager/unity-quicklist
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Review via email: mp+57289@code.launchpad.net

Description of the change

This branch adds unity dynamic quicklist support for update-manager. Would need a UIFe before the merge.

To post a comment you must log in.
2095. By Bilal Akhtar

Minor changes to make signal callbacks suit both those of Gtk and Dbusmenu

2096. By Bilal Akhtar

Disable/enable the install menu item as per the update status

2097. By Bilal Akhtar

Move dbusmenu and Unity declaration to the top of script

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

Hi Michael,

I tested this, and it should work provided that Unity is built from this branch: https://code.launchpad.net/~ken-vandine/unity/make-quicklists-work-again/+merge/57386

Its a bug in Unity, and another bug which makes Unity crash if the dbusmenu contains a hidden item. So we have 2 options:

1) Get this fix in after those bugs are fixed in Unity.
2) Ignore this for Natty, we'll add it in Oneiric (I prefer this for now; taking into consideration the fact that UIF is in place).

What do you think?

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks a bunch I merged this into my "for-unity" branch and will push it out once natty is released. I like it a lot but it arrived a little bit late.

Revision history for this message
Michael Vogt (mvo) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UpdateManager/UpdateManager.py'
2--- UpdateManager/UpdateManager.py 2011-04-06 07:43:01 +0000
3+++ UpdateManager/UpdateManager.py 2011-04-12 20:25:47 +0000
4@@ -85,6 +85,8 @@
5 from HelpViewer import HelpViewer
6 from MetaReleaseGObject import MetaRelease
7
8+from gi.repository import Dbusmenu, Unity
9+
10 #import pdb
11
12 # FIXME:
13@@ -297,6 +299,29 @@
14 self.alert_watcher.connect("battery-alert", self._on_battery_alert)
15 self.alert_watcher.connect("network-3g-alert", self._on_network_3g_alert)
16
17+ # Create Unity launcher quicklist
18+ um_launcher_entry = Unity.LauncherEntry.get_for_desktop_id ("update-manager.desktop")
19+ quicklist = Dbusmenu.Menuitem.new()
20+
21+ update_dbusmenuitem = Dbusmenu.Menuitem.new()
22+ update_dbusmenuitem.property_set (Dbusmenu.MENUITEM_PROP_LABEL, _("Check for Updates"))
23+ update_dbusmenuitem.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, True)
24+ update_dbusmenuitem.connect ("item-activated", self.on_button_reload_clicked, None)
25+ quicklist.child_append(update_dbusmenuitem)
26+
27+ self.install_dbusmenuitem = Dbusmenu.Menuitem.new()
28+ self.install_dbusmenuitem.property_set (Dbusmenu.MENUITEM_PROP_LABEL,
29+ _("Install All Available Updates"))
30+ self.install_dbusmenuitem.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, True)
31+ self.install_dbusmenuitem.connect ("item-activated", self.install_all_updates, None)
32+ quicklist.child_append (self.install_dbusmenuitem)
33+
34+ um_launcher_entry.set_property ("quicklist", quicklist)
35+
36+ def install_all_updates (self, menu, menuitem, data):
37+ self.select_all_updgrades (None)
38+ self.on_button_install_clicked (None)
39+
40 def on_initial_focus_in(self, widget, event):
41 """callback run on initial focus-in (if started unmapped)"""
42 widget.unstick()
43@@ -550,14 +575,17 @@
44 #else:
45 # self.button_install.set_sensitive(True)
46 self.button_install.set_sensitive(True)
47+ self.install_dbusmenuitem.property_set_bool(Dbusmenu.MENUITEM_PROP_VISIBLE, True)
48 else:
49 if inst_count > 0:
50 download_str = ngettext("The update has already been downloaded, but not installed",
51 "The updates have already been downloaded, but not installed", inst_count)
52 self.button_install.set_sensitive(True)
53+ self.install_dbusmenuitem.property_set_bool(Dbusmenu.MENUITEM_PROP_VISIBLE, True)
54 else:
55 download_str = _("There are no updates to install")
56 self.button_install.set_sensitive(False)
57+ self.install_dbusmenuitem.property_set_bool(Dbusmenu.MENUITEM_PROP_VISIBLE, False)
58 self.image_downsize.set_sensitive(False)
59 # TRANSLATORS: this allows to switch the order of the count of
60 # updates and the download size string (if needed)
61@@ -640,6 +668,7 @@
62 self.notebook_details.set_sensitive(False)
63 self.treeview_update.set_sensitive(False)
64 self.button_install.set_sensitive(False)
65+ self.install_dbusmenuitem.property_set_bool(Dbusmenu.MENUITEM_PROP_VISIBLE, False)
66 self.button_close.grab_default()
67 self.textview_changes.get_buffer().set_text("")
68 self.textview_descr.get_buffer().set_text("")
69@@ -685,7 +714,7 @@
70 if expanded:
71 self.on_treeview_update_cursor_changed(self.treeview_update)
72
73- def on_button_reload_clicked(self, widget):
74+ def on_button_reload_clicked(self, widget, menuitem = None, data = None):
75 #print "on_button_reload_clicked"
76 self.check_metarelease()
77 self.invoke_manager(UPDATE)

Subscribers

People subscribed via source and target branches

to status/vote changes: