Merge lp:~mterry/aptdaemon/progress-tweaks into lp:aptdaemon

Proposed by Michael Terry
Status: Needs review
Proposed branch: lp:~mterry/aptdaemon/progress-tweaks
Merge into: lp:aptdaemon
Diff against target: 201 lines (+50/-34)
2 files modified
aptdaemon/gtk3widgets.py (+25/-17)
aptdaemon/gtkwidgets.py (+25/-17)
To merge this branch: bzr merge lp:~mterry/aptdaemon/progress-tweaks
Reviewer Review Type Date Requested Status
Matthew Paul Thomas (community) design Needs Fixing
Sebastian Heinlein Pending
Review via email: mp+108789@code.launchpad.net

Description of the change

This branch implements some of the progress dialog changes from https://wiki.ubuntu.com/SoftwareUpdates

Specifically:
1) Drops the in-dialog icon
2) Updates a couple of the header labels' wording
3) Moves the cancel button to the right of the progress bar
4) Allows minimizing the dialog
5) Adds an API call to ask not to update the title bar (the consumer can then set it to something custom)
6) Adds an API call to ask not to show the details expander

To post a comment you must log in.
Revision history for this message
Sebastian Heinlein (glatzor) wrote :

Am Dienstag, den 05.06.2012, 17:29 +0000 schrieb Michael Terry:
> Michael Terry has proposed merging lp:~mterry/aptdaemon/progress-tweaks into lp:aptdaemon.
>
> Requested reviews:
> Aptdaemon Developers (aptdaemon-developers)
>
> For more details, see:
> https://code.launchpad.net/~mterry/aptdaemon/progress-tweaks/+merge/108789
>
> This branch implements some of the progress dialog changes from https://wiki.ubuntu.com/SoftwareUpdates
>
> Specifically:
> 1) Drops the in-dialog icon

The cute little animation... :)

> 2) Updates a couple of the header labels' wording

Be careful: ROLE_COMMIT_PACKAGES can be an installation, removal, update
or downgrade of packages. Even at the same time. So you cannot reduce
the name to installing updates only.

If you only want to update packages you should use the update packages
call in update-manager.

Why do you want to add the three points? At first this should be
consistent with all other enums. Secondly it should be consistent with
the other apps from the GNOME desktop.

If you want to set a custom label we should better add support for this
to the dialog: Perhaps adding a message_format or label parameter to
__init__()?

> 5) Adds an API call to ask not to update the title bar (the consumer can then set it to something custom)

I would prefer if the title would be set to the role automatically if it
is empty instead of introducing another setter.

if not self.get_title():
    self.set_title(role)

The role of a transaction cannot be changed and so will always be the
same.

Or is this too much magic?

> 6) Adds an API call to ask not to show the details expander

It would be nice to have a hidden option for update-manager to allow
showing the details (gnome-tweaks?) if you plan to remove them by
default. It is quite popular by users to watch the downloads - it seems
to give them some feeling of control. Alternatively the terminal can be
hidden by the terminal parameter separately.

Thanks,

Sebastian

lp:~mterry/aptdaemon/progress-tweaks updated
834. By Michael Terry

changes from merge review

Revision history for this message
Michael Terry (mterry) wrote :

Hello, Sebastian! Thanks for the review.

> Be careful: ROLE_COMMIT_PACKAGES can be an installation, removal, update
> or downgrade of packages

Ah... Hmm... It looks like AptClient.install_packages() can do both upgrades and installs? That can work for update-manager.

The ellipsis is common for such in-progress labels. I added it because it was in mpt's spec. But it's used throughout GNOME too. As for the consistency with other roles, I agree.

> The role of a transaction cannot be changed and so will always be the
> same.

Ah! I assumed it could, because we connect to the "role-changed" signal on the transaction. If that signal only ever fires zero or one time (I'm assuming the signal is for transactions where the role isn't set immediately...), then your check-for-empty-title solution seems fine.

> It would be nice to have a hidden option for update-manager to allow
> showing the details

I guess that's a call for mpt, but that can be done update-manager side. I think the API I added here would be suitable regardless.

I've updated the branch to use your empty-title fix, to add ellipses to all the roles, to revert the COMMIT role back to "Applying changes", and to change the INSTALL role to "Installing updates". Could you review again?

