summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/gui')
-rw-r--r--src/leap/bitmask/gui/mainwindow.py18
-rw-r--r--src/leap/bitmask/gui/preferenceswindow.py16
-rw-r--r--src/leap/bitmask/gui/wizard.py20
3 files changed, 12 insertions, 42 deletions
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 37bbf1c4..69e36328 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -28,6 +28,7 @@ import keyring
from PySide import QtCore, QtGui
from twisted.internet import threads
+from leap.bitmask.config import flags
from leap.bitmask.config.leapsettings import LeapSettings
from leap.bitmask.config.providerconfig import ProviderConfig
from leap.bitmask.crypto.srpauth import SRPAuth
@@ -107,7 +108,6 @@ class MainWindow(QtGui.QMainWindow):
user_stopped_eip = False
def __init__(self, quit_callback,
- standalone=False,
openvpn_verb=1,
bypass_checks=False):
"""
@@ -117,10 +117,6 @@ class MainWindow(QtGui.QMainWindow):
the application.
:type quit_callback: callable
- :param standalone: Set to true if the app should use configs
- inside its pwd
- :type standalone: bool
-
:param bypass_checks: Set to true if the app should bypass
first round of checks for CA
certificates at bootstrap
@@ -147,7 +143,7 @@ class MainWindow(QtGui.QMainWindow):
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
- self._settings = LeapSettings(standalone)
+ self._settings = LeapSettings()
self._login_widget = LoginWidget(
self._settings,
@@ -176,7 +172,6 @@ class MainWindow(QtGui.QMainWindow):
# This is loaded only once, there's a bug when doing that more
# than once
- self._standalone = standalone
self._provider_config = ProviderConfig()
# Used for automatic start of EIP
self._provisional_provider_config = ProviderConfig()
@@ -306,8 +301,7 @@ class MainWindow(QtGui.QMainWindow):
if self._first_run():
self._wizard_firstrun = True
- self._wizard = Wizard(standalone=standalone,
- bypass_checks=bypass_checks)
+ self._wizard = Wizard(bypass_checks=bypass_checks)
# Give this window time to finish init and then show the wizard
QtCore.QTimer.singleShot(1, self._launch_wizard)
self._wizard.accepted.connect(self._finish_init)
@@ -412,8 +406,7 @@ class MainWindow(QtGui.QMainWindow):
Displays the preferences window.
"""
- preferences_window = PreferencesWindow(
- self, self._srp_auth, self._settings, self._standalone)
+ preferences_window = PreferencesWindow(self, self._srp_auth)
if self._soledad_ready:
preferences_window.set_soledad_ready(self._soledad)
@@ -965,8 +958,7 @@ class MainWindow(QtGui.QMainWindow):
self._provider_config,
self._login_widget.get_user(),
self._login_widget.get_password(),
- download_if_needed=True,
- standalone=self._standalone)
+ download_if_needed=True)
self._download_eip_config()
diff --git a/src/leap/bitmask/gui/preferenceswindow.py b/src/leap/bitmask/gui/preferenceswindow.py
index 1becfb18..2d17f6c2 100644
--- a/src/leap/bitmask/gui/preferenceswindow.py
+++ b/src/leap/bitmask/gui/preferenceswindow.py
@@ -24,6 +24,7 @@ import logging
from functools import partial
from PySide import QtCore, QtGui
+from leap.bitmask.config.leapsettings import LeapSettings
from leap.bitmask.gui.ui_preferences import Ui_Preferences
from leap.soledad.client import NoStorageSecret
from leap.bitmask.crypto.srpauth import SRPAuthBadPassword
@@ -40,26 +41,18 @@ class PreferencesWindow(QtGui.QDialog):
"""
Window that displays the preferences.
"""
-
- WEAK_PASSWORDS = ("123456", "qweasd", "qwerty", "password")
-
- def __init__(self, parent, srp_auth, leap_settings, standalone):
+ def __init__(self, parent, srp_auth):
"""
:param parent: parent object of the PreferencesWindow.
:parent type: QWidget
:param srp_auth: SRPAuth object configured in the main app.
:type srp_auth: SRPAuth
- :param standalone: If True, the application is running as standalone
- and the preferences dialog should display some
- messages according to this.
- :type standalone: bool
"""
QtGui.QDialog.__init__(self, parent)
self.AUTOMATIC_GATEWAY_LABEL = self.tr("Automatic")
self._srp_auth = srp_auth
- self._settings = leap_settings
- self._standalone = standalone
+ self._settings = LeapSettings()
self._soledad = None
# Load UI
@@ -325,8 +318,7 @@ class PreferencesWindow(QtGui.QDialog):
for service in services:
try:
checkbox = QtGui.QCheckBox(self)
- service_label = get_service_display_name(
- service, self._standalone)
+ service_label = get_service_display_name(service)
checkbox.setText(service_label)
self.ui.vlServices.addWidget(checkbox)
diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py
index e004e6cf..45734b81 100644
--- a/src/leap/bitmask/gui/wizard.py
+++ b/src/leap/bitmask/gui/wizard.py
@@ -27,6 +27,7 @@ from functools import partial
from PySide import QtCore, QtGui
from twisted.internet import threads
+from leap.bitmask.config import flags
from leap.bitmask.config.providerconfig import ProviderConfig
from leap.bitmask.crypto.srpregister import SRPRegister
from leap.bitmask.util.privilege_policies import is_missing_policy_permissions
@@ -58,21 +59,16 @@ class Wizard(QtGui.QWizard):
BARE_USERNAME_REGEX = r"^[A-Za-z\d_]+$"
- def __init__(self, standalone=False, bypass_checks=False):
+ def __init__(self, bypass_checks=False):
"""
Constructor for the main Wizard.
- :param standalone: If True, the application is running as standalone
- and the wizard should display some messages according to this.
- :type standalone: bool
:param bypass_checks: Set to true if the app should bypass
first round of checks for CA certificates at bootstrap
:type bypass_checks: bool
"""
QtGui.QWizard.__init__(self)
- self.standalone = standalone
-
self.ui = Ui_Wizard()
self.ui.setupUi(self)
@@ -489,8 +485,7 @@ class Wizard(QtGui.QWizard):
try:
if service not in self._shown_services:
checkbox = QtGui.QCheckBox(self)
- service_label = get_service_display_name(
- service, self.standalone)
+ service_label = get_service_display_name(service)
checkbox.setText(service_label)
self.ui.serviceListLayout.addWidget(checkbox)
@@ -555,15 +550,6 @@ class Wizard(QtGui.QWizard):
if pageId == self.SERVICES_PAGE:
self._populate_services()
- def _is_need_eip_password_warning(self):
- """
- Returns True if we need to add a warning about eip needing
- administrative permissions to start. That can be either
- because we are running in standalone mode, or because we could
- not find the needed privilege escalation mechanisms being operative.
- """
- return self.standalone or is_missing_policy_permissions()
-
def nextId(self):
"""
Sets the next page id for the wizard based on wether the user