diff options
| author | Ales Kozumplik <akozumpl@redhat.com> | 2011-02-10 15:50:59 +0100 |
|---|---|---|
| committer | Ales Kozumplik <akozumpl@redhat.com> | 2011-02-10 16:41:42 +0100 |
| commit | bce30a79371b9f7e238fb5159b2358a60e5aa576 (patch) | |
| tree | 44df594e3e1fbff0b13f19e035bd4ef2b8154bbd | |
| parent | 611a221f9bac6d14e498037efdcce5749f4e9c67 (diff) | |
| download | anaconda-bce30a79371b9f7e238fb5159b2358a60e5aa576.tar.gz anaconda-bce30a79371b9f7e238fb5159b2358a60e5aa576.tar.xz anaconda-bce30a79371b9f7e238fb5159b2358a60e5aa576.zip | |
tui: add reinitializeWindow() to the text interface.
Also defines the method for cmdline.py (where it just fails the
installation because no questions are allowed there).
Resolves: rhbz#675955
| -rw-r--r-- | pyanaconda/cmdline.py | 9 | ||||
| -rw-r--r-- | pyanaconda/text.py | 21 | ||||
| -rw-r--r-- | pyanaconda/textw/constants_text.py | 16 |
3 files changed, 46 insertions, 0 deletions
diff --git a/pyanaconda/cmdline.py b/pyanaconda/cmdline.py index 1034479bf..4559513bd 100644 --- a/pyanaconda/cmdline.py +++ b/pyanaconda/cmdline.py @@ -73,6 +73,15 @@ class InstallInterface(InstallInterfaceBase): def __del__(self): pass + def reinitializeWindow(self, title, path, size, description): + print(_("Command line mode requires all choices to be specified in a " + "kickstart configuration file.")) + print(title) + + # don't exit + while 1: + time.sleep(5) + def shutdown(self): pass diff --git a/pyanaconda/text.py b/pyanaconda/text.py index f566aaf42..86ae5e46e 100644 --- a/pyanaconda/text.py +++ b/pyanaconda/text.py @@ -263,6 +263,27 @@ class InstallInterface(InstallInterfaceBase): def progressWindow(self, title, text, total, updpct = 0.05, pulse = False): return ProgressWindow(self.screen, title, text, total, updpct, pulse) + def reinitializeWindow(self, title, path, size, description): + grid = GridForm(self.screen, title, 1, 3) + text = TEXT_REINITIALIZE % (description, size, path) + grid.add(TextboxReflowed(70, text), 0, 0) + + all_devices_cb = Checkbox(TEXT_REINITIALIZE_ALL, isOn=False) + grid.add(all_devices_cb, 0, 1, padding=(0, 1, 0, 0)) + + buttons = [(_("Yes, discard any data"), "yes"), + (_("No, keep any data"), "no")] + grid.buttons = ButtonBar(self.screen, buttons) + grid.add(grid.buttons, 0, 2, padding=(0, 1, 0, 0)) + + result = grid.run() + button_check = grid.buttons.buttonPressed(result) + self.screen.popWindow() + rc = 2 if button_check == "yes" else 0 + if all_devices_cb.selected(): + rc += 1 + return rc + def setInstallProgressClass(self, c): self.instProgress = c diff --git a/pyanaconda/textw/constants_text.py b/pyanaconda/textw/constants_text.py index b77cadaaf..d11b6844d 100644 --- a/pyanaconda/textw/constants_text.py +++ b/pyanaconda/textw/constants_text.py @@ -70,3 +70,19 @@ TEXT_RETRY_CHECK = "retry" TEXT_RETRY_BUTTON = Translator(TEXT_RETRY_STR, TEXT_RETRY_CHECK) TEXT_F12_CHECK = "F12" + +TEXT_REINITIALIZE = _( +"""This storage device may contain data: + +%s, %s MB, %s + +We could not detect partitions or filesystems on this device. This could be \ +because the device is blank, unpartitioned, or virtual. If not, there may be \ +data on the device that can not be recovered if you use it in this \ +installation. We can remove the device from this installation to protect the \ +data. + +Are you sure this device does not contain valuable data?""") + +TEXT_REINITIALIZE_ALL = _(\ + "Apply my choice to all devices with undetected partitions.") |