Revision history for this message
Michael Terry (mterry) wrote :

(As for adding an API for an explicit custom label, I don't believe we *need* that yet, but it wouldn't hurt, and might let update-manager get the ellipsis if you still want to reject them.)

Revision history for this message
Michael Terry (mterry) wrote :

Actually, "Installing updates" probably doesn't make much sense in the general sense of installing new packages. So maybe that change shouldn't be made and I should just add a custom way to set the label... I'll work on that.

lp:~mterry/aptdaemon/progress-tweaks updated
835. By Michael Terry

revert changes to Role labels, add ability to specify a custom label for the progress dialog; and add back a line that accidentally got deleted that makes hiding the details view actually work

Revision history for this message
Michael Terry (mterry) wrote :

OK, try now. I added a label=None keyword argument to the __init__ function. If set, the role won't be used for the main label.

I also reverted the rest of the role label changes since they weren't needed anymore.

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

Am Mittwoch, den 06.06.2012, 18:58 +0000 schrieb Michael Terry:
> OK, try now. I added a label=None keyword argument to the __init__ function. If set, the role won't be used for the main label.
>
> I also reverted the rest of the role label changes since they weren't needed anymore.

I will have a look at it on Friday. By the way in which time zone do you
live? The US?

Revision history for this message
Michael Terry (mterry) wrote :

Sure, no rush. I live in EST (Boston).

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

In the long term, I think Update Manager should use its own progress UI rather than Aptdaemon's progress window. In <https://wiki.ubuntu.com/SoftwareUpdates#Installing> I show the initial prompt morphing into the progress window, when later morphs into the report of success or failure; that's probably difficult as long as they're separate executables. More importantly, Aptdaemon's progress window probably should be modal to its parent window, so that -- for example -- a media player isn't confused by you doing something else in its window while it is blocked waiting for a codec to install. The Software Updater progress window, meanwhile, shouldn't be modal to anything.

If that's true, then this --

- functions = Gdk.WMFunction.MOVE|Gdk.WMFunction.RESIZE
+ functions = Gdk.WMFunction.MOVE|Gdk.WMFunction.RESIZE|Gdk.WMFunction.MINIMIZE

-- is not a good idea. You shouldn't be able to minimize a dialog independently of its parent window.

+ # Setup the label, progressbar, and cancel button

