summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2014-06-12 15:11:25 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2014-06-25 11:12:04 -0300
commit4b52040da3750096b73fd3d5b790c2494ef18b0b (patch)
tree02992640c8db9938d749fc1658bfdae18461ee21 /src/leap/bitmask/gui
parenta28566a7b4c999a7da8e0f6cf76d31a1065c8eed (diff)
Use a dict instead of an object to ease serialization.
Diffstat (limited to 'src/leap/bitmask/gui')
-rw-r--r--src/leap/bitmask/gui/mainwindow.py12
-rw-r--r--src/leap/bitmask/gui/wizard.py22
2 files changed, 17 insertions, 17 deletions
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 5feaf610..9e0e78bc 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -549,7 +549,7 @@ class MainWindow(QtGui.QMainWindow):
details = self._provider_details
mx_provided = False
if details is not None:
- mx_provided = MX_SERVICE in details.services
+ mx_provided = MX_SERVICE in details['services']
# XXX: handle differently not logged in user?
akm = AdvancedKeyManagement(self, mx_provided, logged_user,
@@ -569,7 +569,7 @@ class MainWindow(QtGui.QMainWindow):
domain = self._login_widget.get_selected_provider()
mx_provided = False
if self._provider_details is not None:
- mx_provided = MX_SERVICE in self._provider_details.services
+ mx_provided = MX_SERVICE in self._provider_details['services']
preferences = PreferencesWindow(self, user, domain, self._backend,
self._soledad_started, mx_provided)
@@ -1267,7 +1267,7 @@ class MainWindow(QtGui.QMainWindow):
sig.soledad_bootstrap_failed.connect(lambda: btn_enabled(True))
sig.soledad_bootstrap_finished.connect(lambda: btn_enabled(True))
- if not MX_SERVICE in self._provider_details.services:
+ if not MX_SERVICE in self._provider_details['services']:
self._set_mx_visible(False)
def _start_eip_bootstrap(self):
@@ -1310,7 +1310,7 @@ class MainWindow(QtGui.QMainWindow):
Set the details for the just downloaded provider.
:param details: the details of the provider.
- :type details: ProviderConfigLight
+ :type details: dict
"""
self._provider_details = details
@@ -1327,7 +1327,7 @@ class MainWindow(QtGui.QMainWindow):
mx_enabled = MX_SERVICE in enabled_services
mx_provided = False
if self._provider_details is not None:
- mx_provided = MX_SERVICE in self._provider_details.services
+ mx_provided = MX_SERVICE in self._provider_details['services']
return mx_enabled and mx_provided
@@ -1344,7 +1344,7 @@ class MainWindow(QtGui.QMainWindow):
eip_enabled = EIP_SERVICE in enabled_services
eip_provided = False
if self._provider_details is not None:
- eip_provided = EIP_SERVICE in self._provider_details.services
+ eip_provided = EIP_SERVICE in self._provider_details['services']
return eip_enabled and eip_provided
diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py
index 05cfbed3..f66c553d 100644
--- a/src/leap/bitmask/gui/wizard.py
+++ b/src/leap/bitmask/gui/wizard.py
@@ -569,7 +569,7 @@ class Wizard(QtGui.QWizard):
Set the details for the just downloaded provider.
:param details: the details of the provider.
- :type details: ProviderConfigLight
+ :type details: dict
"""
self._provider_details = details
@@ -640,9 +640,9 @@ class Wizard(QtGui.QWizard):
the user to enable or disable.
"""
self.ui.grpServices.setTitle(
- self.tr("Services by {0}").format(self._provider_details.name))
+ self.tr("Services by {0}").format(self._provider_details['name']))
- services = get_supported(self._provider_details.services)
+ services = get_supported(self._provider_details['services'])
for service in services:
try:
@@ -685,7 +685,7 @@ class Wizard(QtGui.QWizard):
if not self._provider_setup_ok:
self._reset_provider_setup()
sub_title = self.tr("Gathering configuration options for {0}")
- sub_title = sub_title.format(self._provider_details.name)
+ sub_title = sub_title.format(self._provider_details['name'])
self.page(pageId).setSubTitle(sub_title)
self.ui.lblDownloadCaCert.setPixmap(self.QUESTION_ICON)
self._provider_setup_defer = self._backend.\
@@ -693,22 +693,22 @@ class Wizard(QtGui.QWizard):
if pageId == self.PRESENT_PROVIDER_PAGE:
sub_title = self.tr("Description of services offered by {0}")
- sub_title = sub_title.format(self._provider_details.name)
+ sub_title = sub_title.format(self._provider_details['name'])
self.page(pageId).setSubTitle(sub_title)
details = self._provider_details
- name = "<b>{0}</b>".format(details.name)
- domain = "https://{0}".format(details.domain)
- description = "<i>{0}</i>".format(details.description)
+ name = "<b>{0}</b>".format(details['name'])
+ domain = "https://{0}".format(details['domain'])
+ description = "<i>{0}</i>".format(details['description'])
self.ui.lblProviderName.setText(name)
self.ui.lblProviderURL.setText(domain)
self.ui.lblProviderDesc.setText(description)
- self.ui.lblServicesOffered.setText(details.services_string)
- self.ui.lblProviderPolicy.setText(details.enrollment_policy)
+ self.ui.lblServicesOffered.setText(details['services_string'])
+ self.ui.lblProviderPolicy.setText(details['enrollment_policy'])
if pageId == self.REGISTER_USER_PAGE:
sub_title = self.tr("Register a new user with {0}")
- sub_title = sub_title.format(self._provider_details.name)
+ sub_title = sub_title.format(self._provider_details['name'])
self.page(pageId).setSubTitle(sub_title)
self.ui.chkRemember.setVisible(False)