Merge lp:~evfool/software-center/lp844768 into lp:software-center/5.2

Proposed by Robert Roth
Status: Merged
Merged at revision: 3011
Proposed branch: lp:~evfool/software-center/lp844768
Merge into: lp:software-center/5.2
Diff against target: 33 lines (+6/-1)
1 file modified
softwarecenter/ui/gtk3/models/pendingstore.py (+6/-1)
To merge this branch: bzr merge lp:~evfool/software-center/lp844768
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Review via email: mp+105549@code.launchpad.net

Description of the change

Switch to indeterminate progressbar (as the one shown while purchasing) while transactions are in waiting state (e.g. waiting to close synaptic, or waiting for user input) as requested in bug #844768.

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

Thanks, this looks great. I changed the "-1", "+1" for the pulse to symbolic constants during the merge
to make it slightly easier to read. But thats just a minor detail :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'softwarecenter/ui/gtk3/models/pendingstore.py'
--- softwarecenter/ui/gtk3/models/pendingstore.py 2012-03-15 01:32:28 +0000
+++ softwarecenter/ui/gtk3/models/pendingstore.py 2012-05-12 05:33:19 +0000
@@ -127,14 +127,17 @@
127 else:127 else:
128 icon = get_icon_from_theme(self.icons, iconname=iconname,128 icon = get_icon_from_theme(self.icons, iconname=iconname,
129 iconsize=self.ICON_SIZE)129 iconsize=self.ICON_SIZE)
130 pulse = -1
131 # if transaction is waiting, switch to indeterminate progress
130 if trans.is_waiting():132 if trans.is_waiting():
131 status = trans.status_details133 status = trans.status_details
134 pulse = 1
132 else:135 else:
133 status = trans.get_status_description()136 status = trans.get_status_description()
134 status_text = self._render_status_text(appname, status)137 status_text = self._render_status_text(appname, status)
135 cancel_icon = self._get_cancel_icon(trans.cancellable)138 cancel_icon = self._get_cancel_icon(trans.cancellable)
136 self.append([trans.tid, icon, appname, status_text,139 self.append([trans.tid, icon, appname, status_text,
137 float(trans.progress), -1, cancel_icon])140 float(trans.progress), pulse, cancel_icon])
138141
139 def _on_cancellable_changed(self, trans, cancellable):142 def _on_cancellable_changed(self, trans, cancellable):
140 #print "_on_allow_cancel: ", trans, allow_cancel143 #print "_on_allow_cancel: ", trans, allow_cancel
@@ -185,8 +188,10 @@
185 name = row[self.COL_NAME]188 name = row[self.COL_NAME]
186 if trans.is_waiting():189 if trans.is_waiting():
187 st = trans.status_details190 st = trans.status_details
191 row[self.COL_PULSE] = 1
188 else:192 else:
189 st = trans.get_status_description(status)193 st = trans.get_status_description(status)
194 row[self.COL_PULSE] = -1
190 row[self.COL_STATUS] = self._render_status_text(name, st)195 row[self.COL_STATUS] = self._render_status_text(name, st)
191196
192 def _render_status_text(self, name, status):197 def _render_status_text(self, name, status):

Subscribers

People subscribed via source and target branches