summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2008-08-04 15:54:43 -1000
committerDavid Cantrell <dcantrell@redhat.com>2008-08-04 15:54:43 -1000
commita892b510ef08094392d969c85b9b46cea7550300 (patch)
tree632e53c245d3b610e475ef8518eb0f32a0ff778c /iw
parenta219501c944d34e6587b65b0f2142e80f7055d4d (diff)
downloadanaconda-a892b510ef08094392d969c85b9b46cea7550300.tar.gz
anaconda-a892b510ef08094392d969c85b9b46cea7550300.tar.xz
anaconda-a892b510ef08094392d969c85b9b46cea7550300.zip
Display capslock status correctly (#442258)
On the root password screen, display the status of the caps lock key correctly. The state is shown when the screen initially loads, rather than assuming it is off. The toggle also verifies the key state rather than just switching messages back and forth.
Diffstat (limited to 'iw')
-rw-r--r--iw/account_gui.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/iw/account_gui.py b/iw/account_gui.py
index d44bd0ce2..0bbf79498 100644
--- a/iw/account_gui.py
+++ b/iw/account_gui.py
@@ -26,6 +26,7 @@ from iw_gui import *
from flags import flags
from constants import *
import cracklib
+import _isys
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -72,6 +73,9 @@ class AccountWindow (InstallWindow):
self.confirm.connect("activate", lambda widget,
vbox=vbox: self.ics.setGrabNext(1))
+ # set initial caps lock label text
+ self.setCapsLockLabel()
+
return self.align
def setFocus(self, area, data):
@@ -86,11 +90,14 @@ class AccountWindow (InstallWindow):
def handleCapsLockRelease(self, window, event, label):
if event.keyval == gtk.keysyms.Caps_Lock and \
event.state & gtk.gdk.LOCK_MASK:
- if label.get_text() == "":
- label.set_text("<b>" + _("Caps Lock is on.") + "</b>")
- label.set_use_markup(True)
- else:
- label.set_text("")
+ self.setCapsLockLabel()
+
+ def setCapsLockLabel(self):
+ if _isys.isCapsLockEnabled():
+ self.capslock.set_text("<b>" + _("Caps Lock is on.") + "</b>")
+ self.capslock.set_use_markup(True)
+ else:
+ self.capslock.set_text("")
def getNext (self):
pw = self.pw.get_text()