diff options
author | Vratislav Podzimek <vpodzime@redhat.com> | 2012-10-05 19:10:44 +0200 |
---|---|---|
committer | Vratislav Podzimek <vpodzime@redhat.com> | 2012-10-12 15:46:48 +0200 |
commit | ce80cc79661ca7afa6ea1d354a99a29d41229a0b (patch) | |
tree | 816dfe862507ce22d0b7cd5d5006abe52bc1a08d | |
parent | 4b98eab34f310c2704ec24b417bdf919c413fa1d (diff) | |
download | anaconda-ce80cc79661ca7afa6ea1d354a99a29d41229a0b.tar.gz anaconda-ce80cc79661ca7afa6ea1d354a99a29d41229a0b.tar.xz anaconda-ce80cc79661ca7afa6ea1d354a99a29d41229a0b.zip |
Check X layouts specified in kickstart for validity
If we are given invalid X layouts (not supported), we have to remove them
from the list. If none are left in the list, we should act like if there
was none specified at all and add our defaults.
-rwxr-xr-x | pyanaconda/keyboard.py | 5 | ||||
-rw-r--r-- | pyanaconda/ui/gui/spokes/welcome.py | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py index f4f4f7587..1350ecc74 100755 --- a/pyanaconda/keyboard.py +++ b/pyanaconda/keyboard.py @@ -420,6 +420,11 @@ class XklWrapper(object): return groups_names[state.group] + def is_valid_layout(self, layout): + """Return if given layout is valid layout or not""" + + return layout in self.name_to_show_str + def add_layout(self, layout): """ Method that tries to add a given layout to the current X configuration. diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py index 3fa3a63e2..95f24ef6c 100644 --- a/pyanaconda/ui/gui/spokes/welcome.py +++ b/pyanaconda/ui/gui/spokes/welcome.py @@ -64,6 +64,14 @@ class LanguageMixIn(object): if lang_timezone: self.data.timezone.timezone = lang_timezone + #remove all X layouts that are not valid X layouts (unsupported) + #from the ksdata + #XXX: could go somewhere else, but we need X running and we have + # XklWrapper instance here + for layout in self.data.keyboard.x_layouts: + if not self._xklwrapper.is_valid_layout(layout): + self.data.keyboard.x_layouts.remove(layout) + if self.data.keyboard.x_layouts: #do not add layouts if there are any specified in the kickstart return |