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
1=== modified file 'aptdaemon/gtkwidgets.py'
2--- aptdaemon/gtkwidgets.py 2011-04-09 06:29:28 +0000
3+++ aptdaemon/gtkwidgets.py 2011-06-07 10:16:34 +0000
4@@ -43,6 +43,10 @@
5 import pango
6 import pygtk
7 import vte
8+try:
9+ from gi.repository import Unity
10+except ImportError:
11+ pass
12
13 import client
14 from enums import *
15@@ -287,6 +291,17 @@
16 self.pulse()
17 else:
18 self.set_fraction(progress/100.0)
19+ try:
20+ self._unity_launcher_entry.set_property("progress", progress/100.0)
21+ self._unity_launcher_entry.set_property("progress_visible", True)
22+ except AttributeError: # _unity_launcher_entry isn't defined
23+ if transaction.meta_data.get('unity_client_name') == "update-manager":
24+ try:
25+ self._unity_launcher_entry = Unity.LauncherEntry.get_for_desktop_id("update-manager.desktop")
26+ except NameError:
27+ return
28+ self._unity_launcher_entry.set_property("progress", progress/100.0)
29+ self._unity_launcher_entry.set_property("progress_visible", True)
30
31 def _on_progress_details(self, transaction, items_done, items_total,
32 bytes_done, bytes_total, speed, eta):
33@@ -309,6 +324,10 @@
34 def _on_finished(self, transaction, exit):
35 """Set the progress to 100% when the transaction is complete"""
36 self.set_fraction(1)
37+ try:
38+ self._unity_launcher_entry.set_property("progress_visible", False)
39+ except AttributeError:
40+ pass
41
42
43 class AptDetailsExpander(gtk.Expander):

Subscribers

People subscribed via source and target branches

to status/vote changes: