diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2015-02-05 16:23:05 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2015-02-05 16:23:05 -0300 |
commit | 91f0a38f5911d0f26210f62a94ab46e741e30189 (patch) | |
tree | b1ca4bcfab84ba9a8cec6baf9daf2c70cc22b6cd /src/leap/bitmask/gui | |
parent | e046eeb7355a2ce3856eedee08bbc3d73ed7bbaa (diff) | |
parent | 1fa295ecd6af5c2ea64e76418bd144f9ddf4c803 (diff) |
Merge branch 'release/0.8.x' into develop
Diffstat (limited to 'src/leap/bitmask/gui')
-rw-r--r-- | src/leap/bitmask/gui/advanced_key_management.py | 8 | ||||
-rw-r--r-- | src/leap/bitmask/gui/app.py | 1 | ||||
-rw-r--r-- | src/leap/bitmask/gui/eip_preferenceswindow.py | 6 | ||||
-rw-r--r-- | src/leap/bitmask/gui/eip_status.py | 8 | ||||
-rw-r--r-- | src/leap/bitmask/gui/login.py | 13 | ||||
-rw-r--r-- | src/leap/bitmask/gui/mail_status.py | 12 | ||||
-rw-r--r-- | src/leap/bitmask/gui/mainwindow.py | 200 | ||||
-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_vpn_page.py | 4 | ||||
-rw-r--r-- | src/leap/bitmask/gui/preferenceswindow.py | 2 | ||||
-rw-r--r-- | src/leap/bitmask/gui/providers.py | 1 | ||||
-rw-r--r-- | src/leap/bitmask/gui/signaltracker.py | 1 | ||||
-rw-r--r-- | src/leap/bitmask/gui/wizard.py | 49 |
14 files changed, 98 insertions, 217 deletions
diff --git a/src/leap/bitmask/gui/advanced_key_management.py b/src/leap/bitmask/gui/advanced_key_management.py index 48a1db93..7d147b7b 100644 --- a/src/leap/bitmask/gui/advanced_key_management.py +++ b/src/leap/bitmask/gui/advanced_key_management.py @@ -132,7 +132,6 @@ class AdvancedKeyManagement(QtGui.QDialog): else: logger.debug('Import canceled by the user.') - @QtCore.Slot() def _keymanager_import_ok(self): """ TRIGGERS: @@ -144,7 +143,6 @@ class AdvancedKeyManagement(QtGui.QDialog): self, self.tr("Import Successful"), self.tr("The key pair was imported successfully.")) - @QtCore.Slot() def _import_ioerror(self): """ TRIGGERS: @@ -157,7 +155,6 @@ class AdvancedKeyManagement(QtGui.QDialog): self.tr("There was an error accessing the file.\n" "Import canceled.")) - @QtCore.Slot() def _import_datamismatch(self): """ TRIGGERS: @@ -171,7 +168,6 @@ class AdvancedKeyManagement(QtGui.QDialog): "same address and fingerprint.\n" "Import canceled.")) - @QtCore.Slot() def _import_missingkey(self): """ TRIGGERS: @@ -185,7 +181,6 @@ class AdvancedKeyManagement(QtGui.QDialog): "key in the same file.\n" "Import canceled.")) - @QtCore.Slot() def _import_addressmismatch(self): """ TRIGGERS: @@ -212,7 +207,6 @@ class AdvancedKeyManagement(QtGui.QDialog): else: logger.debug('Export canceled by the user.') - @QtCore.Slot() def _keymanager_export_ok(self): """ TRIGGERS: @@ -225,7 +219,6 @@ class AdvancedKeyManagement(QtGui.QDialog): self.tr("The key pair was exported successfully.\n" "Please, store your private key in a safe place.")) - @QtCore.Slot() def _keymanager_export_error(self): """ TRIGGERS: @@ -238,7 +231,6 @@ class AdvancedKeyManagement(QtGui.QDialog): self.tr("There was an error accessing the file.\n" "Export canceled.")) - @QtCore.Slot() def _keymanager_keys_list(self, keys): """ TRIGGERS: diff --git a/src/leap/bitmask/gui/app.py b/src/leap/bitmask/gui/app.py index 75dc4a38..5fe031b1 100644 --- a/src/leap/bitmask/gui/app.py +++ b/src/leap/bitmask/gui/app.py @@ -50,7 +50,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): """ TRIGGERS: diff --git a/src/leap/bitmask/gui/eip_preferenceswindow.py b/src/leap/bitmask/gui/eip_preferenceswindow.py index b5788f3c..8939c709 100644 --- a/src/leap/bitmask/gui/eip_preferenceswindow.py +++ b/src/leap/bitmask/gui/eip_preferenceswindow.py @@ -99,7 +99,6 @@ class EIPPreferencesWindow(QtGui.QDialog): self._backend.eip_get_initialized_providers(domains=providers) - @QtCore.Slot(list) def _load_providers_in_combo(self, providers): """ TRIGGERS: @@ -132,7 +131,6 @@ class EIPPreferencesWindow(QtGui.QDialog): domain, QtCore.Qt.MatchStartsWith) self.ui.cbProvidersGateway.setCurrentIndex(provider_index) - @QtCore.Slot(str) def _save_selected_gateway(self, provider): """ TRIGGERS: @@ -159,7 +157,6 @@ class EIPPreferencesWindow(QtGui.QDialog): "Gateway settings for provider '{0}' saved.").format(provider) self._set_providers_gateway_status(msg, success=True) - @QtCore.Slot(int) def _populate_gateways(self, domain_idx): """ TRIGGERS: @@ -182,7 +179,6 @@ class EIPPreferencesWindow(QtGui.QDialog): self._backend.eip_get_gateways_list(domain=domain) - @QtCore.Slot(list) def _update_gateways_list(self, gateways): """ TRIGGERS: @@ -223,7 +219,6 @@ class EIPPreferencesWindow(QtGui.QDialog): self.ui.cbGateways.setCurrentIndex(index) - @QtCore.Slot() def _gateways_list_error(self): """ TRIGGERS: @@ -238,7 +233,6 @@ class EIPPreferencesWindow(QtGui.QDialog): self.ui.pbSaveGateway.setEnabled(False) self.ui.cbGateways.setEnabled(False) - @QtCore.Slot() def _gateways_list_uninitialized(self): """ TRIGGERS: diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py index 14ff5972..83490cac 100644 --- a/src/leap/bitmask/gui/eip_status.py +++ b/src/leap/bitmask/gui/eip_status.py @@ -137,7 +137,6 @@ class EIPStatusWidget(QtGui.QWidget): self.ui.btnUpload.clicked.connect(onclicked) self.ui.btnDownload.clicked.connect(onclicked) - @QtCore.Slot() def _on_VPN_status_clicked(self): """ TRIGGERS: @@ -295,7 +294,6 @@ class EIPStatusWidget(QtGui.QWidget): msg = self.tr("Encrypted Internet is starting") self.set_eip_message(msg) - @QtCore.Slot() def disable_eip_start(self): """ Triggered when a default provider_config has not been found. @@ -327,7 +325,6 @@ class EIPStatusWidget(QtGui.QWidget): self._eip_disabled_action) self._eip_status_menu.menuAction().setVisible(False) - @QtCore.Slot() def enable_eip_start(self): """ Triggered after a successful login. @@ -452,7 +449,6 @@ class EIPStatusWidget(QtGui.QWidget): self.user_cancelled = True self.hide_eip_cancel_button() - @QtCore.Slot(dict) def eip_stopped(self, restart=False, failed=False): """ TRIGGERS: @@ -500,7 +496,6 @@ class EIPStatusWidget(QtGui.QWidget): "unencrypted traffic.")) self.show_fw_down_button() - @QtCore.Slot(dict) def update_vpn_status(self, data=None): """ TRIGGERS: @@ -535,7 +530,6 @@ class EIPStatusWidget(QtGui.QWidget): self.ui.btnUpload.setText(upload_str) self.ui.btnDownload.setText(download_str) - @QtCore.Slot(dict) def update_vpn_state(self, vpn_state): """ TRIGGERS: @@ -674,7 +668,6 @@ class EIPStatusWidget(QtGui.QWidget): # Slots for signals # - @QtCore.Slot() def _on_eip_connection_aborted(self): """ TRIGGERS: @@ -773,7 +766,6 @@ class EIPStatusWidget(QtGui.QWidget): """ self.eip_conductor.reconnect_stop_signal() - @QtCore.Slot() def _on_eip_network_unreachable(self): """ TRIGGERS: diff --git a/src/leap/bitmask/gui/login.py b/src/leap/bitmask/gui/login.py index 7487e888..90df0b73 100644 --- a/src/leap/bitmask/gui/login.py +++ b/src/leap/bitmask/gui/login.py @@ -133,7 +133,6 @@ class LoginWidget(QtGui.QWidget, SignalTracker): self._set_logged_out() - @QtCore.Slot(int) def _remember_state_changed(self, state): """ Save the remember state in the LeapSettings. @@ -145,7 +144,6 @@ class LoginWidget(QtGui.QWidget, SignalTracker): # are: Checked, Unchecked and PartiallyChecked self._settings.set_remember(state == QtCore.Qt.Checked) - @QtCore.Slot(unicode) def _credentials_changed(self, text): """ TRIGGER: @@ -431,7 +429,6 @@ class LoginWidget(QtGui.QWidget, SignalTracker): self._backend.user_cancel_login() self._set_logged_out() - @QtCore.Slot() def _set_login_cancelled(self): """ TRIGGERS: @@ -443,7 +440,6 @@ class LoginWidget(QtGui.QWidget, SignalTracker): self.set_status(self.tr("Log in cancelled by the user.")) self.set_enabled(True) - @QtCore.Slot(dict) def _provider_setup_intermediate(self, data): """ TRIGGERS: @@ -457,7 +453,6 @@ class LoginWidget(QtGui.QWidget, SignalTracker): logger.error(data[ERROR_KEY]) self._login_problem_provider() - @QtCore.Slot() def _login_problem_provider(self): """ Warn the user about a problem with the provider during login. @@ -465,7 +460,6 @@ class LoginWidget(QtGui.QWidget, SignalTracker): self.set_status(self.tr("Unable to login: Problem with provider")) self.set_enabled(True) - @QtCore.Slot(dict) def _load_provider_config(self, data): """ TRIGGERS: @@ -485,7 +479,6 @@ class LoginWidget(QtGui.QWidget, SignalTracker): self._backend.provider_bootstrap(provider=self._provider) - @QtCore.Slot(dict) def _provider_config_loaded(self, data): """ TRIGGERS: @@ -528,7 +521,6 @@ class LoginWidget(QtGui.QWidget, SignalTracker): self.ui.logged_widget.show() self.ui.lblUser.setText(fullname) - @QtCore.Slot() def _authentication_finished(self): """ TRIGGERS: @@ -538,11 +530,11 @@ class LoginWidget(QtGui.QWidget, SignalTracker): """ self.set_status(self.tr("Succeeded"), error=False) self._set_logged_in() + self.disconnect_and_untrack() if not flags.OFFLINE: self.login_finished.emit() - @QtCore.Slot(unicode) def _authentication_error(self, msg): """ TRIGGERS: @@ -574,7 +566,6 @@ class LoginWidget(QtGui.QWidget, SignalTracker): self.set_enabled(True) self.set_status("", error=False) - @QtCore.Slot() def do_logout(self): """ TRIGGER: @@ -612,7 +603,6 @@ class LoginWidget(QtGui.QWidget, SignalTracker): self.ui.btnLogout.setEnabled(True) self.ui.clblErrorMsg.hide() - @QtCore.Slot() def _logout_error(self): """ TRIGGER: @@ -623,7 +613,6 @@ class LoginWidget(QtGui.QWidget, SignalTracker): self._set_logging_out(False) self.set_status(self.tr("Something went wrong with the logout.")) - @QtCore.Slot() def _logout_ok(self): """ TRIGGER: diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py index 92e1e4c4..bbfbafb5 100644 --- a/src/leap/bitmask/gui/mail_status.py +++ b/src/leap/bitmask/gui/mail_status.py @@ -184,7 +184,6 @@ class MailStatusWidget(QtGui.QWidget): leap_assert_type(action_mail_status, QtGui.QAction) self._action_mail_status = action_mail_status - @QtCore.Slot() def set_soledad_failed(self): """ TRIGGERS: @@ -195,7 +194,6 @@ class MailStatusWidget(QtGui.QWidget): msg = self.tr("There was an unexpected problem with Soledad.") self._set_mail_status(msg, ready=-1) - @QtCore.Slot() def set_soledad_invalid_auth_token(self): """ TRIGGERS: @@ -250,7 +248,6 @@ class MailStatusWidget(QtGui.QWidget): """ self._soledad_event.emit(req) - @QtCore.Slot(object) def _mail_handle_soledad_events_slot(self, req): """ TRIGGERS: @@ -285,7 +282,6 @@ class MailStatusWidget(QtGui.QWidget): """ self._keymanager_event.emit(req) - @QtCore.Slot(object) def _mail_handle_keymanager_events_slot(self, req): """ TRIGGERS: @@ -332,7 +328,6 @@ class MailStatusWidget(QtGui.QWidget): """ self._smtp_event.emit(req) - @QtCore.Slot(object) def _mail_handle_smtp_events_slot(self, req): """ TRIGGERS: @@ -367,7 +362,6 @@ class MailStatusWidget(QtGui.QWidget): """ self._imap_event.emit(req) - @QtCore.Slot(object) def _mail_handle_imap_events_slot(self, req): """ TRIGGERS: @@ -419,7 +413,6 @@ class MailStatusWidget(QtGui.QWidget): # XXX make the signal emit the label and state. - @QtCore.Slot() def mail_state_disconnected(self): """ Display the correct UI for the disconnected state. @@ -431,7 +424,6 @@ class MailStatusWidget(QtGui.QWidget): else: self._set_mail_status(self.tr("OFF"), -1) - @QtCore.Slot() def mail_state_connecting(self): """ Display the correct UI for the connecting state. @@ -440,21 +432,18 @@ class MailStatusWidget(QtGui.QWidget): self._started = True self._set_mail_status(self.tr("Starting..."), 1) - @QtCore.Slot() def mail_state_disconnecting(self): """ Display the correct UI for the connecting state. """ self._set_mail_status(self.tr("Disconnecting..."), 1) - @QtCore.Slot() def mail_state_connected(self): """ Display the correct UI for the connected state. """ self._set_mail_status(self.tr("ON"), 2) - @QtCore.Slot() def mail_state_disabled(self): """ Display the correct UI for the disabled state. @@ -464,7 +453,6 @@ class MailStatusWidget(QtGui.QWidget): self._service_name) self._set_mail_status(status, -1) - @QtCore.Slot() def soledad_invalid_auth_token(self): """ Display the correct UI for the invalid token state diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index b0826303..f5983abb 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -207,7 +207,7 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): self.ui.action_preferences.triggered.connect(self._show_preferences) self.ui.action_about_leap.triggered.connect(self._about) self.ui.action_quit.triggered.connect(self.quit) - self.ui.action_wizard.triggered.connect(self._launch_wizard) + self.ui.action_wizard.triggered.connect(self._show_wizard) self.ui.action_show_logs.triggered.connect(self._show_logger_window) # XXX hide the help menu since it only shows email information and @@ -288,17 +288,7 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): if self._first_run(): self._wizard_firstrun = True - - # HACK FIX: disconnection of signals triggers a reconnection later - # chich segfaults on wizard quit - # self.disconnect_and_untrack() - - self._wizard = Wizard(backend=self._backend, - leap_signaler=self._leap_signaler) - # Give this window time to finish init and then show the wizard - QtDelayedCall(1, self._launch_wizard) - self._wizard.accepted.connect(self._finish_init) - self._wizard.rejected.connect(self._rejected_wizard) + self._show_wizard() else: # during finish_init, we disable the eip start button # so this has to be done after eip_machine is started @@ -346,7 +336,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): # XXX does this goes in here? this will be triggered when the login or # wizard requests provider data - # XXX - here segfaults if we did a disconnect_and_untrack conntrack(sig.prov_check_api_certificate, self._get_provider_details) conntrack(sig.prov_get_details, self._provider_get_details) @@ -402,54 +391,26 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): # TODO: connect this with something # sig.soledad_cancelled_bootstrap.connect() - @QtCore.Slot() - def _rejected_wizard(self): - """ - TRIGGERS: - self._wizard.rejected - - Called if the wizard has been cancelled or closed before - finishing. - This is executed for the first run wizard only. Any other execution of - the wizard won't reach this point. - """ - providers = self._settings.get_configured_providers() - has_provider_on_disk = len(providers) != 0 - if not has_provider_on_disk: - # if we don't have any provider configured (included a pinned - # one) we can't use the application, so quit. - self.quit() - else: - # This happens if the user finishes the provider - # setup but does not register - self._wizard = None - - # HACK FIX: disconnection of signals triggers a reconnection later - # chich segfaults on wizard quit - # self._backend_connect(only_tracked=True) - - if self._wizard_firstrun: - self._finish_init() - - @QtCore.Slot() - def _launch_wizard(self): + def _show_wizard(self): """ TRIGGERS: self.ui.action_wizard.triggered - Also called in first run. + This is called during the Bitmask's first run. - Launches the wizard, creating the object itself if not already - there. + Open the wizard window, hiding the mainwindow window. + This reuses an existing wizard object or creates a new one if needed. """ + # Disconnect signals to avoid conflicts between mainwindow and wizard + # connections + self.disconnect_and_untrack() + if self._wizard is None: - # HACK FIX: disconnection of signals triggers a reconnection later - # chich segfaults on wizard quit - # self.disconnect_and_untrack() self._wizard = Wizard(backend=self._backend, leap_signaler=self._leap_signaler) - self._wizard.accepted.connect(self._finish_init) - self._wizard.rejected.connect(self._rejected_wizard) + self._wizard.accepted.connect(self._wizard_accepted) + self._wizard.rejected.connect(self._wizard_rejected) + self._wizard.finished.connect(self._wizard_finished) self.setVisible(False) # Do NOT use exec_, it will use a child event loop! @@ -457,10 +418,8 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): self._wizard.show() if IS_MAC: self._wizard.raise_() - self._wizard.finished.connect(self._wizard_finished) self._settings.set_skip_first_run(True) - @QtCore.Slot() def _wizard_finished(self): """ TRIGGERS: @@ -469,6 +428,72 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): Called when the wizard has finished. """ self.setVisible(True) + self._backend_connect(only_tracked=True) + + def _wizard_rejected(self): + """ + TRIGGERS: + self._wizard.rejected + + Called if the wizard has been cancelled or closed before finishing. + """ + # NOTE: We need to verify if we have configured providers. + # If not then we should quit + # see self._rejected_wizard() + providers = self._settings.get_configured_providers() + has_provider_on_disk = len(providers) != 0 + if not has_provider_on_disk: + # if we don't have any provider configured (included a pinned + # one) we can't use the application, so quit. + self._wizard = None + self.quit() + else: + # This happens if the user finishes the provider + # setup but does not register + self._wizard = None + + # self._backend_connect(only_tracked=True) + # if self._wizard_firstrun: + # self._finish_init() + + def _wizard_accepted(self): + """ + TRIGGERS: + self._wizard.accepted + + Called when the wizard has accepted. + """ + self.setVisible(True) + self._finish_init() + + def _load_from_wizard(self): + """ + Load the resulting information of the user going through the Wizard. + Trigger the login sequence if needed. + """ + possible_username = self._wizard.get_username() + possible_password = self._wizard.get_password() + + # select the configured provider in the combo box + domain = self._wizard.get_domain() + self._providers.select_provider_by_name(domain) + self._login_widget.set_provider(domain) + + self._login_widget.set_remember(self._wizard.get_remember()) + self._enabled_services = list(self._wizard.get_services()) + self._settings.set_enabled_services( + self._providers.get_selected_provider(), + self._enabled_services) + + if possible_username is not None: + self._login_widget.set_user(possible_username) + if possible_password is not None: + self._login_widget.set_password(possible_password) + self._login() + else: + self.eip_needs_login.emit() + + self._wizard = None def _get_leap_logging_handler(self): """ @@ -485,7 +510,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): return h return None - @QtCore.Slot() def _show_logger_window(self): """ TRIGGERS: @@ -502,7 +526,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): lw = LoggerWindow(self, handler=leap_log_handler) lw.show() - @QtCore.Slot() def _show_AKM(self): """ TRIGGERS: @@ -522,7 +545,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): self._backend, self._soledad_started) akm.show() - @QtCore.Slot() def _show_preferences(self): """ TRIGGERS: @@ -542,7 +564,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): pref_win = PreferencesWindow(self, account, self.app) pref_win.show() - @QtCore.Slot(object, list) def _update_eip_enabled_status(self, account=None, services=None): """ TRIGGER: @@ -649,7 +670,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): # so we must update it, otherwise we're in a deadlock. self._trying_to_start_eip = False - @QtCore.Slot() def _disable_eip_missing_helpers(self): """ TRIGGERS: @@ -672,7 +692,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): """ self.new_updates.emit(req) - @QtCore.Slot(object) def _react_to_new_updates(self, req): """ TRIGGERS: @@ -688,7 +707,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): self.ui.btnMore.setVisible(True) self._updates_content = req.content - @QtCore.Slot() def _updates_details(self): """ TRIGGERS: @@ -716,7 +734,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): self.tr("Updates available"), msg) - @QtCore.Slot() def _finish_init(self): """ TRIGGERS: @@ -729,7 +746,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): the wizard has been executed. """ # XXX: May be this can be divided into two methods? - providers = self._settings.get_configured_providers() self._providers.set_providers(providers) @@ -755,30 +771,7 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): QtDelayedCall(1, self._update_eip_enabled_status) if self._wizard: - possible_username = self._wizard.get_username() - possible_password = self._wizard.get_password() - - # select the configured provider in the combo box - domain = self._wizard.get_domain() - self._providers.select_provider_by_name(domain) - - self._login_widget.set_remember(self._wizard.get_remember()) - self._enabled_services = list(self._wizard.get_services()) - self._settings.set_enabled_services( - self._providers.get_selected_provider(), - self._enabled_services) - if possible_username is not None: - self._login_widget.set_user(possible_username) - if possible_password is not None: - self._login_widget.set_password(possible_password) - self._login() - else: - self.eip_needs_login.emit() - - self._wizard = None - # HACK FIX: disconnection of signals triggers a reconnection later - # chich segfaults on wizard quit - # self._backend_connect(only_tracked=True) + self._load_from_wizard() else: domain = self._settings.get_provider() if domain is not None: @@ -887,7 +880,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): # we wait for the systray to be ready QtDelayedCall(1000, hello) - @QtCore.Slot(int) def _tray_activated(self, reason=None): """ TRIGGERS: @@ -906,7 +898,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): # this works however. context_menu.exec_(self._systray.geometry().center()) - @QtCore.Slot() def _ensure_visible(self): """ TRIGGERS: @@ -925,7 +916,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): self.activateWindow() self.raise_() - @QtCore.Slot() def _ensure_invisible(self): """ TRIGGERS: @@ -961,7 +951,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): if state is not None: self.restoreState(state) - @QtCore.Slot() def _about(self): """ TRIGGERS: @@ -989,7 +978,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): msg = msg.format(ver=VERSION, ver_hash=VERSION_HASH[:10], greet=greet) QtGui.QMessageBox.about(self, title, msg) - @QtCore.Slot() def _help(self): """ TRIGGERS: @@ -1091,7 +1079,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): skip_first_run = self._settings.get_skip_first_run() return not (has_provider_on_disk and skip_first_run) - @QtCore.Slot() def _disconnect_login_wait(self): """ Disconnect the EIP finishing signal to the wait flag on the login @@ -1109,7 +1096,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): # signal not connected pass - @QtCore.Slot(object) def _on_provider_changed(self, wizard=True): """ TRIGGERS: @@ -1132,7 +1118,7 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): if not something_runing: if wizard: - self._launch_wizard() + self._show_wizard() else: self._settings.set_provider(provider) self._settings.set_defaultprovider(provider) @@ -1161,13 +1147,12 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): self._update_eip_enabled_status() self._eip_conductor.qtsigs.do_disconnect_signal.emit() if wizard: - self._launch_wizard() + self._show_wizard() else: if not wizard: # if wizard, the widget restores itself self._providers.restore_previous_provider() - @QtCore.Slot() def _login(self): """ TRIGGERS: @@ -1195,7 +1180,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): self._soledad_started = False - @QtCore.Slot() def _on_user_logged_in(self): """ TRIGGERS: @@ -1224,7 +1208,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): if MX_SERVICE not in self._provider_details['services']: self._set_mx_visible(False) - @QtCore.Slot() def _on_user_logged_out(self): """ TRIGGER: @@ -1253,8 +1236,7 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): self._maybe_start_eip() - @QtCore.Slot() - def _get_provider_details(self): + def _get_provider_details(self, data): """ TRIGGERS: prov_check_api_certificate @@ -1267,7 +1249,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): lang = QtCore.QLocale.system().name() self._backend.provider_get_details(domain=domain, lang=lang) - @QtCore.Slot() def _provider_get_details(self, details): """ Set the details for the just downloaded provider. @@ -1311,7 +1292,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): return eip_enabled and eip_provided - @QtCore.Slot() def _maybe_run_soledad_setup_checks(self): """ TRIGGERS: @@ -1352,7 +1332,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): ################################################################### # Service control methods: soledad - @QtCore.Slot() def _on_soledad_ready(self): """ TRIGGERS: @@ -1367,7 +1346,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): ################################################################### # Service control methods: mail - @QtCore.Slot() def _start_mail_service(self): if self._provides_mx_and_enabled() or flags.OFFLINE: self._mail_conductor.start_mail_service(download_if_needed=True, @@ -1376,14 +1354,12 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): ################################################################### # Service control methods: eip - @QtCore.Slot() def _disable_eip_start_action(self): """ Disable the EIP start action in the systray menu. """ self._action_eip_startstop.setEnabled(False) - @QtCore.Slot() def _enable_eip_start_action(self): """ Enable the EIP start action in the systray menu. @@ -1391,7 +1367,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): self._action_eip_startstop.setEnabled(True) self._eip_status.enable_eip_start() - @QtCore.Slot() def _on_eip_connecting(self): """ TRIGGERS: @@ -1415,7 +1390,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): eip_sigs.connection_aborted_signal.connect(slot) eip_sigs.connection_died_signal.connect(slot) - @QtCore.Slot() def _on_eip_connection_connected(self): """ TRIGGERS: @@ -1435,7 +1409,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): # check for connectivity self._backend.eip_check_dns(domain=domain) - @QtCore.Slot() def _on_eip_connection_disconnected(self): """ TRIGGERS: @@ -1445,7 +1418,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): """ self._already_started_eip = False - @QtCore.Slot() def _set_eip_provider(self, country_code=None): """ TRIGGERS: @@ -1457,7 +1429,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): domain = self._providers.get_selected_provider() self._eip_status.set_provider(domain, country_code) - @QtCore.Slot() def _eip_dns_error(self): """ Trigger this if we don't have a working DNS resolver. @@ -1549,7 +1520,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): # eip will not start, so we start soledad anyway self._maybe_run_soledad_setup_checks() - @QtCore.Slot(dict) def _finish_eip_bootstrap(self, data): """ TRIGGERS: @@ -1570,7 +1540,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): # DO START EIP Connection! self._eip_conductor.do_connect() - @QtCore.Slot(dict) def _eip_intermediate_stage(self, data): # TODO missing param documentation """ @@ -1604,7 +1573,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): locks.raise_window_ack() self.raise_window.emit() - @QtCore.Slot() def _do_raise_mainwindow(self): """ TRIGGERS: @@ -1707,7 +1675,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): logger.debug("Killing backend") psutil.Process(self._backend_pid).kill() - @QtCore.Slot() def _remove_service(self, service): """ Remove the given service from the waiting list and check if we have @@ -1724,7 +1691,6 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): logger.debug("All services stopped.") self.all_services_stopped.emit() - @QtCore.Slot() def final_quit(self): """ Final steps to quit the app, starting from here we don't care about diff --git a/src/leap/bitmask/gui/passwordwindow.py b/src/leap/bitmask/gui/passwordwindow.py index f7ef079e..88565829 100644 --- a/src/leap/bitmask/gui/passwordwindow.py +++ b/src/leap/bitmask/gui/passwordwindow.py @@ -149,7 +149,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): """ TRIGGERS: @@ -194,7 +193,6 @@ class PasswordWindow(QtGui.QDialog, Flashable): PasswordWindow._current_window = None self.deleteLater() - @QtCore.Slot() def _srp_change_password_ok(self): """ TRIGGERS: @@ -210,7 +208,6 @@ class PasswordWindow(QtGui.QDialog, Flashable): else: self._change_password_success() - @QtCore.Slot() def _srp_password_change_error(self): """ TRIGGERS: @@ -223,7 +220,6 @@ class PasswordWindow(QtGui.QDialog, Flashable): self._enable_password_widgets(True) self.flash_error(msg) - @QtCore.Slot() def _srp_password_change_badpw(self): """ TRIGGERS: @@ -237,7 +233,6 @@ class PasswordWindow(QtGui.QDialog, Flashable): self.flash_error(msg) self.ui.current_password_lineedit.setFocus() - @QtCore.Slot() def _soledad_change_password_ok(self): """ TRIGGERS: @@ -248,7 +243,6 @@ class PasswordWindow(QtGui.QDialog, Flashable): logger.debug("Soledad password changed successfully.") self._change_password_success() - @QtCore.Slot(unicode) def _soledad_change_password_problem(self, msg): """ TRIGGERS: @@ -263,7 +257,6 @@ class PasswordWindow(QtGui.QDialog, Flashable): self._enable_password_widgets(True) self.flash_error(msg) - @QtCore.Slot() def _on_soledad_ready(self): """ TRIGGERS: diff --git a/src/leap/bitmask/gui/preferences_account_page.py b/src/leap/bitmask/gui/preferences_account_page.py index ec6a7716..cab90eec 100644 --- a/src/leap/bitmask/gui/preferences_account_page.py +++ b/src/leap/bitmask/gui/preferences_account_page.py @@ -63,7 +63,6 @@ class PreferencesAccountPage(QtGui.QWidget): self.ui.change_password_label.setVisible(True) self.ui.change_password_button.setEnabled(False) - @QtCore.Slot(str, int) def _service_selection_changed(self, service, state): """ TRIGGERS: @@ -94,7 +93,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): """ TRIGGERS: @@ -133,7 +131,6 @@ class PreferencesAccountPage(QtGui.QWidget): logger.error("Something went wrong while trying to " "load service %s" % (service,)) - @QtCore.Slot() 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_vpn_page.py b/src/leap/bitmask/gui/preferences_vpn_page.py index 901116b4..5b5c9604 100644 --- a/src/leap/bitmask/gui/preferences_vpn_page.py +++ b/src/leap/bitmask/gui/preferences_vpn_page.py @@ -64,7 +64,6 @@ class PreferencesVpnPage(QtGui.QWidget, Flashable): # Trigger update self.app.backend.eip_get_gateways_list(domain=self.account.domain) - @QtCore.Slot(str) def _save_selected_gateway(self, index): """ TRIGGERS: @@ -86,7 +85,6 @@ class PreferencesVpnPage(QtGui.QWidget, Flashable): provider=self.account.domain, gateway=gateway) - @QtCore.Slot(list) def _update_gateways_list(self, gateways): """ TRIGGERS: @@ -116,7 +114,6 @@ class PreferencesVpnPage(QtGui.QWidget, Flashable): index = idx + 1 self.ui.gateways_list.setCurrentRow(index) - @QtCore.Slot() def _gateways_list_error(self): """ TRIGGERS: @@ -129,7 +126,6 @@ class PreferencesVpnPage(QtGui.QWidget, Flashable): self.tr("Error loading configuration file.")) self.ui.gateways_list.setEnabled(False) - @QtCore.Slot() def _gateways_list_uninitialized(self): """ TRIGGERS: diff --git a/src/leap/bitmask/gui/preferenceswindow.py b/src/leap/bitmask/gui/preferenceswindow.py index f1252301..daad08b0 100644 --- a/src/leap/bitmask/gui/preferenceswindow.py +++ b/src/leap/bitmask/gui/preferenceswindow.py @@ -152,7 +152,6 @@ class PreferencesWindow(QtGui.QDialog): self._email_page.deleteLater() self.deleteLater() - @QtCore.Slot() def _change_page(self, current, previous): """ TRIGGERS: @@ -170,7 +169,6 @@ class PreferencesWindow(QtGui.QDialog): current = previous self.ui.pages_widget.setCurrentIndex(self.ui.nav_widget.row(current)) - @QtCore.Slot(object, list) def _update_icons(self, account, services): """ TRIGGERS: diff --git a/src/leap/bitmask/gui/providers.py b/src/leap/bitmask/gui/providers.py index 6954411f..4a6f961a 100644 --- a/src/leap/bitmask/gui/providers.py +++ b/src/leap/bitmask/gui/providers.py @@ -98,7 +98,6 @@ class Providers(QtCore.QObject): self._combo.setCurrentIndex(prev_provider) self._combo.blockSignals(False) - @QtCore.Slot(int) def _current_provider_changed(self, idx): """ TRIGGERS: diff --git a/src/leap/bitmask/gui/signaltracker.py b/src/leap/bitmask/gui/signaltracker.py index c83359c4..0e3b2dce 100644 --- a/src/leap/bitmask/gui/signaltracker.py +++ b/src/leap/bitmask/gui/signaltracker.py @@ -57,7 +57,6 @@ class SignalTracker(QtCore.QObject): try: signal.disconnect(method) except (TypeError, RuntimeError) as e: - # most likely the signal was not connected logger.warning("Disconnect error: {0!r}".format(e)) logger.warning("Signal: {0!r} -> {1!r}".format(signal, method)) diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index 35043a68..5da021d1 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -82,9 +82,8 @@ class Wizard(QtGui.QWizard, SignalTracker): self._use_existing_provider = False self.ui.grpCheckProvider.setVisible(False) - conntrack = self.connect_and_track - conntrack(self.ui.btnCheck.clicked, self._check_provider) - conntrack(self.ui.lnProvider.returnPressed, self._check_provider) + self.ui.btnCheck.clicked.connect(self._check_provider) + self.ui.lnProvider.returnPressed.connect(self._check_provider) self._leap_signaler = leap_signaler @@ -96,22 +95,19 @@ class Wizard(QtGui.QWizard, SignalTracker): # this details are set when the provider download is complete. self._provider_details = None - conntrack(self.currentIdChanged, self._current_id_changed) + self.currentIdChanged.connect(self._current_id_changed) - conntrack(self.ui.lnProvider.textChanged, self._enable_check) - conntrack(self.ui.rbNewProvider.toggled, - lambda x: self._enable_check()) - conntrack(self.ui.cbProviders.currentIndexChanged[int], - self._reset_provider_check) + self.ui.lnProvider.textChanged.connect(self._enable_check) + self.ui.rbNewProvider.toggled.connect(lambda x: self._enable_check()) + self.ui.cbProviders.currentIndexChanged[int].connect( + self._reset_provider_check) - conntrack(self.ui.lblUser.returnPressed, self._focus_password) - conntrack(self.ui.lblPassword.returnPressed, - self._focus_second_password) - conntrack(self.ui.lblPassword2.returnPressed, self._register) - conntrack(self.ui.btnRegister.clicked, self._register) + self.ui.lblUser.returnPressed.connect(self._focus_password) + self.ui.lblPassword.returnPressed.connect(self._focus_second_password) + self.ui.lblPassword2.returnPressed.connect(self._register) + self.ui.btnRegister.clicked.connect(self._register) - conntrack(self.ui.rbExistingProvider.toggled, - self._skip_provider_checks) + self.ui.rbExistingProvider.toggled.connect(self._skip_provider_checks) usernameRe = QtCore.QRegExp(USERNAME_REGEX) self.ui.lblUser.setValidator( @@ -136,9 +132,8 @@ class Wizard(QtGui.QWizard, SignalTracker): self._provider_checks_ok = False self._provider_setup_ok = False - conntrack(self.finished, self._wizard_finished) + self.finished.connect(self._wizard_finished) - @QtCore.Slot() def _wizard_finished(self): """ TRIGGERS: @@ -152,8 +147,7 @@ class Wizard(QtGui.QWizard, SignalTracker): self._provider_setup_ok = False self.ui.lnProvider.setText('') self.ui.grpCheckProvider.setVisible(False) - # HACK FIX: disconnection of signals triggers a segfault on quit - # self.disconnect_and_untrack() + self.disconnect_and_untrack() def _load_configured_providers(self): """ @@ -250,7 +244,6 @@ class Wizard(QtGui.QWizard, SignalTracker): def get_services(self): return self._selected_services - @QtCore.Slot(unicode) def _enable_check(self, reset=True): """ TRIGGERS: @@ -340,7 +333,6 @@ class Wizard(QtGui.QWizard, SignalTracker): # register button self.ui.btnRegister.setVisible(visible) - @QtCore.Slot() def _registration_finished(self): """ TRIGGERS: @@ -366,7 +358,6 @@ class Wizard(QtGui.QWizard, SignalTracker): self.page(self.REGISTER_USER_PAGE).set_completed() self.button(QtGui.QWizard.BackButton).setEnabled(False) - @QtCore.Slot() def _registration_failed(self): """ TRIGGERS: @@ -380,7 +371,6 @@ class Wizard(QtGui.QWizard, SignalTracker): self._set_register_status(error_msg, error=True) self.ui.btnRegister.setEnabled(True) - @QtCore.Slot() def _registration_taken(self): """ TRIGGERS: @@ -427,7 +417,6 @@ class Wizard(QtGui.QWizard, SignalTracker): self.ui.lblCheckCaFpr.setPixmap(None) self.ui.lblCheckApiCert.setPixmap(None) - @QtCore.Slot() def _check_provider(self): """ TRIGGERS: @@ -461,7 +450,6 @@ class Wizard(QtGui.QWizard, SignalTracker): self.ui.lblNameResolution.setPixmap(self.QUESTION_ICON) self._backend.provider_setup(provider=self._domain) - @QtCore.Slot(bool) def _skip_provider_checks(self, skip): """ TRIGGERS: @@ -505,7 +493,6 @@ class Wizard(QtGui.QWizard, SignalTracker): label.setPixmap(self.ERROR_ICON) logger.error(error) - @QtCore.Slot(dict) def _name_resolution(self, data): """ TRIGGERS: @@ -525,7 +512,6 @@ class Wizard(QtGui.QWizard, SignalTracker): self.ui.btnCheck.setEnabled(not passed) self.ui.lnProvider.setEnabled(not passed) - @QtCore.Slot(dict) def _https_connection(self, data): """ TRIGGERS: @@ -545,7 +531,6 @@ class Wizard(QtGui.QWizard, SignalTracker): self.ui.btnCheck.setEnabled(not passed) self.ui.lnProvider.setEnabled(not passed) - @QtCore.Slot(dict) def _download_provider_info(self, data): """ TRIGGERS: @@ -581,7 +566,6 @@ class Wizard(QtGui.QWizard, SignalTracker): else: self.ui.cbProviders.setEnabled(True) - @QtCore.Slot() def _provider_get_details(self, details): """ Set the details for the just downloaded provider. @@ -591,7 +575,6 @@ class Wizard(QtGui.QWizard, SignalTracker): """ self._provider_details = details - @QtCore.Slot(dict) def _download_ca_cert(self, data): """ TRIGGERS: @@ -604,7 +587,6 @@ class Wizard(QtGui.QWizard, SignalTracker): if passed: self.ui.lblCheckCaFpr.setPixmap(self.QUESTION_ICON) - @QtCore.Slot(dict) def _check_ca_fingerprint(self, data): """ TRIGGERS: @@ -617,7 +599,6 @@ class Wizard(QtGui.QWizard, SignalTracker): if passed: self.ui.lblCheckApiCert.setPixmap(self.QUESTION_ICON) - @QtCore.Slot(dict) def _check_api_certificate(self, data): """ TRIGGERS: @@ -631,7 +612,6 @@ class Wizard(QtGui.QWizard, SignalTracker): True, self.SETUP_PROVIDER_PAGE) self._provider_setup_ok = True - @QtCore.Slot(str, int) def _service_selection_changed(self, service, state): """ TRIGGERS: @@ -680,7 +660,6 @@ class Wizard(QtGui.QWizard, SignalTracker): self.tr("Something went wrong while trying to " "load service %s" % (service,))) - @QtCore.Slot(int) def _current_id_changed(self, pageId): """ TRIGGERS: |