From ba4b03ba98cf009b41c576e2b0151821288972f8 Mon Sep 17 00:00:00 2001 From: David Lehman Date: Fri, 1 Feb 2008 12:35:41 -0600 Subject: Add dialogs to prompt for passphrases of existing encrypted partitions. As a convenience, a checkbox allows the user to indicate that the passphrase they are entering should also be used to access all subsequently discovered encrypted devices. --- text.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'text.py') diff --git a/text.py b/text.py index 6238be458..000c4d836 100644 --- a/text.py +++ b/text.py @@ -269,6 +269,45 @@ class MainExceptionWindow: self.screen.popWindow() self.screen.refresh() +class PassphraseEntryWindow: + def __init__(self, screen, device): + self.screen = screen + self.txt = _("Partition %s is encrypted. In order to " + "access the partition's contents during " + "installation you must enter the device's " + "passphrase below.") % (device,) + self.rc = None + + def run(self): + toplevel = GridForm(self.screen, _("Passphrase"), 1, 4) + + txt = TextboxReflowed(65, self.txt) + toplevel.add(txt, 0, 0) + + passphraseentry = Entry(128, password = 1) + toplevel.add(passphraseentry, 0, 1, (0,0,0,1)) + + globalcheckbox = Checkbox(_("This is a global passphrase")) + toplevel.add(globalcheckbox, 0, 2) + + buttons = ButtonBar(self.screen, [TEXT_OK_BUTTON, TEXT_CANCEL_BUTTON]) + toplevel.add(buttons, 0, 3, growx=1) + + rc = toplevel.run() + res = buttons.buttonPressed(rc) + + passphrase = None + isglobal = False + if res == TEXT_OK_CHECK: + passphrase = passphraseentry.value().strip() + isglobal = globalcheckbox.selected() + + self.rc = (passphrase, isglobal) + return self.rc + + def pop(self): + self.screen.popWindow() + class InstallInterface: def helpWindow(self, screen, key): if key == "helponhelp": @@ -409,6 +448,12 @@ class InstallInterface: r.strip() return r + def passphraseEntryWindow(self, device): + w = PassphraseEntryWindow(self.screen, device) + (passphrase, isglobal) = w.run() + w.pop() + return (passphrase, isglobal) + def getInstallKey(self, anaconda, key = ""): ic = anaconda.id.instClass keyname = _(ic.instkeyname) -- cgit