summaryrefslogtreecommitdiffstats
path: root/gui.py
diff options
context:
space:
mode:
authordlehman <dlehman>2007-02-23 18:18:25 +0000
committerdlehman <dlehman>2007-02-23 18:18:25 +0000
commit985008e8e3f327da0334c76b4249f9a09c5c8228 (patch)
tree489b46ccc0bd37c54978c47ff1e1ef2c4843cf59 /gui.py
parentf500e8abdeac651436de6a953be773d5d957d57a (diff)
downloadanaconda-985008e8e3f327da0334c76b4249f9a09c5c8228.tar.gz
anaconda-985008e8e3f327da0334c76b4249f9a09c5c8228.tar.xz
anaconda-985008e8e3f327da0334c76b4249f9a09c5c8228.zip
* yuminstall.py (selectBestKernel): actually select kernel-xen-devel
when we say we're going to (#226784) * iw/autopart_type.py (PartitionTypeWindow.getScreen): desensitize review checkbox if we're headed backwards and the current selection is custom (#220951) * gui.py: add class InstallKeyWindow and InstallInterface method getInstallKey * text.py: add getInstallKey method * ui/instkey.glade: instkey dialog (new file)
Diffstat (limited to 'gui.py')
-rwxr-xr-xgui.py61
1 files changed, 61 insertions, 0 deletions
diff --git a/gui.py b/gui.py
index 84fcabb00..b24250b23 100755
--- a/gui.py
+++ b/gui.py
@@ -588,6 +588,57 @@ class ScpWindow:
def pop(self):
self.window.destroy()
+class InstallKeyWindow:
+ def __init__(self, anaconda, key):
+ (keyxml, self.win) = getGladeWidget("instkey.glade", "instkeyDialog")
+ if anaconda.id.instClass.instkeydesc is not None:
+ w = keyxml.get_widget("instkeyLabel")
+ w.set_text(_(anaconda.id.instClass.instkeydesc))
+
+ if not anaconda.id.instClass.allowinstkeyskip:
+ keyxml.get_widget("skipRadio").hide()
+
+ keyName = _(anaconda.id.instClass.instkeyname)
+ if anaconda.id.instClass.instkeyname is None:
+ keyName = _("Installation Key")
+
+ # set the install key name based on the installclass
+ for l in ("instkeyLabel", "keyEntryLabel", "skipLabel"):
+ w = keyxml.get_widget(l)
+ t = w.get_text()
+ w.set_text(t % {"instkey": keyName})
+
+ self.entry = keyxml.get_widget("keyEntry")
+ self.entry.set_text(key)
+ self.entry.set_sensitive(True)
+
+ self.keyradio = keyxml.get_widget("keyRadio")
+ self.skipradio = keyxml.get_widget("skipRadio")
+ self.rc = 0
+
+ if anaconda.id.instClass.skipkey:
+ self.skipradio.set_active(True)
+ else:
+ self.entry.grab_focus()
+
+ addFrame(self.win, title=keyName)
+
+ def run(self):
+ self.win.show()
+ self.rc = self.win.run()
+ return self.rc
+
+ def get_key(self):
+ if self.skipradio.get_active():
+ return SKIP_KEY
+ key = self.entry.get_text()
+ key.strip()
+ return key
+
+ def destroy(self):
+ self.win.destroy()
+
+
class ExceptionWindow:
def __init__ (self, shortTraceback, longTracebackFile=None, screen=None):
# Get a bunch of widgets from the XML file.
@@ -888,6 +939,16 @@ class InstallInterface:
def scpWindow(self):
return ScpWindow()
+ def getInstallKey(self, anaconda, key = ""):
+ d = InstallKeyWindow(anaconda, key)
+ rc = d.run()
+ if rc == gtk.RESPONSE_CANCEL:
+ ret = None
+ else:
+ ret = d.get_key()
+ d.destroy()
+ return ret
+
def beep(self):
gtk.gdk.beep()