diff options
author | elijah <elijah@riseup.net> | 2014-09-16 16:40:52 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2014-09-19 14:23:14 -0700 |
commit | c29b1dd9345e01e761b9891728ecd0b8d964a02d (patch) | |
tree | 79bda358ee3afe316cc0e0181b4efd9fa583f0b8 /src/leap/bitmask/gui | |
parent | 6166ffedcae0763f3c00076c79e74847f5c80823 (diff) |
single pref win: gets the autopep8 beauty scrub.
Diffstat (limited to 'src/leap/bitmask/gui')
-rw-r--r-- | src/leap/bitmask/gui/account.py | 6 | ||||
-rw-r--r-- | src/leap/bitmask/gui/app.py | 4 | ||||
-rw-r--r-- | src/leap/bitmask/gui/flashable.py | 3 | ||||
-rw-r--r-- | src/leap/bitmask/gui/passwordwindow.py | 7 | ||||
-rw-r--r-- | src/leap/bitmask/gui/preferences_account_page.py | 3 | ||||
-rw-r--r-- | src/leap/bitmask/gui/preferences_email_page.py | 3 | ||||
-rw-r--r-- | src/leap/bitmask/gui/preferences_vpn_page.py | 1 | ||||
-rw-r--r-- | src/leap/bitmask/gui/preferenceswindow.py | 33 | ||||
-rw-r--r-- | src/leap/bitmask/gui/wizard.py | 4 |
9 files changed, 37 insertions, 27 deletions
diff --git a/src/leap/bitmask/gui/account.py b/src/leap/bitmask/gui/account.py index ae8127c0..c941c3fa 100644 --- a/src/leap/bitmask/gui/account.py +++ b/src/leap/bitmask/gui/account.py @@ -21,6 +21,7 @@ from leap.bitmask.util import make_address from leap.bitmask.config.leapsettings import LeapSettings from leap.bitmask.services import EIP_SERVICE, MX_SERVICE + class Account(): def __init__(self, username, domain): @@ -29,9 +30,9 @@ class Account(): self.domain = domain if self.username is not None: - self.address = make_address(self.username, self.domain) + self.address = make_address(self.username, self.domain) else: - self.address = self.domain + self.address = self.domain def services(self): """ @@ -46,4 +47,3 @@ class Account(): def is_eip_enabled(self): EIP_SERVICE in self.services() - diff --git a/src/leap/bitmask/gui/app.py b/src/leap/bitmask/gui/app.py index 7fcf69af..eb1a58d5 100644 --- a/src/leap/bitmask/gui/app.py +++ b/src/leap/bitmask/gui/app.py @@ -29,9 +29,8 @@ from leap.bitmask.backend.leapsignaler import LeapSignaler logger = logging.getLogger(__name__) -class App(QtGui.QWidget): - #preferences_saved = QtCore.Signal() +class App(QtGui.QWidget): # the user has changed which services are enabled for a particular account # args: account (Account), active services (list of str) @@ -50,7 +49,6 @@ class App(QtGui.QWidget): self._backend_checker.timeout.connect(self._check_backend_status) self._backend_checker.start(2000) - @QtCore.Slot() def _check_backend_status(self): """ diff --git a/src/leap/bitmask/gui/flashable.py b/src/leap/bitmask/gui/flashable.py index 94e3ab60..a26d1ec6 100644 --- a/src/leap/bitmask/gui/flashable.py +++ b/src/leap/bitmask/gui/flashable.py @@ -14,7 +14,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. + class Flashable(object): + """ An abstract super class to give a QWidget handy methods for diplaying alert messages inline. The widget inheriting from this class must have @@ -72,4 +74,3 @@ class Flashable(object): def hide_flash(self): self._setup() self.widget.setVisible(False) - diff --git a/src/leap/bitmask/gui/passwordwindow.py b/src/leap/bitmask/gui/passwordwindow.py index 9946febe..5354ab86 100644 --- a/src/leap/bitmask/gui/passwordwindow.py +++ b/src/leap/bitmask/gui/passwordwindow.py @@ -28,6 +28,7 @@ from leap.bitmask.gui.flashable import Flashable import logging logger = logging.getLogger(__name__) + class PasswordWindow(QtGui.QDialog, Flashable): def __init__(self, parent, account, app): @@ -55,7 +56,7 @@ class PasswordWindow(QtGui.QDialog, Flashable): self.ui.cancel_button.clicked.connect(self._close) self.ui.username_lineedit.setText(account.address) - self._disabled = False # if set to True, never again enable widgets. + self._disabled = False # if set to True, never again enable widgets. if account.username is None: # should not ever happen, but just in case @@ -153,7 +154,6 @@ class PasswordWindow(QtGui.QDialog, Flashable): self._soledad_ready = False sig.soledad_bootstrap_finished.connect(self._on_soledad_ready) - @QtCore.Slot() def _change_password(self): """ @@ -174,7 +174,7 @@ class PasswordWindow(QtGui.QDialog, Flashable): return ok, msg, field = password_checks(self.account.username, new_password, - new_password2) + new_password2) if not ok: self.flash_error(msg) if field == 'new_password': @@ -258,7 +258,6 @@ class PasswordWindow(QtGui.QDialog, Flashable): self._enable_password_widgets(True) self.flash_error(msg) - @QtCore.Slot() def _on_soledad_ready(self): """ diff --git a/src/leap/bitmask/gui/preferences_account_page.py b/src/leap/bitmask/gui/preferences_account_page.py index 895d84b5..00dbe626 100644 --- a/src/leap/bitmask/gui/preferences_account_page.py +++ b/src/leap/bitmask/gui/preferences_account_page.py @@ -28,6 +28,7 @@ from leap.bitmask.config.leapsettings import LeapSettings logger = logging.getLogger(__name__) + class PreferencesAccountPage(QtGui.QWidget): def __init__(self, parent, account, app): @@ -86,7 +87,6 @@ class PreferencesAccountPage(QtGui.QWidget): # emit signal alerting change self.app.service_selection_changed.emit(self.account, services) - @QtCore.Slot(str) def _load_services(self, services): """ @@ -126,4 +126,3 @@ class PreferencesAccountPage(QtGui.QWidget): def _show_change_password(self): change_password_window = PasswordWindow(self, self.account, self.app) change_password_window.show() - diff --git a/src/leap/bitmask/gui/preferences_email_page.py b/src/leap/bitmask/gui/preferences_email_page.py index da902802..0535762a 100644 --- a/src/leap/bitmask/gui/preferences_email_page.py +++ b/src/leap/bitmask/gui/preferences_email_page.py @@ -23,7 +23,9 @@ from ui_preferences_email_page import Ui_PreferencesEmailPage logger = logging.getLogger(__name__) + class PreferencesEmailPage(QtGui.QWidget): + """ """ @@ -38,4 +40,3 @@ class PreferencesEmailPage(QtGui.QWidget): self.parent = parent self.account = account self.app = app - diff --git a/src/leap/bitmask/gui/preferences_vpn_page.py b/src/leap/bitmask/gui/preferences_vpn_page.py index a8f074d2..e3417f89 100644 --- a/src/leap/bitmask/gui/preferences_vpn_page.py +++ b/src/leap/bitmask/gui/preferences_vpn_page.py @@ -24,6 +24,7 @@ from leap.bitmask.config.leapsettings import LeapSettings class PreferencesVpnPage(QtGui.QWidget): + """ Page in the preferences window that shows VPN settings """ diff --git a/src/leap/bitmask/gui/preferenceswindow.py b/src/leap/bitmask/gui/preferenceswindow.py index 35a875fa..ccddb764 100644 --- a/src/leap/bitmask/gui/preferenceswindow.py +++ b/src/leap/bitmask/gui/preferenceswindow.py @@ -33,6 +33,7 @@ logger = logging.getLogger(__name__) class PreferencesWindow(QtGui.QDialog): + """ Window that displays the preferences. """ @@ -81,27 +82,32 @@ class PreferencesWindow(QtGui.QDialog): account_item = QtGui.QListWidgetItem(self.ui.nav_widget) account_item.setIcon(QtGui.QIcon(":/images/black/32/user.png")) account_item.setText(self.tr("Account")) - account_item.setTextAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) - account_item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - account_item.setSizeHint(QtCore.QSize(98,56)) + account_item.setTextAlignment( + QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) + account_item.setFlags( + QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) + account_item.setSizeHint(QtCore.QSize(98, 56)) self._account_item = account_item vpn_item = QtGui.QListWidgetItem(self.ui.nav_widget) vpn_item.setHidden(True) vpn_item.setIcon(QtGui.QIcon(":/images/black/32/earth.png")) vpn_item.setText(self.tr("VPN")) - vpn_item.setTextAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) + vpn_item.setTextAlignment( + QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) vpn_item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - vpn_item.setSizeHint(QtCore.QSize(98,56)) + vpn_item.setSizeHint(QtCore.QSize(98, 56)) self._vpn_item = vpn_item email_item = QtGui.QListWidgetItem(self.ui.nav_widget) email_item.setHidden(True) email_item.setIcon(QtGui.QIcon(":/images/black/32/email.png")) email_item.setText(self.tr("Email")) - email_item.setTextAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) - email_item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - email_item.setSizeHint(QtCore.QSize(98,56)) + email_item.setTextAlignment( + QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) + email_item.setFlags( + QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) + email_item.setSizeHint(QtCore.QSize(98, 56)) self._email_item = email_item self.ui.nav_widget.currentItemChanged.connect(self._change_page) @@ -111,9 +117,12 @@ class PreferencesWindow(QtGui.QDialog): """ Adds the pages for the different configuration categories. """ - self.ui.pages_widget.addWidget(PreferencesAccountPage(self, self.account, self.app)) - self.ui.pages_widget.addWidget(PreferencesVpnPage(self, self.account, self.app)) - self.ui.pages_widget.addWidget(PreferencesEmailPage(self, self.account, self.app)) + self.ui.pages_widget.addWidget( + PreferencesAccountPage(self, self.account, self.app)) + self.ui.pages_widget.addWidget( + PreferencesVpnPage(self, self.account, self.app)) + self.ui.pages_widget.addWidget( + PreferencesEmailPage(self, self.account, self.app)) # # Slots @@ -154,5 +163,5 @@ class PreferencesWindow(QtGui.QDialog): return self._vpn_item.setHidden(not EIP_SERVICE in services) - #self._email_item.setHidden(not MX_SERVICE in services) + # self._email_item.setHidden(not MX_SERVICE in services) # ^^ disable email for now, there is nothing there yet. diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index 4d55a39e..ff9cae55 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -42,6 +42,7 @@ logger = logging.getLogger(__name__) class Wizard(QtGui.QWizard): + """ First run wizard to register a user and setup a provider """ @@ -317,7 +318,8 @@ class Wizard(QtGui.QWizard): user_ok, msg = username_checks(username) if user_ok: - pass_ok, msg, field = password_checks(username, password, password2) + pass_ok, msg, field = password_checks( + username, password, password2) if user_ok and pass_ok: self._set_register_status(self.tr("Starting registration...")) |