[PATCH] Don't rely on selection staying selected when doing crazy things to it

Vratislav Podzimek vpodzime at redhat.com
Wed Aug 22 12:12:10 UTC 2012


LanguageSpoke inherits from the LanguageMixIn which is also used by the
WelcomeLanguageSpoke and contains the treeview with available languages and the
selection object. Obviously the selection doesn't stay selected when
WelcomeLanguageSpoke is hidden.
So in LanguageMixIn.initialize -- if there is nothing selected, try to use
self.data.lang.lang value first and if it is None, fallback to prefered_language
(English).

Fixes the issue with no translations and default language selected on the
SummaryHub before going to LanguageSpoke and back.
---
 pyanaconda/ui/gui/spokes/welcome.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
index dc4c733..7982e23 100644
--- a/pyanaconda/ui/gui/spokes/welcome.py
+++ b/pyanaconda/ui/gui/spokes/welcome.py
@@ -106,7 +106,9 @@ class LanguageMixIn(object):
         # select the preferred translation if there wasn't any
         (store, itr) = self._selection.get_selected()
         if not itr:
-            self._selectLanguage(store, self.language.preferred_translation.short_name)
+            lang = self.data.lang.lang or \
+                   self.language.preferred_translation.short_name
+            self._selectLanguage(store, lang)
 
 
     def retranslate(self):
-- 
1.7.11.2



More information about the anaconda-patches mailing list