diff options
author | Mike Fulbright <msf@redhat.com> | 2001-07-02 20:56:38 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2001-07-02 20:56:38 +0000 |
commit | 985db75db893d897d72a793fff6fa83a8a52a93f (patch) | |
tree | fafae6275e0d7faa34ac154f3f9e2b958e4f7311 | |
parent | 8cedce028a159eefb9a99c758b7db57ba016420f (diff) | |
download | anaconda-985db75db893d897d72a793fff6fa83a8a52a93f.tar.gz anaconda-985db75db893d897d72a793fff6fa83a8a52a93f.tar.xz anaconda-985db75db893d897d72a793fff6fa83a8a52a93f.zip |
Fix yes/no dialog to actually work in text mode, fix GUI messageWindow to return a valid boolean value for yes/no dialog. Also fixup calls to messageWindow appropriately.
-rwxr-xr-x | gui.py | 10 | ||||
-rw-r--r-- | harddrive.py | 2 | ||||
-rw-r--r-- | iw/package_gui.py | 2 | ||||
-rw-r--r-- | iw/upgrade_swap_gui.py | 6 | ||||
-rw-r--r-- | packages.py | 2 | ||||
-rw-r--r-- | text.py | 7 | ||||
-rw-r--r-- | textw/constants_text.py | 8 |
7 files changed, 29 insertions, 8 deletions
@@ -233,7 +233,7 @@ class MessageWindow: self.rc = button def questionquit (self, button): - self.rc = button + self.rc = not button def getrc (self): return self.rc @@ -258,6 +258,11 @@ class MessageWindow: win.keyboard_grab(0) self.window.show_all () self.rc = self.window.run () + + # invert result from yes/no dialog for some reason + if type == "yesno": + self.rc = not self.rc + win.keyboard_ungrab() class InstallInterface: @@ -285,7 +290,8 @@ class InstallInterface: return self.ppw def messageWindow(self, title, text, type = "ok"): - return MessageWindow (title, text, type) + rc = MessageWindow (title, text, type).getrc() + return rc def exceptionWindow(self, title, text): print text diff --git a/harddrive.py b/harddrive.py index c82181f6f..fd8cc565c 100644 --- a/harddrive.py +++ b/harddrive.py @@ -236,7 +236,7 @@ class HardDriveInstallMethod(InstallMethod): "it was corrupted on transfer to this computer." "\n\nPress OK to continue (but installation will " "probably fail), or Cancel to exit the " - "installer (RECOMMENDED). " % file, type = "okcancel").getrc() + "installer (RECOMMENDED). " % file, type = "okcancel") if rc: import sys sys.exit(0) diff --git a/iw/package_gui.py b/iw/package_gui.py index eb3f5b4cd..f45c41e00 100644 --- a/iw/package_gui.py +++ b/iw/package_gui.py @@ -21,7 +21,7 @@ def queryUpgradeContinue(intf): "mounted. You cannot go back past this point. " "\n\n") + _( "Would you like to continue with the upgrade?"), - type = "yesno").getrc() + type = "yesno") return rc class IndividualPackageSelectionWindow (InstallWindow): diff --git a/iw/upgrade_swap_gui.py b/iw/upgrade_swap_gui.py index ffbc3f80e..e3aab9d8b 100644 --- a/iw/upgrade_swap_gui.py +++ b/iw/upgrade_swap_gui.py @@ -169,13 +169,13 @@ class UpgradeSwapWindow (InstallWindow): _("It is stongly recommended that you create a swap " "file. Failure to do so could cause the installer " "to abort abnormally. Are you sure that you wish " - "to continue?"), type = "yesno").getrc() + "to continue?"), type = "yesno") return rc def swapWrongSize(self): rc = self.intf.messageWindow(_("Warning"), _("The swap file must be between 1 and 2000 MB in size."), - type = "okcancel").getrc() + type = "okcancel") return rc def swapTooBig(self): @@ -183,5 +183,5 @@ class UpgradeSwapWindow (InstallWindow): rc = self.intf.messageWindow(_("Warning"), _("There is not enough space on the device you " "selected for the swap partition."), - type = "okcancel").getrc() + type = "okcancel") return rc diff --git a/packages.py b/packages.py index 88bf0bd4b..fe1d8dda8 100644 --- a/packages.py +++ b/packages.py @@ -37,7 +37,7 @@ def queryUpgradeContinue(intf, dir): "mounted. You cannot go back past this point. " "\n\n") + _( "Would you like to continue with the upgrade?"), - type = "yesno").getrc() + type = "yesno") if rc == 1: sys.exit(0) @@ -238,6 +238,13 @@ class InstallInterface: if type == "ok": ButtonChoiceWindow(self.screen, _(title), _(text), buttons = [ TEXT_OK_BUTTON ]) + elif type == "yesno": + rc = ButtonChoiceWindow(self.screen, _(title), _(text), + buttons = [ TEXT_YES_BUTTON, TEXT_NO_BUTTON ]) + if rc == "yes": + return 1 + else: + return 0 else: return OkCancelWindow(self.screen, _(title), _(text)) diff --git a/textw/constants_text.py b/textw/constants_text.py index e6d946317..7176a6aa3 100644 --- a/textw/constants_text.py +++ b/textw/constants_text.py @@ -16,6 +16,14 @@ TEXT_BACK_STR = N_("Back") TEXT_BACK_CHECK = "back" TEXT_BACK_BUTTON = (TEXT_BACK_STR, TEXT_BACK_CHECK) +TEXT_YES_STR = N_("Yes") +TEXT_YES_CHECK = "yes" +TEXT_YES_BUTTON = (TEXT_YES_STR, TEXT_YES_CHECK) + +TEXT_NO_STR = N_("No") +TEXT_NO_CHECK = "no" +TEXT_NO_BUTTON = (TEXT_NO_STR, TEXT_NO_CHECK) + TEXT_F12_CHECK = "F12" |