summaryrefslogtreecommitdiff
path: root/src/leap/gui
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-11-22 06:26:02 +0900
committerkali <kali@leap.se>2012-11-22 06:28:24 +0900
commit60ae69dd79fc4a17e54e9f898b04c7130d8b9f6e (patch)
tree2f7f65e30d637fcb78d8780cf52f523cbc32eaa4 /src/leap/gui
parentf9a3e2cf6c4f7398411788974a2a6a9a53c9a1ab (diff)
fix widgets focus on providerselect page
it works with enter, enter, enter :) dedicated to DJ Focus...
Diffstat (limited to 'src/leap/gui')
-rw-r--r--src/leap/gui/firstrun/login.py1
-rw-r--r--src/leap/gui/firstrun/providerselect.py13
-rw-r--r--src/leap/gui/progress.py4
3 files changed, 14 insertions, 4 deletions
diff --git a/src/leap/gui/firstrun/login.py b/src/leap/gui/firstrun/login.py
index 4271c774..004fa7d4 100644
--- a/src/leap/gui/firstrun/login.py
+++ b/src/leap/gui/firstrun/login.py
@@ -139,6 +139,7 @@ class LogInPage(QtGui.QWizardPage, UserFormMixIn):
def initializePage(self):
super(LogInPage, self).initializePage()
+ # XXX setPlaceholderText instead?!
self.userNameLineEdit.setText('username@provider.example.org')
self.userNameLineEdit.cursorPositionChanged.connect(
self.onUserNameEdit)
diff --git a/src/leap/gui/firstrun/providerselect.py b/src/leap/gui/firstrun/providerselect.py
index 0250ab8c..d029b1db 100644
--- a/src/leap/gui/firstrun/providerselect.py
+++ b/src/leap/gui/firstrun/providerselect.py
@@ -61,6 +61,9 @@ class SelectProviderPage(InlineValidationPage):
self.launchChecks.connect(
self.launch_checks)
+ self.providerNameEdit.editingFinished.connect(
+ lambda: self.providerCheckButton.setFocus(True))
+
def setupUI(self):
"""
initializes the UI
@@ -94,7 +97,7 @@ class SelectProviderPage(InlineValidationPage):
validationMsg = QtGui.QLabel("")
validationMsg.setStyleSheet(styles.ErrorLabelStyleSheet)
self.validationMsg = validationMsg
- providerCheckButton = QtGui.QPushButton(self.tr("chec&k"))
+ providerCheckButton = QtGui.QPushButton(self.tr("chec&k!"))
self.providerCheckButton = providerCheckButton
# cert info
@@ -238,7 +241,6 @@ class SelectProviderPage(InlineValidationPage):
else:
return True
-
logger.debug('checking name resolution')
yield(("check name", 20), namecheck)
@@ -349,9 +351,14 @@ class SelectProviderPage(InlineValidationPage):
called after _do_checks has finished.
"""
self.domain_checked = True
+ self.completeChanged.emit()
+ # let's set focus...
if self.is_done:
self.wizard().clean_validation_error(self.current_page)
- self.completeChanged.emit()
+ nextbutton = self.wizard().button(QtGui.QWizard.NextButton)
+ nextbutton.setFocus()
+ else:
+ self.providerNameEdit.setFocus()
# cert trust verification
# (disabled for now)
diff --git a/src/leap/gui/progress.py b/src/leap/gui/progress.py
index 9a5b352c..331db6b2 100644
--- a/src/leap/gui/progress.py
+++ b/src/leap/gui/progress.py
@@ -145,6 +145,8 @@ class StepsTableWidget(QtGui.QTableWidget):
# this disables the table grid.
# we should add alignment to the ImgWidget (it's top-left now)
self.setShowGrid(False)
+ self.setFocusPolicy(QtCore.Qt.NoFocus)
+ #self.setStyleSheet("QTableView{outline: 0;}")
# XXX change image for done to rc
@@ -254,7 +256,7 @@ class WithStepsMixIn(object):
def resizeTable(self):
# resize first column to ~80%
table = self.stepsTableWidget
- FIRST_COLUMN_PERCENT = 0.75
+ FIRST_COLUMN_PERCENT = 0.70
width = table.width()
logger.debug('populate table. width=%s' % width)
table.horizontalHeader().resizeSection(0, width * FIRST_COLUMN_PERCENT)