diff options
author | Chris Lumens <clumens@redhat.com> | 2009-08-20 15:16:54 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2009-08-20 15:35:50 -0400 |
commit | 3e102bc0a7ffd3ca4eb5cff354688732f443f872 (patch) | |
tree | 3d4ee77b8c83eaa39f9fdb5bbed98b06b29f0e57 | |
parent | 162c92b4838f9769f39b0c3a85f9c6e4a38a5913 (diff) | |
download | anaconda-3e102bc0a7ffd3ca4eb5cff354688732f443f872.tar.gz anaconda-3e102bc0a7ffd3ca4eb5cff354688732f443f872.tar.xz anaconda-3e102bc0a7ffd3ca4eb5cff354688732f443f872.zip |
Fix focus grabbing on both the password and hostname screens.
Since we have the Next button grab focus immediately before drawing then
screens, we'd been relying on a complicated system of GTK signals to do
the job but that only ever worked part of the time. Instead, add a focus()
method to InstallWindow that screens can override and will set the focus
to the correct widget.
-rwxr-xr-x | gui.py | 2 | ||||
-rw-r--r-- | iw/account_gui.py | 9 | ||||
-rw-r--r-- | iw/iw_gui.py | 3 | ||||
-rw-r--r-- | iw/network_gui.py | 5 |
4 files changed, 10 insertions, 9 deletions
@@ -1291,6 +1291,8 @@ class InstallControlWindow: self.installFrame.add(new_screen) self.installFrame.show_all() + self.currentWindow.focus() + self.handle = gobject.idle_add(self.handleRenderCallback) if self.reloadRcQueued: diff --git a/iw/account_gui.py b/iw/account_gui.py index c18d6b67a..4ff9c957b 100644 --- a/iw/account_gui.py +++ b/iw/account_gui.py @@ -63,13 +63,8 @@ class AccountWindow (InstallWindow): self.pw.set_text(self.rootPassword['password']) self.confirm.set_text(self.rootPassword['password']) - # make sure pw has the focus when we enter the screen - vbox = self.xml.get_widget("account_box") - self.pw.connect("activate", lambda widget, - vbox=vbox: vbox.emit("focus", gtk.DIR_TAB_FORWARD)) - self.pw.connect("map-event", self.setFocus) - # pressing Enter in confirm == clicking Next + vbox = self.xml.get_widget("account_box") self.confirm.connect("activate", lambda widget, vbox=vbox: self.ics.setGrabNext(1)) @@ -78,7 +73,7 @@ class AccountWindow (InstallWindow): return self.align - def setFocus(self, area, data): + def focus(self): self.pw.grab_focus() def passwordError(self): diff --git a/iw/iw_gui.py b/iw/iw_gui.py index 6cdeaa9fe..997a239a1 100644 --- a/iw/iw_gui.py +++ b/iw/iw_gui.py @@ -48,3 +48,6 @@ class InstallWindow: def fixUp (self): pass + + def focus(self): + pass diff --git a/iw/network_gui.py b/iw/network_gui.py index ce2c879f0..2ba129557 100644 --- a/iw/network_gui.py +++ b/iw/network_gui.py @@ -42,16 +42,17 @@ class NetworkWindow(InstallWindow): self.icon = self.xml.get_widget("icon") self.hostnameEntry = self.xml.get_widget("hostnameEntry") self.hostnameEntry.set_text(self.hostname) + + # pressing Enter in confirm == clicking Next self.hostnameEntry.connect("activate", lambda w: self.ics.setGrabNext(1)) - self.hostnameEntry.connect("map-event", self.setFocus) # load the icon gui.readImageFromFile("network.png", image=self.icon) return self.align - def setFocus(self, area, data): + def focus(self): self.hostnameEntry.grab_focus() def hostnameError(self): |