From def537bb5a78e046a75a9e13ea75449eec2b34c8 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Wed, 16 Apr 2014 14:48:53 -0300 Subject: Use Slot decorator instead of SLOT docstring. --- src/leap/bitmask/gui/eip_preferenceswindow.py | 12 ++--- src/leap/bitmask/gui/eip_status.py | 6 +-- src/leap/bitmask/gui/login.py | 2 +- src/leap/bitmask/gui/mail_status.py | 12 ++--- src/leap/bitmask/gui/mainwindow.py | 75 ++++++++++++--------------- src/leap/bitmask/gui/preferenceswindow.py | 18 +++---- src/leap/bitmask/gui/wizard.py | 30 +++++------ src/leap/bitmask/services/mail/conductor.py | 3 +- 8 files changed, 73 insertions(+), 85 deletions(-) diff --git a/src/leap/bitmask/gui/eip_preferenceswindow.py b/src/leap/bitmask/gui/eip_preferenceswindow.py index baf17395..fd2d3c5d 100644 --- a/src/leap/bitmask/gui/eip_preferenceswindow.py +++ b/src/leap/bitmask/gui/eip_preferenceswindow.py @@ -98,9 +98,9 @@ class EIPPreferencesWindow(QtGui.QDialog): self._backend.eip_get_initialized_providers(providers) + @QtCore.Slot(list) def _load_providers_in_combo(self, providers): """ - SLOT TRIGGERS: Signaler.eip_get_initialized_providers @@ -128,9 +128,9 @@ class EIPPreferencesWindow(QtGui.QDialog): domain, QtCore.Qt.MatchStartsWith) self.ui.cbProvidersGateway.setCurrentIndex(provider_index) + @QtCore.Slot(str) def _save_selected_gateway(self, provider): """ - SLOT TRIGGERS: self.ui.pbSaveGateway.clicked @@ -153,9 +153,9 @@ 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): """ - SLOT TRIGGERS: self.ui.cbProvidersGateway.currentIndexChanged[unicode] @@ -176,9 +176,9 @@ class EIPPreferencesWindow(QtGui.QDialog): self._backend.eip_get_gateways_list(domain) + @QtCore.Slot(list) def _update_gateways_list(self, gateways): """ - SLOT TRIGGERS: Signaler.eip_get_gateways_list @@ -214,9 +214,9 @@ class EIPPreferencesWindow(QtGui.QDialog): self.ui.cbGateways.setCurrentIndex(index) + @QtCore.Slot() def _gateways_list_error(self): """ - SLOT TRIGGERS: Signaler.eip_get_gateways_list_error @@ -229,9 +229,9 @@ class EIPPreferencesWindow(QtGui.QDialog): self.ui.pbSaveGateway.setEnabled(False) self.ui.cbGateways.setEnabled(False) + @QtCore.Slot() def _gateways_list_uninitialized(self): """ - SLOT TRIGGERS: Signaler.eip_uninitialized_provider diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py index f24d87c7..2ced7dc7 100644 --- a/src/leap/bitmask/gui/eip_status.py +++ b/src/leap/bitmask/gui/eip_status.py @@ -88,9 +88,9 @@ class EIPStatusWidget(QtGui.QWidget): self.ui.btnUpload.clicked.connect(onclicked) self.ui.btnDownload.clicked.connect(onclicked) + @QtCore.Slot() def _on_VPN_status_clicked(self): """ - SLOT TRIGGER: self.ui.btnUpload.clicked self.ui.btnDownload.clicked @@ -347,9 +347,9 @@ class EIPStatusWidget(QtGui.QWidget): self.tr("Traffic is being routed in the clear")) self.ui.lblEIPStatus.show() + @QtCore.Slot(dict) def update_vpn_status(self, data=None): """ - SLOT TRIGGER: Signaler.eip_status_changed Updates the download/upload labels based on the data provided by the @@ -381,9 +381,9 @@ 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): """ - SLOT TRIGGER: Signaler.eip_state_changed Updates the displayed VPN state based on the data provided by diff --git a/src/leap/bitmask/gui/login.py b/src/leap/bitmask/gui/login.py index 4a483c32..4a9626a6 100644 --- a/src/leap/bitmask/gui/login.py +++ b/src/leap/bitmask/gui/login.py @@ -260,8 +260,8 @@ class LoginWidget(QtGui.QWidget): self.ui.lnPassword.setFocus() def _current_provider_changed(self, param): + @QtCore.Slot(int) """ - SLOT TRIGGERS: self.ui.cmbProviders.currentIndexChanged """ if param == (self.ui.cmbProviders.count() - 1): diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py index 44a138e2..059e5d68 100644 --- a/src/leap/bitmask/gui/mail_status.py +++ b/src/leap/bitmask/gui/mail_status.py @@ -184,9 +184,9 @@ 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): """ - SLOT TRIGGER: SoledadBootstrapper.soledad_failed @@ -195,9 +195,9 @@ 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): """ - SLOT TRIGGER: SoledadBootstrapper.soledad_invalid_token @@ -250,9 +250,9 @@ class MailStatusWidget(QtGui.QWidget): """ self._soledad_event.emit(req) + @QtCore.Slot(object) def _mail_handle_soledad_events_slot(self, req): """ - SLOT TRIGGER: _mail_handle_soledad_events Reacts to an Soledad event @@ -284,9 +284,9 @@ class MailStatusWidget(QtGui.QWidget): """ self._keymanager_event.emit(req) + @QtCore.Slot(object) def _mail_handle_keymanager_events_slot(self, req): """ - SLOT TRIGGER: _mail_handle_keymanager_events Reacts to an KeyManager event @@ -330,9 +330,9 @@ class MailStatusWidget(QtGui.QWidget): """ self._smtp_event.emit(req) + @QtCore.Slot(object) def _mail_handle_smtp_events_slot(self, req): """ - SLOT TRIGGER: _mail_handle_smtp_events Reacts to an SMTP event @@ -364,9 +364,9 @@ class MailStatusWidget(QtGui.QWidget): """ self._imap_event.emit(req) + @QtCore.Slot(object) def _mail_handle_imap_events_slot(self, req): """ - SLOT TRIGGER: _mail_handle_imap_events Reacts to an IMAP event diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index e5c11eb7..6bdfe7c0 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -457,9 +457,9 @@ class MainWindow(QtGui.QMainWindow): self._backend_connected_signals = {} + @QtCore.Slot() def _rejected_wizard(self): """ - SLOT TRIGGERS: self._wizard.rejected Called if the wizard has been cancelled or closed before @@ -481,9 +481,9 @@ class MainWindow(QtGui.QMainWindow): if self._wizard_firstrun: self._finish_init() + @QtCore.Slot() def _launch_wizard(self): """ - SLOT TRIGGERS: self._login_widget.show_wizard self.ui.action_wizard.triggered @@ -509,9 +509,9 @@ class MainWindow(QtGui.QMainWindow): self._wizard.finished.connect(self._wizard_finished) self._settings.set_skip_first_run(True) + @QtCore.Slot() def _wizard_finished(self): """ - SLOT TRIGGERS self._wizard.finished @@ -534,9 +534,9 @@ class MainWindow(QtGui.QMainWindow): return h return None + @QtCore.Slot() def _show_logger_window(self): """ - SLOT TRIGGERS: self.ui.action_show_logs.triggered @@ -555,9 +555,9 @@ class MainWindow(QtGui.QMainWindow): else: self._logger_window.setVisible(not self._logger_window.isVisible()) + @QtCore.Slot() def _show_AKM(self): """ - SLOT TRIGGERS: self.ui.action_advanced_key_management.triggered @@ -569,9 +569,9 @@ class MainWindow(QtGui.QMainWindow): logged_user, self._keymanager, self._soledad) self._akm.show() + @QtCore.Slot() def _show_preferences(self): """ - SLOT TRIGGERS: self.ui.btnPreferences.clicked (disabled for now) self.ui.action_preferences @@ -586,9 +586,9 @@ class MainWindow(QtGui.QMainWindow): preferences.show() preferences.preferences_saved.connect(self._update_eip_enabled_status) + @QtCore.Slot() def _update_eip_enabled_status(self): """ - SLOT TRIGGER: PreferencesWindow.preferences_saved @@ -622,9 +622,9 @@ class MainWindow(QtGui.QMainWindow): return eip_enabled + @QtCore.Slot() def _show_eip_preferences(self): """ - SLOT TRIGGERS: self.ui.btnEIPPreferences.clicked self.ui.action_eip_preferences (disabled for now) @@ -647,9 +647,9 @@ class MainWindow(QtGui.QMainWindow): """ self.new_updates.emit(req) + @QtCore.Slot(object) def _react_to_new_updates(self, req): """ - SLOT TRIGGER: self._new_updates_available Displays the new updates label and sets the updates_content @@ -659,9 +659,9 @@ class MainWindow(QtGui.QMainWindow): self.ui.btnMore.setVisible(True) self._updates_content = req.content + @QtCore.Slot() def _updates_details(self): """ - SLOT TRIGGER: self.ui.btnMore.clicked Parses and displays the updates details @@ -686,9 +686,9 @@ class MainWindow(QtGui.QMainWindow): self.tr("Updates available"), msg) + @QtCore.Slot() def _finish_init(self): """ - SLOT TRIGGERS: self._wizard.accepted @@ -832,9 +832,9 @@ class MainWindow(QtGui.QMainWindow): # we wait for the systray to be ready reactor.callLater(1, hello) + @QtCore.Slot(int) def _tray_activated(self, reason=None): """ - SLOT TRIGGER: self._systray.activated Displays the context menu from the tray icon @@ -862,9 +862,9 @@ class MainWindow(QtGui.QMainWindow): visible = self.isVisible() and self.isActiveWindow() self._action_visible.setText(get_action(visible)) + @QtCore.Slot() def _toggle_visible(self): """ - SLOT TRIGGER: self._action_visible.triggered Toggles the window visibility @@ -909,9 +909,9 @@ class MainWindow(QtGui.QMainWindow): if state is not None: self.restoreState(state) + @QtCore.Slot() def _about(self): """ - SLOT TRIGGERS: self.ui.action_about_leap.triggered Display the About Bitmask dialog @@ -936,9 +936,9 @@ class MainWindow(QtGui.QMainWindow): "More about LEAP" "") % (VERSION, VERSION_HASH[:10], greet)) + @QtCore.Slot() def _help(self): """ - SLOT TRIGGERS: self.ui.action_help.triggered Display the Bitmask help dialog. @@ -1036,9 +1036,9 @@ class MainWindow(QtGui.QMainWindow): provider = self._login_widget.get_selected_provider() self._backend.setup_provider(provider) + @QtCore.Slot(dict) def _load_provider_config(self, data): """ - SLOT TRIGGER: self._backend.signaler.prov_download_provider_info Once the provider config has been downloaded, this loads the @@ -1064,9 +1064,9 @@ class MainWindow(QtGui.QMainWindow): self.tr("Unable to login: Problem with provider")) self._login_widget.set_enabled(True) + @QtCore.Slot() def _login(self): """ - SLOT TRIGGERS: self._login_widget.login @@ -1092,9 +1092,9 @@ class MainWindow(QtGui.QMainWindow): if self._login_widget.start_login(): self._download_provider_config() + @QtCore.Slot(unicode) def _authentication_error(self, msg): """ - SLOT TRIGGERS: Signaler.srp_auth_error Signaler.srp_auth_server_error @@ -1110,9 +1110,9 @@ class MainWindow(QtGui.QMainWindow): self._login_widget.set_enabled(True) self.ui.action_create_new_account.setEnabled(True) + @QtCore.Slot() def _cancel_login(self): """ - SLOT TRIGGERS: self._login_widget.cancel_login @@ -1134,9 +1134,9 @@ class MainWindow(QtGui.QMainWindow): self._soledad_defer.cancel() self._soledad_defer = None + @QtCore.Slot() def _set_login_cancelled(self): """ - SLOT TRIGGERS: Signaler.prov_cancelled_setup fired by self._backend.cancel_setup_provider() @@ -1147,9 +1147,9 @@ class MainWindow(QtGui.QMainWindow): self._login_widget.set_status(self.tr("Log in cancelled by the user.")) self._login_widget.set_enabled(True) + @QtCore.Slot(dict) def _provider_config_loaded(self, data): """ - SLOT TRIGGER: self._backend.signaler.prov_check_api_certificate Once the provider configuration is loaded, this starts the SRP @@ -1171,9 +1171,9 @@ class MainWindow(QtGui.QMainWindow): logger.error(data[self._backend.ERROR_KEY]) self._login_widget.set_enabled(True) + @QtCore.Slot() def _authentication_finished(self): """ - SLOT TRIGGER: self._srp_auth.authentication_finished Once the user is properly authenticated, try starting the EIP @@ -1285,10 +1285,10 @@ class MainWindow(QtGui.QMainWindow): ################################################################### # Service control methods: soledad + @QtCore.Slot(dict) def _soledad_intermediate_stage(self, data): # TODO missing param docstring """ - SLOT TRIGGERS: self._soledad_bootstrapper.download_config @@ -1320,9 +1320,9 @@ class MainWindow(QtGui.QMainWindow): logger.warning("Max number of soledad initialization " "retries reached.") + @QtCore.Slot(dict) def _soledad_bootstrapped_stage(self, data): """ - SLOT TRIGGERS: self._soledad_bootstrapper.gen_key self._soledad_bootstrapper.local_only_ready @@ -1364,7 +1364,6 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _start_smtp_bootstrapping(self): """ - SLOT TRIGGERS: self.soledad_ready """ @@ -1385,7 +1384,6 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _stop_smtp_service(self): """ - SLOT TRIGGERS: self.logout """ @@ -1398,7 +1396,6 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _start_imap_service(self): """ - SLOT TRIGGERS: self.soledad_ready """ @@ -1428,7 +1425,6 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _fetch_incoming_mail(self): """ - SLOT TRIGGERS: self.mail_client_logged_in """ @@ -1438,7 +1434,6 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _stop_imap_service(self): """ - SLOT TRIGGERS: self.logout """ @@ -1487,7 +1482,6 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _on_eip_connection_connected(self): """ - SLOT TRIGGERS: self._eip_status.eip_connection_connected Emits the EIPConnection.qtsigs.connected_signal @@ -1589,9 +1583,9 @@ class MainWindow(QtGui.QMainWindow): self._backend.start_eip() + @QtCore.Slot() def _on_eip_connection_aborted(self): """ - SLOT TRIGGERS: Signaler.eip_connection_aborted """ @@ -1667,7 +1661,6 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _stop_eip(self): """ - SLOT TRIGGERS: self._eip_connection.qtsigs.do_disconnect_signal (via state machine) @@ -1697,7 +1690,6 @@ class MainWindow(QtGui.QMainWindow): def _on_eip_network_unreachable(self): # XXX Should move to EIP Conductor """ - SLOT TRIGGERS: self._eip_connection.qtsigs.network_unreachable @@ -1711,7 +1703,7 @@ class MainWindow(QtGui.QMainWindow): def _do_eip_restart(self): # XXX Should move to EIP Conductor """ - SLOT + TRIGGER: self._eip_connection.qtsigs.process_restart Restart the connection. @@ -1729,9 +1721,9 @@ class MainWindow(QtGui.QMainWindow): self._eip_status.set_eip_status("", error=error) self._eip_status.set_eip_status_icon("error") + @QtCore.Slot(int) def _eip_finished(self, exitCode): """ - SLOT TRIGGERS: Signaler.eip_process_finished @@ -1822,9 +1814,9 @@ class MainWindow(QtGui.QMainWindow): # eip will not start, so we start soledad anyway self._maybe_run_soledad_setup_checks() + @QtCore.Slot(dict) def _finish_eip_bootstrap(self, data): """ - SLOT TRIGGER: self._backend.signaler.eip_client_certificate_ready Starts the VPN thread if the eip configuration is properly @@ -1842,10 +1834,10 @@ class MainWindow(QtGui.QMainWindow): # DO START EIP Connection! self._eip_connection.qtsigs.do_connect_signal.emit() + @QtCore.Slot(dict) def _eip_intermediate_stage(self, data): # TODO missing param """ - SLOT TRIGGERS: self._backend.signaler.eip_config_ready @@ -1889,7 +1881,6 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _logout(self): """ - SLOT TRIGGER: self._login_widget.logout Starts the logout sequence @@ -1907,9 +1898,9 @@ class MainWindow(QtGui.QMainWindow): self._backend.logout() self.logout.emit() + @QtCore.Slot() def _logout_error(self): """ - SLOT TRIGGER: self._srp_auth.logout_error Inform the user about a logout error. @@ -1919,9 +1910,9 @@ class MainWindow(QtGui.QMainWindow): self._login_widget.set_status( self.tr("Something went wrong with the logout.")) + @QtCore.Slot() def _logout_ok(self): """ - SLOT TRIGGER: self._srp_auth.logout_ok Switches the stackedWidget back to the login stage after @@ -1934,10 +1925,10 @@ class MainWindow(QtGui.QMainWindow): self._login_widget.logged_out() self._mail_status.mail_state_disabled() + @QtCore.Slot(dict) def _intermediate_stage(self, data): # TODO this method name is confusing as hell. """ - SLOT TRIGGERS: self._backend.signaler.prov_name_resolution self._backend.signaler.prov_https_connection @@ -1967,9 +1958,9 @@ class MainWindow(QtGui.QMainWindow): raise_window_ack() self.raise_window.emit() + @QtCore.Slot() def _do_raise_mainwindow(self): """ - SLOT TRIGGERS: self._on_raise_window_event diff --git a/src/leap/bitmask/gui/preferenceswindow.py b/src/leap/bitmask/gui/preferenceswindow.py index f6bd1ed3..111ec6d2 100644 --- a/src/leap/bitmask/gui/preferenceswindow.py +++ b/src/leap/bitmask/gui/preferenceswindow.py @@ -89,9 +89,9 @@ class PreferencesWindow(QtGui.QDialog): self._select_provider_by_name(domain) + @QtCore.Slot() def _is_logged_in(self): """ - SLOT TRIGGERS: Signaler.srp_status_logged_in @@ -123,9 +123,9 @@ class PreferencesWindow(QtGui.QDialog): self.ui.gbPasswordChange.setEnabled(pw_enabled) + @QtCore.Slot() def _not_logged_in(self): """ - SLOT TRIGGERS: Signaler.srp_status_not_logged_in @@ -136,9 +136,9 @@ class PreferencesWindow(QtGui.QDialog): self._set_password_change_status(msg) self.ui.gbPasswordChange.setEnabled(False) + @QtCore.Slot() def set_soledad_ready(self): """ - SLOT TRIGGERS: parent.soledad_ready @@ -183,9 +183,9 @@ class PreferencesWindow(QtGui.QDialog): self.ui.leNewPassword2.setEnabled(not disable) self.ui.pbChangePassword.setEnabled(not disable) + @QtCore.Slot() def _change_password(self): """ - SLOT TRIGGERS: self.ui.pbChangePassword.clicked @@ -207,9 +207,9 @@ class PreferencesWindow(QtGui.QDialog): self._set_changing_password(True) self._backend.change_password(current_password, new_password) + @QtCore.Slot() def _change_password_ok(self): """ - SLOT TRIGGERS: self._backend.signaler.srp_password_change_ok @@ -229,9 +229,9 @@ class PreferencesWindow(QtGui.QDialog): self._clear_password_inputs() self._set_changing_password(False) + @QtCore.Slot(unicode) def _change_password_problem(self, msg): """ - SLOT TRIGGERS: self._backend.signaler.srp_password_change_error self._backend.signaler.srp_password_change_badpw @@ -287,9 +287,9 @@ class PreferencesWindow(QtGui.QDialog): provider_index = self.ui.cbProvidersServices.findText(name) self.ui.cbProvidersServices.setCurrentIndex(provider_index) + @QtCore.Slot(str, int) def _service_selection_changed(self, service, state): """ - SLOT TRIGGER: service_checkbox.stateChanged Adds the service to the state if the state is checked, removes it otherwise @@ -309,9 +309,9 @@ class PreferencesWindow(QtGui.QDialog): # We hide the maybe-visible status label after a change self.ui.lblProvidersServicesStatus.setVisible(False) + @QtCore.Slot(str) def _populate_services(self, domain): """ - SLOT TRIGGERS: self.ui.cbProvidersServices.currentIndexChanged[unicode] @@ -368,9 +368,9 @@ class PreferencesWindow(QtGui.QDialog): logger.error("Something went wrong while trying to " "load service %s" % (service,)) + @QtCore.Slot(str) def _save_enabled_services(self, provider): """ - SLOT TRIGGERS: self.ui.pbSaveServices.clicked diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index ebcee400..52cbab48 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -145,7 +145,6 @@ class Wizard(QtGui.QWizard): @QtCore.Slot() def _wizard_finished(self): """ - SLOT TRIGGER: self.finished @@ -210,10 +209,9 @@ class Wizard(QtGui.QWizard): def get_services(self): return self._selected_services - @QtCore.Slot() + @QtCore.Slot(unicode) def _enable_check(self, reset=True): """ - SLOT TRIGGER: self.ui.lnProvider.textChanged @@ -282,9 +280,9 @@ class Wizard(QtGui.QWizard): # register button self.ui.btnRegister.setVisible(visible) + @QtCore.Slot() def _registration_finished(self): """ - SLOT TRIGGERS: self._backend.signaler.srp_registration_finished @@ -308,9 +306,9 @@ class Wizard(QtGui.QWizard): self.page(self.REGISTER_USER_PAGE).set_completed() self.button(QtGui.QWizard.BackButton).setEnabled(False) + @QtCore.Slot() def _registration_failed(self): """ - SLOT TRIGGERS: self._backend.signaler.srp_registration_failed @@ -322,9 +320,9 @@ class Wizard(QtGui.QWizard): self._set_register_status(error_msg, error=True) self.ui.btnRegister.setEnabled(True) + @QtCore.Slot() def _registration_taken(self): """ - SLOT TRIGGERS: self._backend.signaler.srp_registration_taken @@ -368,9 +366,9 @@ class Wizard(QtGui.QWizard): self.ui.lblCheckCaFpr.setPixmap(None) self.ui.lblCheckApiCert.setPixmap(None) + @QtCore.Slot() def _check_provider(self): """ - SLOT TRIGGERS: self.ui.btnCheck.clicked self.ui.lnProvider.returnPressed @@ -403,9 +401,9 @@ class Wizard(QtGui.QWizard): self._provider_select_defer = self._backend.\ setup_provider(self._domain) + @QtCore.Slot(bool) def _skip_provider_checks(self, skip): """ - SLOT Triggered: self.ui.rbExistingProvider.toggled @@ -447,9 +445,9 @@ class Wizard(QtGui.QWizard): label.setPixmap(self.ERROR_ICON) logger.error(error) + @QtCore.Slot(dict) def _name_resolution(self, data): """ - SLOT TRIGGER: self._backend.signaler.prov_name_resolution Sets the status for the name resolution check @@ -466,9 +464,9 @@ class Wizard(QtGui.QWizard): self.ui.btnCheck.setEnabled(not passed) self.ui.lnProvider.setEnabled(not passed) + @QtCore.Slot(dict) def _https_connection(self, data): """ - SLOT TRIGGER: self._backend.signaler.prov_https_connection Sets the status for the https connection check @@ -485,9 +483,9 @@ class Wizard(QtGui.QWizard): self.ui.btnCheck.setEnabled(not passed) self.ui.lnProvider.setEnabled(not passed) + @QtCore.Slot(dict) def _download_provider_info(self, data): """ - SLOT TRIGGER: self._backend.signaler.prov_download_provider_info Sets the status for the provider information download @@ -519,9 +517,9 @@ class Wizard(QtGui.QWizard): else: self.ui.cbProviders.setEnabled(True) + @QtCore.Slot(dict) def _download_ca_cert(self, data): """ - SLOT TRIGGER: self._backend.signaler.prov_download_ca_cert Sets the status for the download of the CA certificate check @@ -531,9 +529,9 @@ class Wizard(QtGui.QWizard): if passed: self.ui.lblCheckCaFpr.setPixmap(self.QUESTION_ICON) + @QtCore.Slot(dict) def _check_ca_fingerprint(self, data): """ - SLOT TRIGGER: self._backend.signaler.prov_check_ca_fingerprint Sets the status for the CA fingerprint check @@ -543,9 +541,9 @@ class Wizard(QtGui.QWizard): if passed: self.ui.lblCheckApiCert.setPixmap(self.QUESTION_ICON) + @QtCore.Slot(dict) def _check_api_certificate(self, data): """ - SLOT TRIGGER: self._backend.signaler.prov_check_api_certificate Sets the status for the API certificate check. Also finishes @@ -556,9 +554,9 @@ class Wizard(QtGui.QWizard): True, self.SETUP_PROVIDER_PAGE) self._provider_setup_ok = True + @QtCore.Slot(str, int) def _service_selection_changed(self, service, state): """ - SLOT TRIGGER: service_checkbox.stateChanged Adds the service to the state if the state is checked, removes it otherwise @@ -604,9 +602,9 @@ class Wizard(QtGui.QWizard): self.tr("Something went wrong while trying to " "load service %s" % (service,))) + @QtCore.Slot(int) def _current_id_changed(self, pageId): """ - SLOT TRIGGER: self.currentIdChanged Prepares the pages when they appear diff --git a/src/leap/bitmask/services/mail/conductor.py b/src/leap/bitmask/services/mail/conductor.py index 79f324dc..4448d5d0 100644 --- a/src/leap/bitmask/services/mail/conductor.py +++ b/src/leap/bitmask/services/mail/conductor.py @@ -238,10 +238,9 @@ class SMTPControl(object): self._smtp_port.stopListening() self._smtp_service.doStop() - @QtCore.Slot() + @QtCore.Slot(dict) def smtp_bootstrapped_stage(self, data): """ - SLOT TRIGGERS: self.smtp_bootstrapper.download_config -- cgit v1.2.3 From 5218fda6b524cb8e694113e123e7b0d05b205ddc Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Wed, 16 Apr 2014 15:25:41 -0300 Subject: Use consistent wording for triggers documentation. --- src/leap/bitmask/gui/eip_status.py | 11 ++-- src/leap/bitmask/gui/login.py | 3 +- src/leap/bitmask/gui/mail_status.py | 16 ++++-- src/leap/bitmask/gui/mainwindow.py | 85 +++++++++++++++++------------ src/leap/bitmask/gui/preferenceswindow.py | 10 ++-- src/leap/bitmask/gui/wizard.py | 41 ++++++++------ src/leap/bitmask/services/mail/conductor.py | 2 +- 7 files changed, 101 insertions(+), 67 deletions(-) diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py index 2ced7dc7..8f4d64b4 100644 --- a/src/leap/bitmask/gui/eip_status.py +++ b/src/leap/bitmask/gui/eip_status.py @@ -91,8 +91,9 @@ class EIPStatusWidget(QtGui.QWidget): @QtCore.Slot() def _on_VPN_status_clicked(self): """ - TRIGGER: self.ui.btnUpload.clicked - self.ui.btnDownload.clicked + TRIGGERS: + self.ui.btnUpload.clicked + self.ui.btnDownload.clicked Toggles between rate and total throughput display for vpn status figures. @@ -350,7 +351,8 @@ class EIPStatusWidget(QtGui.QWidget): @QtCore.Slot(dict) def update_vpn_status(self, data=None): """ - TRIGGER: Signaler.eip_status_changed + TRIGGERS: + Signaler.eip_status_changed Updates the download/upload labels based on the data provided by the VPN thread. @@ -384,7 +386,8 @@ class EIPStatusWidget(QtGui.QWidget): @QtCore.Slot(dict) def update_vpn_state(self, vpn_state): """ - TRIGGER: Signaler.eip_state_changed + TRIGGERS: + Signaler.eip_state_changed Updates the displayed VPN state based on the data provided by the VPN thread. diff --git a/src/leap/bitmask/gui/login.py b/src/leap/bitmask/gui/login.py index 4a9626a6..681c0915 100644 --- a/src/leap/bitmask/gui/login.py +++ b/src/leap/bitmask/gui/login.py @@ -262,7 +262,8 @@ class LoginWidget(QtGui.QWidget): def _current_provider_changed(self, param): @QtCore.Slot(int) """ - TRIGGERS: self.ui.cmbProviders.currentIndexChanged + TRIGGERS: + self.ui.cmbProviders.currentIndexChanged """ if param == (self.ui.cmbProviders.count() - 1): self.show_wizard.emit() diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py index 059e5d68..d3346780 100644 --- a/src/leap/bitmask/gui/mail_status.py +++ b/src/leap/bitmask/gui/mail_status.py @@ -187,7 +187,7 @@ class MailStatusWidget(QtGui.QWidget): @QtCore.Slot() def set_soledad_failed(self): """ - TRIGGER: + TRIGGERS: SoledadBootstrapper.soledad_failed This method is called whenever soledad has a failure. @@ -198,7 +198,7 @@ class MailStatusWidget(QtGui.QWidget): @QtCore.Slot() def set_soledad_invalid_auth_token(self): """ - TRIGGER: + TRIGGERS: SoledadBootstrapper.soledad_invalid_token This method is called when the auth token is invalid @@ -253,7 +253,8 @@ class MailStatusWidget(QtGui.QWidget): @QtCore.Slot(object) def _mail_handle_soledad_events_slot(self, req): """ - TRIGGER: _mail_handle_soledad_events + TRIGGERS: + _mail_handle_soledad_events Reacts to an Soledad event @@ -287,7 +288,8 @@ class MailStatusWidget(QtGui.QWidget): @QtCore.Slot(object) def _mail_handle_keymanager_events_slot(self, req): """ - TRIGGER: _mail_handle_keymanager_events + TRIGGERS: + _mail_handle_keymanager_events Reacts to an KeyManager event @@ -333,7 +335,8 @@ class MailStatusWidget(QtGui.QWidget): @QtCore.Slot(object) def _mail_handle_smtp_events_slot(self, req): """ - TRIGGER: _mail_handle_smtp_events + TRIGGERS: + _mail_handle_smtp_events Reacts to an SMTP event @@ -367,7 +370,8 @@ class MailStatusWidget(QtGui.QWidget): @QtCore.Slot(object) def _mail_handle_imap_events_slot(self, req): """ - TRIGGER: _mail_handle_imap_events + TRIGGERS: + _mail_handle_imap_events Reacts to an IMAP event diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 6bdfe7c0..708ecf7f 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -460,7 +460,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _rejected_wizard(self): """ - TRIGGERS: self._wizard.rejected + TRIGGERS: + self._wizard.rejected Called if the wizard has been cancelled or closed before finishing. @@ -485,8 +486,8 @@ class MainWindow(QtGui.QMainWindow): def _launch_wizard(self): """ TRIGGERS: - self._login_widget.show_wizard - self.ui.action_wizard.triggered + self._login_widget.show_wizard + self.ui.action_wizard.triggered Also called in first run. @@ -512,8 +513,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _wizard_finished(self): """ - TRIGGERS - self._wizard.finished + TRIGGERS: + self._wizard.finished Called when the wizard has finished. """ @@ -538,7 +539,7 @@ class MainWindow(QtGui.QMainWindow): def _show_logger_window(self): """ TRIGGERS: - self.ui.action_show_logs.triggered + self.ui.action_show_logs.triggered Displays the window with the history of messages logged until now and displays the new ones on arrival. @@ -573,8 +574,8 @@ class MainWindow(QtGui.QMainWindow): def _show_preferences(self): """ TRIGGERS: - self.ui.btnPreferences.clicked (disabled for now) - self.ui.action_preferences + self.ui.btnPreferences.clicked (disabled for now) + self.ui.action_preferences Displays the preferences window. """ @@ -626,8 +627,8 @@ class MainWindow(QtGui.QMainWindow): def _show_eip_preferences(self): """ TRIGGERS: - self.ui.btnEIPPreferences.clicked - self.ui.action_eip_preferences (disabled for now) + self.ui.btnEIPPreferences.clicked + self.ui.action_eip_preferences (disabled for now) Displays the EIP preferences window. """ @@ -650,7 +651,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot(object) def _react_to_new_updates(self, req): """ - TRIGGER: self._new_updates_available + TRIGGERS: + self._new_updates_available Displays the new updates label and sets the updates_content """ @@ -662,7 +664,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _updates_details(self): """ - TRIGGER: self.ui.btnMore.clicked + TRIGGERS: + self.ui.btnMore.clicked Parses and displays the updates details """ @@ -690,7 +693,7 @@ class MainWindow(QtGui.QMainWindow): def _finish_init(self): """ TRIGGERS: - self._wizard.accepted + self._wizard.accepted Also called at the end of the constructor if not first run. @@ -835,7 +838,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot(int) def _tray_activated(self, reason=None): """ - TRIGGER: self._systray.activated + TRIGGERS: + self._systray.activated Displays the context menu from the tray icon """ @@ -865,7 +869,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _toggle_visible(self): """ - TRIGGER: self._action_visible.triggered + TRIGGERS: + self._action_visible.triggered Toggles the window visibility """ @@ -912,7 +917,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _about(self): """ - TRIGGERS: self.ui.action_about_leap.triggered + TRIGGERS: + self.ui.action_about_leap.triggered Display the About Bitmask dialog """ @@ -939,7 +945,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _help(self): """ - TRIGGERS: self.ui.action_help.triggered + TRIGGERS: + self.ui.action_help.triggered Display the Bitmask help dialog. """ @@ -1039,7 +1046,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot(dict) def _load_provider_config(self, data): """ - TRIGGER: self._backend.signaler.prov_download_provider_info + TRIGGERS: + self._backend.signaler.prov_download_provider_info Once the provider config has been downloaded, this loads the self._provider_config instance with it and starts the second @@ -1068,7 +1076,7 @@ class MainWindow(QtGui.QMainWindow): def _login(self): """ TRIGGERS: - self._login_widget.login + self._login_widget.login Starts the login sequence. Which involves bootstrapping the selected provider if the selection is valid (not empty), then @@ -1114,7 +1122,7 @@ class MainWindow(QtGui.QMainWindow): def _cancel_login(self): """ TRIGGERS: - self._login_widget.cancel_login + self._login_widget.cancel_login Stops the login sequence. """ @@ -1150,7 +1158,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot(dict) def _provider_config_loaded(self, data): """ - TRIGGER: self._backend.signaler.prov_check_api_certificate + TRIGGERS: + self._backend.signaler.prov_check_api_certificate Once the provider configuration is loaded, this starts the SRP authentication @@ -1174,7 +1183,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _authentication_finished(self): """ - TRIGGER: self._srp_auth.authentication_finished + TRIGGERS: + self._srp_auth.authentication_finished Once the user is properly authenticated, try starting the EIP service @@ -1290,7 +1300,7 @@ class MainWindow(QtGui.QMainWindow): # TODO missing param docstring """ TRIGGERS: - self._soledad_bootstrapper.download_config + self._soledad_bootstrapper.download_config If there was a problem, displays it, otherwise it does nothing. This is used for intermediate bootstrapping stages, in case @@ -1324,8 +1334,8 @@ class MainWindow(QtGui.QMainWindow): def _soledad_bootstrapped_stage(self, data): """ TRIGGERS: - self._soledad_bootstrapper.gen_key - self._soledad_bootstrapper.local_only_ready + self._soledad_bootstrapper.gen_key + self._soledad_bootstrapper.local_only_ready If there was a problem, displays it, otherwise it does nothing. This is used for intermediate bootstrapping stages, in case @@ -1484,6 +1494,7 @@ class MainWindow(QtGui.QMainWindow): """ TRIGGERS: self._eip_status.eip_connection_connected + Emits the EIPConnection.qtsigs.connected_signal This is a little workaround for connecting the vpn-connected @@ -1703,7 +1714,7 @@ class MainWindow(QtGui.QMainWindow): def _do_eip_restart(self): # XXX Should move to EIP Conductor """ - TRIGGER: + TRIGGERS: self._eip_connection.qtsigs.process_restart Restart the connection. @@ -1817,7 +1828,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot(dict) def _finish_eip_bootstrap(self, data): """ - TRIGGER: self._backend.signaler.eip_client_certificate_ready + TRIGGERS: + self._backend.signaler.eip_client_certificate_ready Starts the VPN thread if the eip configuration is properly loaded @@ -1839,7 +1851,7 @@ class MainWindow(QtGui.QMainWindow): # TODO missing param """ TRIGGERS: - self._backend.signaler.eip_config_ready + self._backend.signaler.eip_config_ready If there was a problem, displays it, otherwise it does nothing. This is used for intermediate bootstrapping stages, in case @@ -1881,7 +1893,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _logout(self): """ - TRIGGER: self._login_widget.logout + TRIGGERS: + self._login_widget.logout Starts the logout sequence """ @@ -1901,7 +1914,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _logout_error(self): """ - TRIGGER: self._srp_auth.logout_error + TRIGGER: + self._srp_auth.logout_error Inform the user about a logout error. """ @@ -1913,7 +1927,8 @@ class MainWindow(QtGui.QMainWindow): @QtCore.Slot() def _logout_ok(self): """ - TRIGGER: self._srp_auth.logout_ok + TRIGGER: + self._srp_auth.logout_ok Switches the stackedWidget back to the login stage after logging out @@ -1930,10 +1945,10 @@ class MainWindow(QtGui.QMainWindow): # TODO this method name is confusing as hell. """ TRIGGERS: - self._backend.signaler.prov_name_resolution - self._backend.signaler.prov_https_connection - self._backend.signaler.prov_download_ca_cert - self._backend.signaler.eip_config_ready + self._backend.signaler.prov_name_resolution + self._backend.signaler.prov_https_connection + self._backend.signaler.prov_download_ca_cert + self._backend.signaler.eip_config_ready If there was a problem, displays it, otherwise it does nothing. This is used for intermediate bootstrapping stages, in case diff --git a/src/leap/bitmask/gui/preferenceswindow.py b/src/leap/bitmask/gui/preferenceswindow.py index 111ec6d2..014a0a4f 100644 --- a/src/leap/bitmask/gui/preferenceswindow.py +++ b/src/leap/bitmask/gui/preferenceswindow.py @@ -211,7 +211,7 @@ class PreferencesWindow(QtGui.QDialog): def _change_password_ok(self): """ TRIGGERS: - self._backend.signaler.srp_password_change_ok + self._backend.signaler.srp_password_change_ok Callback used to display a successfully changed password. """ @@ -233,8 +233,8 @@ class PreferencesWindow(QtGui.QDialog): def _change_password_problem(self, msg): """ TRIGGERS: - self._backend.signaler.srp_password_change_error - self._backend.signaler.srp_password_change_badpw + self._backend.signaler.srp_password_change_error + self._backend.signaler.srp_password_change_badpw Callback used to display an error on changing password. @@ -290,7 +290,9 @@ class PreferencesWindow(QtGui.QDialog): @QtCore.Slot(str, int) def _service_selection_changed(self, service, state): """ - TRIGGER: service_checkbox.stateChanged + TRIGGERS: + service_checkbox.stateChanged + Adds the service to the state if the state is checked, removes it otherwise diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index 52cbab48..957a67e0 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -145,7 +145,7 @@ class Wizard(QtGui.QWizard): @QtCore.Slot() def _wizard_finished(self): """ - TRIGGER: + TRIGGERS: self.finished This method is called when the wizard is accepted or rejected. @@ -212,7 +212,7 @@ class Wizard(QtGui.QWizard): @QtCore.Slot(unicode) def _enable_check(self, reset=True): """ - TRIGGER: + TRIGGERS: self.ui.lnProvider.textChanged Enables/disables the 'check' button in the SELECT_PROVIDER_PAGE @@ -284,7 +284,7 @@ class Wizard(QtGui.QWizard): def _registration_finished(self): """ TRIGGERS: - self._backend.signaler.srp_registration_finished + self._backend.signaler.srp_registration_finished The registration has finished successfully, so we do some final steps. """ @@ -310,7 +310,7 @@ class Wizard(QtGui.QWizard): def _registration_failed(self): """ TRIGGERS: - self._backend.signaler.srp_registration_failed + self._backend.signaler.srp_registration_failed The registration has failed, so we report the problem. """ @@ -324,7 +324,7 @@ class Wizard(QtGui.QWizard): def _registration_taken(self): """ TRIGGERS: - self._backend.signaler.srp_registration_taken + self._backend.signaler.srp_registration_taken The requested username is taken, warn the user about that. """ @@ -370,8 +370,8 @@ class Wizard(QtGui.QWizard): def _check_provider(self): """ TRIGGERS: - self.ui.btnCheck.clicked - self.ui.lnProvider.returnPressed + self.ui.btnCheck.clicked + self.ui.lnProvider.returnPressed Starts the checks for a given provider """ @@ -404,7 +404,7 @@ class Wizard(QtGui.QWizard): @QtCore.Slot(bool) def _skip_provider_checks(self, skip): """ - Triggered: + TRIGGERS: self.ui.rbExistingProvider.toggled Allows the user to move to the next page without make any checks, @@ -448,7 +448,8 @@ class Wizard(QtGui.QWizard): @QtCore.Slot(dict) def _name_resolution(self, data): """ - TRIGGER: self._backend.signaler.prov_name_resolution + TRIGGERS: + self._backend.signaler.prov_name_resolution Sets the status for the name resolution check """ @@ -467,7 +468,8 @@ class Wizard(QtGui.QWizard): @QtCore.Slot(dict) def _https_connection(self, data): """ - TRIGGER: self._backend.signaler.prov_https_connection + TRIGGERS: + self._backend.signaler.prov_https_connection Sets the status for the https connection check """ @@ -486,7 +488,8 @@ class Wizard(QtGui.QWizard): @QtCore.Slot(dict) def _download_provider_info(self, data): """ - TRIGGER: self._backend.signaler.prov_download_provider_info + TRIGGERS: + self._backend.signaler.prov_download_provider_info Sets the status for the provider information download check. Since this check is the last of this set, it also @@ -520,7 +523,8 @@ class Wizard(QtGui.QWizard): @QtCore.Slot(dict) def _download_ca_cert(self, data): """ - TRIGGER: self._backend.signaler.prov_download_ca_cert + TRIGGERS: + self._backend.signaler.prov_download_ca_cert Sets the status for the download of the CA certificate check """ @@ -532,7 +536,8 @@ class Wizard(QtGui.QWizard): @QtCore.Slot(dict) def _check_ca_fingerprint(self, data): """ - TRIGGER: self._backend.signaler.prov_check_ca_fingerprint + TRIGGERS: + self._backend.signaler.prov_check_ca_fingerprint Sets the status for the CA fingerprint check """ @@ -544,7 +549,8 @@ class Wizard(QtGui.QWizard): @QtCore.Slot(dict) def _check_api_certificate(self, data): """ - TRIGGER: self._backend.signaler.prov_check_api_certificate + TRIGGERS: + self._backend.signaler.prov_check_api_certificate Sets the status for the API certificate check. Also finishes the provider bootstrapper thread since it's not needed anymore @@ -557,7 +563,9 @@ class Wizard(QtGui.QWizard): @QtCore.Slot(str, int) def _service_selection_changed(self, service, state): """ - TRIGGER: service_checkbox.stateChanged + TRIGGERS: + service_checkbox.stateChanged + Adds the service to the state if the state is checked, removes it otherwise @@ -605,7 +613,8 @@ class Wizard(QtGui.QWizard): @QtCore.Slot(int) def _current_id_changed(self, pageId): """ - TRIGGER: self.currentIdChanged + TRIGGERS: + self.currentIdChanged Prepares the pages when they appear """ diff --git a/src/leap/bitmask/services/mail/conductor.py b/src/leap/bitmask/services/mail/conductor.py index 4448d5d0..c1761afa 100644 --- a/src/leap/bitmask/services/mail/conductor.py +++ b/src/leap/bitmask/services/mail/conductor.py @@ -242,7 +242,7 @@ class SMTPControl(object): def smtp_bootstrapped_stage(self, data): """ TRIGGERS: - self.smtp_bootstrapper.download_config + self.smtp_bootstrapper.download_config If there was a problem, displays it, otherwise it does nothing. This is used for intermediate bootstrapping stages, in case -- cgit v1.2.3 From fa81e2f08335334f8def3a9275c00ba133e5f714 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 17 Apr 2014 11:45:03 -0300 Subject: Improve parameters docstrings. Also rename a parameter named 'param' to a more meaningful 'idx'. --- src/leap/bitmask/gui/eip_preferenceswindow.py | 3 +++ src/leap/bitmask/gui/eip_status.py | 3 +++ src/leap/bitmask/gui/login.py | 9 ++++++--- src/leap/bitmask/gui/mainwindow.py | 8 +++++++- src/leap/bitmask/gui/wizard.py | 8 ++++++++ 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/leap/bitmask/gui/eip_preferenceswindow.py b/src/leap/bitmask/gui/eip_preferenceswindow.py index fd2d3c5d..530cd38d 100644 --- a/src/leap/bitmask/gui/eip_preferenceswindow.py +++ b/src/leap/bitmask/gui/eip_preferenceswindow.py @@ -182,6 +182,9 @@ class EIPPreferencesWindow(QtGui.QDialog): TRIGGERS: Signaler.eip_get_gateways_list + :param gateways: a list of gateways + :type gateways: list of unicode + Add the available gateways and select the one stored in configuration file. """ diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py index 8f4d64b4..0d75b8e5 100644 --- a/src/leap/bitmask/gui/eip_status.py +++ b/src/leap/bitmask/gui/eip_status.py @@ -392,6 +392,9 @@ class EIPStatusWidget(QtGui.QWidget): Updates the displayed VPN state based on the data provided by the VPN thread. + :param vpn_state: the state of the VPN + :type vpn_state: dict + Emits: If the vpn_state is connected, we emit EIPConnection.qtsigs. connected_signal diff --git a/src/leap/bitmask/gui/login.py b/src/leap/bitmask/gui/login.py index 681c0915..ac7ad878 100644 --- a/src/leap/bitmask/gui/login.py +++ b/src/leap/bitmask/gui/login.py @@ -259,13 +259,16 @@ class LoginWidget(QtGui.QWidget): """ self.ui.lnPassword.setFocus() - def _current_provider_changed(self, param): @QtCore.Slot(int) + def _current_provider_changed(self, idx): """ TRIGGERS: self.ui.cmbProviders.currentIndexChanged + + :param idx: the index of the new selected item + :type idx: int """ - if param == (self.ui.cmbProviders.count() - 1): + if idx == (self.ui.cmbProviders.count() - 1): self.show_wizard.emit() # Leave the previously selected provider in the combobox prev_provider = 0 @@ -275,7 +278,7 @@ class LoginWidget(QtGui.QWidget): self.ui.cmbProviders.setCurrentIndex(prev_provider) self.ui.cmbProviders.blockSignals(False) else: - self._selected_provider_index = param + self._selected_provider_index = idx def start_login(self): """ diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 708ecf7f..b911e5d8 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -652,9 +652,12 @@ class MainWindow(QtGui.QMainWindow): def _react_to_new_updates(self, req): """ TRIGGERS: - self._new_updates_available + self.new_updates Displays the new updates label and sets the updates_content + + :param req: Request type + :type req: leap.common.events.events_pb2.SignalRequest """ self.moveToThread(QtCore.QCoreApplication.instance().thread()) self.ui.lblNewUpdates.setVisible(True) @@ -841,6 +844,9 @@ class MainWindow(QtGui.QMainWindow): TRIGGERS: self._systray.activated + :param reason: the reason why the tray got activated. + :type reason: int + Displays the context menu from the tray icon """ self._update_hideshow_menu() diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index 957a67e0..cc8c2624 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -217,6 +217,11 @@ class Wizard(QtGui.QWizard): Enables/disables the 'check' button in the SELECT_PROVIDER_PAGE depending on the lnProvider content. + + :param reset: this contains the text of the line edit, and when is + called directly defines whether we want to reset the + checks. + :type reset: unicode or bool """ enabled = len(self.ui.lnProvider.text()) != 0 enabled = enabled or self.ui.rbExistingProvider.isChecked() @@ -617,6 +622,9 @@ class Wizard(QtGui.QWizard): self.currentIdChanged Prepares the pages when they appear + + :param pageId: the new current page id. + :type pageId: int """ if pageId == self.SELECT_PROVIDER_PAGE: self._clear_register_widgets() -- cgit v1.2.3 From 1603228feac95c32b62661c15c6edd4c95978827 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 17 Apr 2014 11:47:20 -0300 Subject: Add changes file for #5506. --- changes/feature-5506_use-pyside-slot-decorator | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/feature-5506_use-pyside-slot-decorator diff --git a/changes/feature-5506_use-pyside-slot-decorator b/changes/feature-5506_use-pyside-slot-decorator new file mode 100644 index 00000000..7a9ea20e --- /dev/null +++ b/changes/feature-5506_use-pyside-slot-decorator @@ -0,0 +1 @@ +- Use PySide @Slot decorator instead of 'SLOT' docstring. Closes #5506. -- cgit v1.2.3