summaryrefslogtreecommitdiff
path: root/src/leap/gui
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-06-05 10:53:38 -0300
committerTomás Touceda <chiiph@leap.se>2013-06-05 10:53:38 -0300
commitf5a8124dc7d2bfef3b5caaac0ba720875cd6932b (patch)
treedeb24143ef5bf645dd6356e01f3486c49be8e914 /src/leap/gui
parentba95cf448fa5ef3261e011921450ab4a6b13c8d6 (diff)
parentcc247f63441a8d434bc509ea2764f7969ad47fec (diff)
Merge remote-tracking branch 'ivan/feature/qa-texts-and-registration-form' into develop
Diffstat (limited to 'src/leap/gui')
-rw-r--r--src/leap/gui/ui/wizard.ui32
-rw-r--r--src/leap/gui/wizard.py33
2 files changed, 49 insertions, 16 deletions
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 @@
<string notr="true">4</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_7">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
+ <property name="leftMargin">
+ <number>4</number>
+ </property>
<item row="3" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
@@ -646,19 +652,6 @@
</property>
</spacer>
</item>
- <item row="1" column="0" colspan="3">
- <widget class="QLabel" name="lblRegisterStatus">
- <property name="text">
- <string/>
- </property>
- <property name="textFormat">
- <enum>Qt::AutoText</enum>
- </property>
- <property name="alignment">
- <set>Qt::AlignCenter</set>
- </property>
- </widget>
- </item>
<item row="7" column="1">
<spacer name="verticalSpacer_7">
<property name="orientation">
@@ -692,6 +685,19 @@
</property>
</widget>
</item>
+ <item row="1" column="1" colspan="2">
+ <widget class="QLabel" name="lblRegisterStatus">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="textFormat">
+ <enum>Qt::AutoText</enum>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<widget class="QWizardPage" name="service_selection">
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("<font color='green'>"
- "<b>User registration OK. "
- "</b></font>"))
+ user_domain = self._username + "@" + self._domain
+ message = "<font color='green'><h3>"
+ message += self.tr("User %s successfully registered.") % (
+ user_domain, )
+ message += "</h3></font>"
+ 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