From 60ae69dd79fc4a17e54e9f898b04c7130d8b9f6e Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 22 Nov 2012 06:26:02 +0900 Subject: fix widgets focus on providerselect page it works with enter, enter, enter :) dedicated to DJ Focus... --- src/leap/gui/firstrun/login.py | 1 + src/leap/gui/firstrun/providerselect.py | 13 ++++++++++--- src/leap/gui/progress.py | 4 +++- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src') 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) -- cgit v1.2.3