diff options
author | Erik Troan <ewt@redhat.com> | 2001-06-20 02:00:44 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 2001-06-20 02:00:44 +0000 |
commit | 1a0247090d0d3629a9cd150d63597f94c4f27fad (patch) | |
tree | 1508f8237c8e7fb62f187706bfc5173df8819236 /textw/keyboard_text.py | |
parent | dbb4861e176cadfb14c48313fd9922d3dbfcefed (diff) | |
download | anaconda-1a0247090d0d3629a9cd150d63597f94c4f27fad.tar.gz anaconda-1a0247090d0d3629a9cd150d63597f94c4f27fad.tar.xz anaconda-1a0247090d0d3629a9cd150d63597f94c4f27fad.zip |
merge from (now defunct) anaconda-dispatch branch
Diffstat (limited to 'textw/keyboard_text.py')
-rw-r--r-- | textw/keyboard_text.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/textw/keyboard_text.py b/textw/keyboard_text.py new file mode 100644 index 000000000..57ed00f6b --- /dev/null +++ b/textw/keyboard_text.py @@ -0,0 +1,45 @@ +from snack import * +from constants_text import * +from translate import _ +import isys +from log import * +from flags import flags + +class KeyboardWindow: + beenRun = 0 + + def __call__(self, screen, instLang, kbd): + if flags.serial: + return INSTALL_NOOP + keyboards = kbd.available () + keyboards.sort () + + if self.beenRun: + default = kbd.get () + else: + default = instLang.getDefaultKeyboard() + + (button, choice) = \ + ListboxChoiceWindow(screen, _("Keyboard Selection"), + _("Which model keyboard is attached to this computer?"), keyboards, + buttons = [TEXT_OK_BUTTON, TEXT_BACK_BUTTON], width = 30, scroll = 1, height = 8, + default = default, help = "kybd") + + if button == TEXT_BACK_CHECK: + return INSTALL_BACK + + kbd.set (keyboards[choice]) + self.beenRun = 1 + + # XXX + #if todo.reconfigOnly: + #iutil.execWithRedirect ("/bin/loadkeys", + #["/bin/loadkeys", keyboards[choice]], + #stderr = "/dev/null") + + try: + isys.loadKeymap(keyboards[choice]) + except SystemError, (errno, msg): + log("Could not install keymap %s: %s" % (keyboards[choice], msg)) + return INSTALL_OK + |