[PATCH2, missing piece] Set progress bar to 100 % in a different way (#1058755)

Vratislav Podzimek vpodzime at redhat.com
Thu Jan 30 13:02:55 UTC 2014


For some reason (don't ask me why), setting the progress bar's fraction in the
gtk_action_nowait decorated function sometimes doesn't make the change
graphically effective. If you ask progress bar to give you it's current
fraction, it returns 1.0, but graphically stays at the previous value. Using
gtk_call_once works.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/ui/gui/hubs/progress.py | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/pyanaconda/ui/gui/hubs/progress.py b/pyanaconda/ui/gui/hubs/progress.py
index facbd2f..d1650d5 100644
--- a/pyanaconda/ui/gui/hubs/progress.py
+++ b/pyanaconda/ui/gui/hubs/progress.py
@@ -100,15 +100,19 @@ class ProgressHub(Hub):
             elif code == progressQ.PROGRESS_CODE_MESSAGE:
                 self._update_progress_message(args[0])
             elif code == progressQ.PROGRESS_CODE_COMPLETE:
-                # There shouldn't be any more progress bar updates, so return False
-                # to indicate this method should be removed from the idle loop.  Also,
-                # stop the rnotes cycling and display the finished message.
-                self._progress_bar_complete()
                 q.task_done()
 
+                # we are done, stop the progress indication
+                gtk_call_once(self._progressBar.set_fraction, 1.0)
+                gtk_call_once(self._progressLabel.set_text, _("Complete!"))
+                gtk_call_once(self._spinner.stop)
+                gtk_call_once(self._spinner.hide)
+
                 if callback:
                     callback()
 
+                # There shouldn't be any more progress bar updates, so return False
+                # to indicate this method should be removed from the idle loop.
                 return False
             elif code == progressQ.PROGRESS_CODE_QUIT:
                 sys.exit(args[0])
@@ -279,11 +283,3 @@ class ProgressHub(Hub):
     def _restart_spinner(self):
         self._spinner.show()
         self._spinner.start()
-
-    @gtk_action_nowait
-    def _progress_bar_complete(self):
-        self._progressBar.set_fraction(1.0)
-        self._progressLabel.set_text(_("Complete!"))
-
-        self._spinner.stop()
-        self._spinner.hide()
-- 
1.8.5.3



More information about the anaconda-patches mailing list