From cc247f63441a8d434bc509ea2764f7969ad47fec Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Wed, 5 Jun 2013 10:12:22 -0300 Subject: Improve wizard for registration process --- src/leap/gui/ui/wizard.ui | 32 +++++++++++++++++++------------- src/leap/gui/wizard.py | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 16 deletions(-) (limited to 'src/leap/gui') diff --git a/src/leap/gui/ui/wizard.ui b/src/leap/gui/ui/wizard.ui index 87d04194..96cf4621 100644 --- a/src/leap/gui/ui/wizard.ui +++ b/src/leap/gui/ui/wizard.ui @@ -597,6 +597,12 @@ 4 + + QLayout::SetDefaultConstraint + + + 4 + @@ -646,19 +652,6 @@ - - - - - - - Qt::AutoText - - - Qt::AlignCenter - - - @@ -692,6 +685,19 @@ + + + + + + + Qt::AutoText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + diff --git a/src/leap/gui/wizard.py b/src/leap/gui/wizard.py index 552ace50..405752ef 100644 --- a/src/leap/gui/wizard.py +++ b/src/leap/gui/wizard.py @@ -243,15 +243,42 @@ class Wizard(QtGui.QWizard): else: self.ui.btnRegister.setEnabled(True) + def _set_registration_fields_visibility(self, visible): + """ + This method hides the username and password labels and inputboxes. + + :param visible: sets the visibility of the widgets + True: widgets are visible or False: are not + :type visible: bool + """ + # username and password inputs + self.ui.lblUser.setVisible(visible) + self.ui.lblPassword.setVisible(visible) + self.ui.lblPassword2.setVisible(visible) + + # username and password labels + self.ui.label_15.setVisible(visible) + self.ui.label_16.setVisible(visible) + self.ui.label_17.setVisible(visible) + + # register button + self.ui.btnRegister.setVisible(visible) + def _registration_finished(self, ok, req): if ok: - self._set_register_status(self.tr("" - "User registration OK. " - "")) + user_domain = self._username + "@" + self._domain + message = "

" + message += self.tr("User %s successfully registered.") % ( + user_domain, ) + message += "

" + self._set_register_status(message) + self.ui.lblPassword2.clearFocus() + self._set_registration_fields_visibility(False) self.ui.chkRemember.setEnabled(True) self.page(self.REGISTER_USER_PAGE).set_completed() + self.button(QtGui.QWizard.BackButton).setEnabled(False) else: old_username = self._username self._username = None -- cgit v1.2.3