Merge lp:~bilalakhtar/aptdaemon/unity-integration into lp:aptdaemon

Proposed by Bilal Akhtar
Status: Needs review
Proposed branch: lp:~bilalakhtar/aptdaemon/unity-integration
Merge into: lp:aptdaemon
Diff against target: 43 lines (+19/-0)
1 file modified
aptdaemon/gtkwidgets.py (+19/-0)
To merge this branch: bzr merge lp:~bilalakhtar/aptdaemon/unity-integration
Reviewer Review Type Date Requested Status
Michael Vogt Needs Fixing
Review via email: mp+63673@code.launchpad.net

Description of the change

Check if the client is update-manager. If yes, then throw away progress stats to libunity. To make this work fully, lp:~bilalakhtar/update-manager/unity-launcher-progress should merge into lp:update-manager after this branch is merged into lp:aptdaemon.

This branch merge is a part of the blueprint https://blueprints.launchpad.net/ubuntu/+spec/desktop-o-default-apps-unity-integration .

Merging this code into aptdaemon could facilitate unity integration in other apps using aptdaemon as well, in the future.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your branch! I merged this support in a slighly different way into update-manager.

As for a generic solution in aptdaemon I think this needs more generalization and ideally its own aptdaemon.unityprogress that just takes the transaction and a application name. This way its more generic then to include it in the gtkwidgets.

Feedback from Sebastian is also welcome on this.

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

Well, the only purpose why I embedded this thing inside aptdaemon was because it was more closely tied to the progress bar. That isn't an efficient way to do this, and hence I guess it might be better to just leave things in aptdaemon as it is. I don't think any other app using aptdaemon would need launcher integration (except software-center, where it'll be implemented very differently).

Revision history for this message
Sebastian Heinlein (glatzor) wrote :

There are also other applications using aptdaemon which could make use of the progress bar:

sessioninstaller
language-selector-gnome
oem-config
gnome-codec-install

I am quite short on time. But I will have a look at this at Tuesday.

Revision history for this message
Robert Roth (evfool) wrote :

What's the status on this? Does update-manager have unity integration? I have checked the update-manager and aptdaemon source, and neither do have update-manager progress indication support, and the feature-freeze is close.

Sebastian, please provide some more feedback, do you agree with mvo on having a separate aptdaemon.unityprogress to have a general solution?

Just asking to find out what needs to be done to have this ready for oneiric.

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

On Mon, Aug 01, 2011 at 08:21:15AM -0000, Robert Roth wrote:
> What's the status on this? Does update-manager have unity integration? I have checked the update-manager and aptdaemon source, and neither do have update-manager progress indication support, and the feature-freeze is close.
[..]

update-manager will use unity if its available and show progress
information and number of available updates. But having a more general
progress in aptdaemon would certainly be a good thing.

Cheers,
 Michael

Unmerged revisions

661. By Bilal Akhtar

If Update-Manager is running, export progress information to libunity. This code may also make it easier for other apps using aptdaemon to integrate with Unity, beginning with update-manager

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'aptdaemon/gtkwidgets.py'
--- aptdaemon/gtkwidgets.py 2011-04-09 06:29:28 +0000
+++ aptdaemon/gtkwidgets.py 2011-06-07 10:16:34 +0000
@@ -43,6 +43,10 @@
43import pango43import pango
44import pygtk44import pygtk
45import vte45import vte
46try:
47 from gi.repository import Unity
48except ImportError:
49 pass
4650
47import client51import client
48from enums import *52from enums import *
@@ -287,6 +291,17 @@
287 self.pulse()291 self.pulse()
288 else:292 else:
289 self.set_fraction(progress/100.0)293 self.set_fraction(progress/100.0)
294 try:
295 self._unity_launcher_entry.set_property("progress", progress/100.0)
296 self._unity_launcher_entry.set_property("progress_visible", True)
297 except AttributeError: # _unity_launcher_entry isn't defined
298 if transaction.meta_data.get('unity_client_name') == "update-manager":
299 try:
300 self._unity_launcher_entry = Unity.LauncherEntry.get_for_desktop_id("update-manager.desktop")
301 except NameError:
302 return
303 self._unity_launcher_entry.set_property("progress", progress/100.0)
304 self._unity_launcher_entry.set_property("progress_visible", True)
290305
291 def _on_progress_details(self, transaction, items_done, items_total,306 def _on_progress_details(self, transaction, items_done, items_total,
292 bytes_done, bytes_total, speed, eta):307 bytes_done, bytes_total, speed, eta):
@@ -309,6 +324,10 @@
309 def _on_finished(self, transaction, exit):324 def _on_finished(self, transaction, exit):
310 """Set the progress to 100% when the transaction is complete"""325 """Set the progress to 100% when the transaction is complete"""
311 self.set_fraction(1)326 self.set_fraction(1)
327 try:
328 self._unity_launcher_entry.set_property("progress_visible", False)
329 except AttributeError:
330 pass
312331
313332
314class AptDetailsExpander(gtk.Expander):333class AptDetailsExpander(gtk.Expander):

Subscribers

People subscribed via source and target branches

to status/vote changes: