diff options
author | David Lehman <dlehman@redhat.com> | 2008-02-01 12:35:41 -0600 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2008-02-05 10:41:23 -0600 |
commit | ba4b03ba98cf009b41c576e2b0151821288972f8 (patch) | |
tree | 21e01e81067951a28b7b895b961d5c75c18dbe13 /text.py | |
parent | cb2fef4829797c37a5784cd3f033734eb19eb128 (diff) | |
download | anaconda-ba4b03ba98cf009b41c576e2b0151821288972f8.tar.gz anaconda-ba4b03ba98cf009b41c576e2b0151821288972f8.tar.xz anaconda-ba4b03ba98cf009b41c576e2b0151821288972f8.zip |
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.
Diffstat (limited to 'text.py')
-rw-r--r-- | text.py | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -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) |