summaryrefslogtreecommitdiff
path: root/src/leap/gui
diff options
context:
space:
mode:
authorkali <kali@leap.se>2013-01-10 02:00:21 +0900
committerkali <kali@leap.se>2013-01-10 02:00:21 +0900
commitf55dcd717a946651492142ed198853b1c667254b (patch)
tree5e058f6648f589933582fc27a65b58c5c4a39f0d /src/leap/gui
parent6fe187c4ea2a32105c712d34167058707f8f82f8 (diff)
renamed connection page
Diffstat (limited to 'src/leap/gui')
-rw-r--r--src/leap/gui/firstrun/__init__.py5
-rw-r--r--src/leap/gui/firstrun/connect.py (renamed from src/leap/gui/firstrun/regvalidation.py)34
-rw-r--r--src/leap/gui/firstrun/intro.py2
-rw-r--r--src/leap/gui/firstrun/providersetup.py14
-rwxr-xr-xsrc/leap/gui/firstrun/wizard.py4
-rw-r--r--src/leap/gui/progress.py5
-rw-r--r--src/leap/gui/tests/test_firstrun_login.py2
-rw-r--r--src/leap/gui/tests/test_firstrun_register.py2
-rw-r--r--src/leap/gui/tests/test_firstrun_wizard.py4
9 files changed, 31 insertions, 41 deletions
diff --git a/src/leap/gui/firstrun/__init__.py b/src/leap/gui/firstrun/__init__.py
index d380b75a..2a523d6a 100644
--- a/src/leap/gui/firstrun/__init__.py
+++ b/src/leap/gui/firstrun/__init__.py
@@ -6,6 +6,7 @@ except ValueError:
pass
import intro
+import connect
import last
import login
import mixins
@@ -13,10 +14,10 @@ import providerinfo
import providerselect
import providersetup
import register
-import regvalidation
__all__ = [
'intro',
+ 'connect',
'last',
'login',
'mixins',
@@ -24,4 +25,4 @@ __all__ = [
'providerselect',
'providersetup',
'register',
- 'regvalidation'] # ,'wizard']
+ ] # ,'wizard']
diff --git a/src/leap/gui/firstrun/regvalidation.py b/src/leap/gui/firstrun/connect.py
index 6135a290..920ada50 100644
--- a/src/leap/gui/firstrun/regvalidation.py
+++ b/src/leap/gui/firstrun/connect.py
@@ -2,15 +2,7 @@
Provider Setup Validation Page,
used in First Run Wizard
"""
-# XXX This page is called regvalidation
-# but it's implementing functionality in the former
-# connect page.
-# We should remame it to connect again, when we integrate
-# the login branch of the wizard.
-
import logging
-#import json
-#import socket
from PyQt4 import QtGui
@@ -25,11 +17,11 @@ from leap.gui.constants import APP_LOGO
logger = logging.getLogger(__name__)
-class RegisterUserValidationPage(ValidationPage):
+class ConnectionPage(ValidationPage):
def __init__(self, parent=None):
- super(RegisterUserValidationPage, self).__init__(parent)
- self.current_page = "signupvalidation"
+ super(ConnectionPage, self).__init__(parent)
+ self.current_page = "connect"
title = self.tr("Connecting...")
# XXX uh... really?
@@ -54,20 +46,18 @@ class RegisterUserValidationPage(ValidationPage):
domain, port = get_https_domain_and_port(full_domain)
_domain = u"%s:%s" % (domain, port) if port != 443 else unicode(domain)
- # FIXME #BUG 638 FIXME FIXME FIXME
- verify = False # !!!!!!!!!!!!!!!!
- # FIXME #BUG 638 FIXME FIXME FIXME
+ verify = True
###########################################
# Set Credentials.
# username and password are in different fields
# if they were stored in log_in or sign_up pages.
- is_signup = self.field("is_signup")
+ from_login = wizard.from_login
unamek_base = 'userName'
passwk_base = 'userPassword'
- unamek = 'login_%s' % unamek_base if not is_signup else unamek_base
- passwk = 'login_%s' % passwk_base if not is_signup else passwk_base
+ unamek = 'login_%s' % unamek_base if from_login else unamek_base
+ passwk = 'login_%s' % passwk_base if from_login else passwk_base
username = self.field(unamek)
password = self.field(passwk)
@@ -182,8 +172,8 @@ class RegisterUserValidationPage(ValidationPage):
called after _do_checks has finished
(connected to checker thread finished signal)
"""
- is_signup = self.field("is_signup")
- prevpage = "signup" if is_signup else "login"
+ from_login = self.wizard().from_login
+ prevpage = "login" if from_login else "signup"
wizard = self.wizard()
if self.errors:
@@ -200,11 +190,11 @@ class RegisterUserValidationPage(ValidationPage):
def nextId(self):
wizard = self.wizard()
- if not wizard:
- return
+ #if not wizard:
+ #return
return wizard.get_page_index('lastpage')
def initializePage(self):
- super(RegisterUserValidationPage, self).initializePage()
+ super(ConnectionPage, self).initializePage()
self.set_undone()
self.completeChanged.emit()
diff --git a/src/leap/gui/firstrun/intro.py b/src/leap/gui/firstrun/intro.py
index 0a7484e2..0425b764 100644
--- a/src/leap/gui/firstrun/intro.py
+++ b/src/leap/gui/firstrun/intro.py
@@ -50,7 +50,7 @@ class IntroPage(QtGui.QWizardPage):
layout.addWidget(radiobuttonGroup)
self.setLayout(layout)
- self.registerField('is_signup', self.sign_up)
+ #self.registerField('is_signup', self.sign_up)
def validatePage(self):
return True
diff --git a/src/leap/gui/firstrun/providersetup.py b/src/leap/gui/firstrun/providersetup.py
index 1a362794..48a89091 100644
--- a/src/leap/gui/firstrun/providersetup.py
+++ b/src/leap/gui/firstrun/providersetup.py
@@ -20,8 +20,8 @@ class ProviderSetupValidationPage(ValidationPage):
self.current_page = "providersetupvalidation"
# XXX needed anymore?
- is_signup = self.field("is_signup")
- self.is_signup = is_signup
+ #is_signup = self.field("is_signup")
+ #self.is_signup = is_signup
self.setTitle(self.tr("Provider setup"))
self.setSubTitle(
@@ -158,14 +158,12 @@ class ProviderSetupValidationPage(ValidationPage):
def nextId(self):
wizard = self.wizard()
- if not wizard:
- return
- is_signup = self.field('is_signup')
- if is_signup is True:
- next_ = 'signup'
- if is_signup is False:
+ from_login = wizard.from_login
+ if from_login:
# XXX bad name. change to connect again.
next_ = 'signupvalidation'
+ else:
+ next_ = 'signup'
return wizard.get_page_index(next_)
def initializePage(self):
diff --git a/src/leap/gui/firstrun/wizard.py b/src/leap/gui/firstrun/wizard.py
index 408d4597..427f9df8 100755
--- a/src/leap/gui/firstrun/wizard.py
+++ b/src/leap/gui/firstrun/wizard.py
@@ -59,8 +59,8 @@ def get_pages_dict():
('providersetupvalidation',
firstrun.providersetup.ProviderSetupValidationPage),
('signup', firstrun.register.RegisterUserPage),
- ('signupvalidation',
- firstrun.regvalidation.RegisterUserValidationPage),
+ ('connect',
+ firstrun.connect.ConnectionPage),
('lastpage', firstrun.last.LastPage)
))
diff --git a/src/leap/gui/progress.py b/src/leap/gui/progress.py
index ffea80de..fceeb2f6 100644
--- a/src/leap/gui/progress.py
+++ b/src/leap/gui/progress.py
@@ -118,11 +118,12 @@ class StepsTableWidget(QtGui.QTableWidget):
self.setSelectionMode(
QtGui.QAbstractItemView.NoSelection)
width = self.width()
+
# WTF? Here init width is 100...
# but on populating is 456... :(
+ #logger.debug('init table. width=%s' % width)
# XXX do we need this initial?
- logger.debug('init table. width=%s' % width)
self.horizontalHeader().resizeSection(0, width * 0.7)
# this disables the table grid.
@@ -318,7 +319,7 @@ class WithStepsMixIn(object):
table = self.stepsTableWidget
FIRST_COLUMN_PERCENT = 0.70
width = table.width()
- logger.debug('populate table. width=%s' % width)
+ #logger.debug('populate table. width=%s' % width)
table.horizontalHeader().resizeSection(0, width * FIRST_COLUMN_PERCENT)
def set_item_icon(self, img=ICON_CHECKMARK, current=True):
diff --git a/src/leap/gui/tests/test_firstrun_login.py b/src/leap/gui/tests/test_firstrun_login.py
index fa800c23..6c45b8ef 100644
--- a/src/leap/gui/tests/test_firstrun_login.py
+++ b/src/leap/gui/tests/test_firstrun_login.py
@@ -100,7 +100,7 @@ class RegisterUserPageUITestCase(qunittest.TestCase):
pages = OrderedDict((
(self.pagename, TestPage),
('providersetupvalidation',
- firstrun.regvalidation.RegisterUserValidationPage)))
+ firstrun.connect.ConnectionPage)))
self.wizard = firstrun.wizard.FirstRunWizard(None, pages_dict=pages)
self.page = self.wizard.page(self.wizard.get_page_index(self.pagename))
diff --git a/src/leap/gui/tests/test_firstrun_register.py b/src/leap/gui/tests/test_firstrun_register.py
index 3447fe9d..d3be8897 100644
--- a/src/leap/gui/tests/test_firstrun_register.py
+++ b/src/leap/gui/tests/test_firstrun_register.py
@@ -113,7 +113,7 @@ class RegisterUserPageUITestCase(qunittest.TestCase):
pages = OrderedDict((
(self.pagename, TestPage),
('signupvalidation',
- firstrun.regvalidation.RegisterUserValidationPage)))
+ firstrun.connect.ConnectionPage)))
self.wizard = firstrun.wizard.FirstRunWizard(None, pages_dict=pages)
self.page = self.wizard.page(self.wizard.get_page_index(self.pagename))
diff --git a/src/leap/gui/tests/test_firstrun_wizard.py b/src/leap/gui/tests/test_firstrun_wizard.py
index d51e9945..b6c34000 100644
--- a/src/leap/gui/tests/test_firstrun_wizard.py
+++ b/src/leap/gui/tests/test_firstrun_wizard.py
@@ -29,8 +29,8 @@ PAGES_DICT = dict((
('providersetupvalidation',
firstrun.providersetup.ProviderSetupValidationPage),
('signup', firstrun.register.RegisterUserPage),
- ('signupvalidation',
- firstrun.regvalidation.RegisterUserValidationPage),
+ ('connect',
+ firstrun.connect.ConnectionPage),
('lastpage', firstrun.last.LastPage)
))