diff options
author | Vratislav Podzimek <vpodzime@redhat.com> | 2012-08-22 14:03:12 +0200 |
---|---|---|
committer | Vratislav Podzimek <vpodzime@redhat.com> | 2012-08-22 19:53:27 +0200 |
commit | 7219e203298715fee898f43d82a37fa1b91e9f55 (patch) | |
tree | 3ee4cbb20404000050e23e1622873b77704d503b /pyanaconda | |
parent | f6fdcdf7da70d06d52ae037f7ba269444e0318f8 (diff) | |
download | anaconda-7219e203298715fee898f43d82a37fa1b91e9f55.tar.gz anaconda-7219e203298715fee898f43d82a37fa1b91e9f55.tar.xz anaconda-7219e203298715fee898f43d82a37fa1b91e9f55.zip |
Don't rely on selection staying selected when doing crazy things to it
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.
Diffstat (limited to 'pyanaconda')
-rw-r--r-- | pyanaconda/ui/gui/spokes/welcome.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py index dc4c733ce..7982e2361 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): |