summaryrefslogtreecommitdiff
path: root/src/leap/gui
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-05 07:00:42 +0900
committerkali <kali@leap.se>2012-10-05 07:00:42 +0900
commitb9d1b57976984d1032b3abc810f462a80fdc55aa (patch)
tree83603b14695aa09569496314892d567f88f632cc /src/leap/gui
parenta92ea6fcc5e2e10c6df6d41b52a5d98044317eba (diff)
focus fix for wizard
Diffstat (limited to 'src/leap/gui')
-rwxr-xr-xsrc/leap/gui/firstrunwizard.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/leap/gui/firstrunwizard.py b/src/leap/gui/firstrunwizard.py
index b93dc8e9..cc70daab 100755
--- a/src/leap/gui/firstrunwizard.py
+++ b/src/leap/gui/firstrunwizard.py
@@ -88,8 +88,11 @@ QLabel { color: red;
class FirstRunWizard(QtGui.QWizard):
def __init__(self, parent=None, providers=None, success_cb=None):
- super(FirstRunWizard, self).__init__(parent)
+ super(FirstRunWizard, self).__init__(
+ parent,
+ QtCore.Qt.WindowStaysOnTopHint)
+ # XXX hardcoded for tests
if not providers:
providers = ('springbok',)
self.providers = providers
@@ -116,6 +119,16 @@ class FirstRunWizard(QtGui.QWizard):
# TODO: set style for MAC / windows ...
#self.setWizardStyle()
+ def setWindowFlags(self, flags):
+ logger.debug('setting window flags')
+ QtGui.QWizard.setWindowFlags(self, flags)
+
+ def focusOutEvent(self, event):
+ self.setFocus(True)
+ self.activateWindow()
+ self.raise_()
+ self.show()
+
def accept(self):
print 'chosen provider: ', self.get_provider()
print 'username: ', self.field('userName')
@@ -219,8 +232,13 @@ class RegisterUserPage(QtGui.QWizardPage):
userNameLineEdit = QtGui.QLineEdit()
userNameLineEdit.cursorPositionChanged.connect(
self.reset_validation_status)
+ userNameLabel.setBuddy(userNameLineEdit)
+ # TODO
+ # add validator
+ # usernameRe = QRegexp(r"[]")
+ # userNameLineEdit.setValidator(
+ # QRegExpValidator(usernameRe, self))
self.userNameLineEdit = userNameLineEdit
- userNameLabel.setBuddy(self.userNameLineEdit)
userPasswordLabel = QtGui.QLabel("&Password:")
self.userPasswordLineEdit = QtGui.QLineEdit()