[PATCH] Fix the release notes image cycler. (#1043393)

David Shea dshea at redhat.com
Tue Dec 17 15:28:05 UTC 2013


Get the starting tab count from the GtkNotebook instead of hardcoding
the number of tabs defined in glade. Cycle through the end of the tabs
of we add instead of cutting off the last two.
---
 pyanaconda/ui/gui/hubs/progress.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/gui/hubs/progress.py b/pyanaconda/ui/gui/hubs/progress.py
index 252c38e..9fb3412 100644
--- a/pyanaconda/ui/gui/hubs/progress.py
+++ b/pyanaconda/ui/gui/hubs/progress.py
@@ -217,6 +217,8 @@ class ProgressHub(Hub):
         lbl.set_text(lbl.get_text() % productName)
 
         rnotes = self._get_rnotes()
+        # Get the start of the pages we're about to add to the notebook
+        rnotes_start = self._progressNotebook.get_n_pages()
         if rnotes:
             # Add a new page in the notebook for each ransom note image.
             for f in rnotes:
@@ -225,14 +227,15 @@ class ProgressHub(Hub):
                 self._progressNotebook.append_page(img, None)
 
             # An infinite list of the page numbers containing ransom notes images.
-            self._rnotesPages = itertools.cycle(range(2, self._progressNotebook.get_n_pages()-2))
+            self._rnotesPages = itertools.cycle(range(rnotes_start,
+                self._progressNotebook.get_n_pages()))
         else:
             # Add a blank page to the notebook and we'll just cycle to that
             # over and over again.
             blank = Gtk.Box()
             blank.show()
             self._progressNotebook.append_page(blank, None)
-            self._rnotesPages = itertools.cycle([2])
+            self._rnotesPages = itertools.cycle([rnotes_start])
 
     def refresh(self):
         from pyanaconda.install import doInstall
-- 
1.8.4.2



More information about the anaconda-patches mailing list