Grammar nit: "Setup" is a noun. The verb is "Set up". (I mention this because it's a common UI mistake too.)

+ self.label_role.set_markup("<big><b>%s</b></big>" % self.custom_label)

+ self.label_role.set_markup("<big><b>%s</b></big>" % role)

This is a progress window, not an alert, so the text shouldn't be any larger or bolder than normal.

Thanks!

review: Needs Fixing (design)
Revision history for this message
Michael Terry (mterry) wrote :

> -- is not a good idea. You shouldn't be able to minimize a dialog independently of its parent window.

I believe the WM is responsible for handling such cases. For example, in Unity with this patch, if the aptdaemon window is alone, minimize is shown. When it is modal, minimize is not. So I think that line is safe.

> Grammar nit: "Setup" is a noun. The verb is "Set up". (I mention this because it's a common UI mistake too.)

True. That nit was in the original code, but I suppose I could have fixed with my patch.

> This is a progress window, not an alert, so the text shouldn't be any larger or bolder than normal.

Again, this was in the original code. This would be another design difference from mpt's spec, so if you are looking to change aptdaemon to no longer have bold & large labels there, I'd have to either hack around your changes in update-manager or roll my own progress dialog sooner rather than later.

Revision history for this message
Michael Terry (mterry) wrote :

Hah, sorry, didn't realize you had replied, mpt. I thought it was Sebastian still. So let me ask you to clarify then. In your mockups, it looks like the role label is larger than the text below the progress bar.

Revision history for this message
Michael Terry (mterry) wrote :

But you are right that the morphing will be tough without us owning the widgets (considering that it will likely involve just one GtkWindow and just swapping out the contents). So maybe this branch isn't super important and I can work on copying the widget into update-manager's source (it's not that much code).

This branch is still useful though to achieve a consistent look.

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

Am Montag, den 11.06.2012, 15:30 +0000 schrieb Michael Terry:
> So maybe this branch isn't super important and I can work on copying the widget into update-manager's source (it's not that much code).

So please don't copy any code of the widgets into different projects.
The gtk(3)widgets modules provides a set of widgets which can used to
monitor and control an aptdaemon transaction and can easily be re-used:
Status label, progress bar, cancel dialog or details expander. The
AptProgressDialog was just a kind of generic show-case dialog to provide
a fast starting point for aptdaemon clients.

> This branch is still useful though to achieve a consistent look.

The dialog is used by sessioninstaller, too. But we could think about
moving sessiontionstaller to a morphing approach (notebook with hidden
tabs or assistant).

Cheers,

Sebastian

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

Am Montag, den 11.06.2012, 14:57 +0000 schrieb Matthew Paul Thomas:
> Review: Needs Fixing design
>
> In the long term, I think Update Manager should use its own progress UI rather than Aptdaemon's progress window. In <https://wiki.ubuntu.com/SoftwareUpdates#Installing> I show the initial prompt morphing into the progress window, when later morphs into the report of success or failure; that's probably difficult as long as they're separate executables. More importantly, Aptdaemon's progress window probably should be modal to its parent window, so that -- for example -- a media player isn't confused by you doing something else in its window while it is blocked waiting for a codec to install. The Software Updater progress window, meanwhile, shouldn't be modal to anything.

A small technical correction: The aptdaemon dialog is part of the
update-manager process. The dialog is created by update-manager.

But sessioninstaller (the codec installer) is a different story. The
codec requesting application calls a D-Bus (PackageKit) method and so
starts the codec installer on demand. The D-Bus call also includes a
window id to which sessioninstaller should be transient for. So if this
isn't the case you should fill a bug.

> Grammar nit: "Setup" is a noun. The verb is "Set up". (I mention this because it's a common UI mistake too.)

This is also a common mistake of me. :)

> + self.label_role.set_markup("<big><b>%s</b></big>" % self.custom_label)
>
> + self.label_role.set_markup("<big><b>%s</b></big>" % role)
>
> This is a progress window, not an alert, so the text shouldn't be any larger or bolder than normal.

Good point, but it seems to introduce a strange weighting. It makes the
difference to the status label harder to spot. I attached some
screenshots to this mail.

Revision history for this message
Michael Terry (mterry) wrote :

> So please don't copy any code of the widgets into different projects.
> The gtk(3)widgets modules provides a set of widgets which can used to

I wasn't planning on copying the widgets like the progress bar or details expander. Just the dialog that holds them together.

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

> In your mockups, it looks like the role label is larger than the text below the progress bar.

> It makes the difference to the status label harder to spot. I attached some screenshots to this mail.

I think the role label should be normal size, while the text below the progress bar should be a caption <small>. I'm sorry my sketches weren't quite high-resolution enough to show this. :-)

Apart from that, the screenshots Sebastian forwarded me look good -- both for the aptdaemon standalone progress dialog, and as a jumping-off point for Software Updater's variation of the dialog.

Unmerged revisions

835. By Michael Terry

revert changes to Role labels, add ability to specify a custom label for the progress dialog; and add back a line that accidentally got deleted that makes hiding the details view actually work

834. By Michael Terry

changes from merge review

833. By Michael Terry

and same changes for gtk2 widgets too

832. By Michael Terry

UI tweaks to the apt progress dialog to match mpt's spec for the Software Updater

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'aptdaemon/gtk3widgets.py'
2--- aptdaemon/gtk3widgets.py 2012-05-12 02:09:10 +0000
3+++ aptdaemon/gtk3widgets.py 2012-06-06 18:57:18 +0000
4@@ -540,47 +540,50 @@
5 GObject.TYPE_NONE, ())}
6
7 def __init__(self, transaction=None, parent=None, terminal=True,
8- debconf=True):
9+ debconf=True, label=None):
10 Gtk.Dialog.__init__(self, parent=parent)
11 self._expanded_size = None
12 self.debconf = debconf
13+ self.custom_label = label
14 # Setup the dialog
15 self.set_border_width(6)
16 self.set_resizable(False)
17 self.get_content_area().set_spacing(6)
18- # Setup the cancel button
19- self.button_cancel = AptCancelButton(transaction)
20- self.get_action_area().pack_start(self.button_cancel, False, False, 0)
21- # Setup the status icon, label and progressbar
22- hbox = Gtk.HBox()
23- hbox.set_spacing(12)
24- hbox.set_border_width(6)
25- self.icon = AptRoleIcon()
26- hbox.pack_start(self.icon, False, True, 0)
27+ # Setup the label, progressbar, and cancel button
28 vbox = Gtk.VBox()
29 vbox.set_spacing(12)
30+ vbox.set_border_width(6)
31 self.label_role = Gtk.Label()
32 self.label_role.set_alignment(0, 0)
33+ if self.custom_label:
34+ self.label_role.set_markup("<big><b>%s</b></big>" % self.custom_label)
35 vbox.pack_start(self.label_role, False, True, 0)
36+ hbox = Gtk.HBox()
37+ hbox.set_spacing(12)
38 vbox_progress = Gtk.VBox()
39 vbox_progress.set_spacing(6)
40+ align = Gtk.Alignment()
41+ align.set(0.0, 0.5, 1.0, 0.5)
42 self.progress = AptProgressBar()
43- vbox_progress.pack_start(self.progress, False, True, 0)
44+ align.add(self.progress)
45+ hbox.pack_start(align, True, True, 0)
46+ self.button_cancel = AptCancelButton(transaction)
47+ hbox.pack_start(self.button_cancel, False, False, 0)
48+ vbox_progress.pack_start(hbox, False, True, 0)
49 self.label = AptStatusLabel()
50 self.label._on_status_changed(None, STATUS_WAITING)
51 vbox_progress.pack_start(self.label, False, True, 0)
52 vbox.pack_start(vbox_progress, False, True, 0)
53- hbox.pack_start(vbox, True, True, 0)
54 self.expander = AptDetailsExpander(terminal=terminal)
55 self.expander.connect("notify::expanded", self._on_expanded)
56 vbox.pack_start(self.expander, True, True, 0)
57- self.get_content_area().pack_start(hbox, True, True, 0)
58+ self.get_content_area().pack_start(vbox, True, True, 0)
59 self._transaction = None
60 self._signals = []
61 self.set_title("")
62 self.realize()
63 self.progress.set_size_request(350, -1)
64- functions = Gdk.WMFunction.MOVE|Gdk.WMFunction.RESIZE
65+ functions = Gdk.WMFunction.MOVE|Gdk.WMFunction.RESIZE|Gdk.WMFunction.MINIMIZE
66 try:
67 self.get_window().set_functions(functions)
68 except TypeError:
69@@ -685,8 +688,10 @@
70 def _on_role_changed(self, transaction, role_enum):
71 """Show the role of the transaction in the dialog interface"""
72 role = get_role_localised_present_from_enum(role_enum)
73- self.set_title(role)
74- self.label_role.set_markup("<big><b>%s</b></big>" % role)
75+ if not self.get_title():
76+ self.set_title(role)
77+ if self.custom_label is None:
78+ self.label_role.set_markup("<big><b>%s</b></big>" % role)
79
80 def set_transaction(self, transaction):
81 """Connect the dialog to the given aptdaemon transaction"""
82@@ -703,7 +708,6 @@
83 self._on_config_file_conflict))
84 self._on_role_changed(transaction, transaction.role)
85 self.progress.set_transaction(transaction)
86- self.icon.set_transaction(transaction)
87 self.label.set_transaction(transaction)
88 self.expander.set_transaction(transaction)
89 self._transaction = transaction
90@@ -735,6 +739,10 @@
91 err_dia.hide()
92 self.emit("finished")
93
94+ def set_show_details(self, show_details):
95+ self.expander.set_no_show_all(not show_details)
96+ self.expander.set_visible(show_details)
97+
98
99 class _ExpandableDialog(Gtk.Dialog):
100
101
102=== modified file 'aptdaemon/gtkwidgets.py'
103--- aptdaemon/gtkwidgets.py 2012-05-08 18:50:57 +0000
104+++ aptdaemon/gtkwidgets.py 2012-06-06 18:57:18 +0000
105@@ -535,48 +535,51 @@
106 gobject.TYPE_NONE, ())}
107
108 def __init__(self, transaction=None, parent=None, terminal=True,
109- debconf=True):
110+ debconf=True, label=None):
111 gtk.Dialog.__init__(self, buttons=None, parent=parent)
112 self._expanded_size = None
113 self.debconf = debconf
114+ self.custom_label = label
115 # Setup the dialog
116 self.set_border_width(6)
117 self.set_has_separator(False)
118 self.set_resizable(False)
119 self.vbox.set_spacing(6)
120- # Setup the cancel button
121- self.button_cancel = AptCancelButton(transaction)
122- self.action_area.pack_start(self.button_cancel, False, False, 0)
123- # Setup the status icon, label and progressbar
124- hbox = gtk.HBox()
125- hbox.set_spacing(12)
126- hbox.set_border_width(6)
127- self.icon = AptRoleIcon()
128- hbox.pack_start(self.icon, False, True, 0)
129+ # Setup the label, progressbar, and cancel button
130 vbox = gtk.VBox()
131 vbox.set_spacing(12)
132+ vbox.set_border_width(6)
133 self.label_role = gtk.Label()
134 self.label_role.set_alignment(0, 0)
135+ if self.custom_label:
136+ self.label_role.set_markup("<big><b>%s</b></big>" % self.custom_label)
137 vbox.pack_start(self.label_role, False, True, 0)
138 vbox_progress = gtk.VBox()
139+ hbox = gtk.HBox()
140+ hbox.set_spacing(12)
141 vbox_progress.set_spacing(6)
142+ align = gtk.Alignment()
143+ align.set(0.0, 0.5, 1.0, 0.5)
144 self.progress = AptProgressBar()
145- vbox_progress.pack_start(self.progress, False, True, 0)
146+ align.add(self.progress)
147+ hbox.pack_start(align, True, True, 0)
148+ self.button_cancel = AptCancelButton(transaction)
149+ hbox.pack_start(self.button_cancel, False, False, 0)
150+ vbox_progress.pack_start(hbox, False, True, 0)
151 self.label = AptStatusLabel()
152 self.label._on_status_changed(None, STATUS_WAITING)
153 vbox_progress.pack_start(self.label, False, True, 0)
154 vbox.pack_start(vbox_progress, False, True, 0)
155- hbox.pack_start(vbox, True, True, 0)
156 self.expander = AptDetailsExpander(terminal=terminal)
157 self.expander.connect("notify::expanded", self._on_expanded)
158 vbox.pack_start(self.expander, True, True, 0)
159- self.vbox.pack_start(hbox, True, True, 0)
160+ self.vbox.pack_start(vbox, True, True, 0)
161 self._transaction = None
162 self._signals = []
163 self.set_title("")
164 self.realize()
165 self.progress.set_size_request(350, -1)
166- self.window.set_functions(gtk.gdk.FUNC_MOVE|gtk.gdk.FUNC_RESIZE)
167+ self.window.set_functions(gtk.gdk.FUNC_MOVE|gtk.gdk.FUNC_RESIZE|gtk.gdk.FUNC_MINIMIZE)
168 if transaction != None:
169 self.set_transaction(transaction)
170 # catch ESC and behave as if cancel was clicked
171@@ -640,8 +643,10 @@
172 def _on_role_changed(self, transaction, role_enum):
173 """Show the role of the transaction in the dialog interface"""
174 role = get_role_localised_present_from_enum(role_enum)
175- self.set_title(role)
176- self.label_role.set_markup("<big><b>%s</b></big>" % role)
177+ if not self.get_title():
178+ self.set_title(role)
179+ if self.custom_label is None:
180+ self.label_role.set_markup("<big><b>%s</b></big>" % role)
181
182 def set_transaction(self, transaction):
183 """Connect the dialog to the given aptdaemon transaction"""
184@@ -656,7 +661,6 @@
185 self._on_config_file_conflict))
186 self._on_role_changed(transaction, transaction.role)
187 self.progress.set_transaction(transaction)
188- self.icon.set_transaction(transaction)
189 self.label.set_transaction(transaction)
190 self.expander.set_transaction(transaction)
191 self._transaction = transaction
192@@ -688,6 +692,10 @@
193 err_dia.hide()
194 self.emit("finished")
195
196+ def set_show_details(self, show_details):
197+ self.expander.set_no_show_all(not show_details)
198+ self.expander.set_visible(show_details)
199+
200
201 class _ExpandableDialog(gtk.Dialog):
202

Subscribers

People subscribed via source and target branches

to status/vote changes: