diff --git a/spyder/plugins/application/container.py b/spyder/plugins/application/container.py index 8d169e05da4..ae7fcaf1486 100644 --- a/spyder/plugins/application/container.py +++ b/spyder/plugins/application/container.py @@ -111,11 +111,13 @@ def setup(self): parent=self ) + if self.is_installer(): + self.application_update_status.set_no_status() + (self.application_update_status.sig_check_for_updates_requested .connect(self.check_updates)) (self.application_update_status.sig_install_on_close_requested .connect(self.set_installer_path)) - self.application_update_status.set_no_status() self.give_updates_feedback = False self.thread_updates = None @@ -292,10 +294,10 @@ def _check_updates_ready(self): box.setText(error_msg) box.set_check_visible(False) box.show() - if self.application_update_status.isVisible(): + if self.is_installer(): self.application_update_status.set_no_status() elif update_available: - if self.application_update_status.isVisible(): + if self.is_installer(): self.application_update_status.set_status_pending( latest_release) @@ -307,7 +309,7 @@ def _check_updates_ready(self): box.setStandardButtons(QMessageBox.Yes | QMessageBox.No) box.setDefaultButton(QMessageBox.Yes) - if not is_pynsist() and not running_in_mac_app(): + if not self.is_installer(): installers_url = url_i + "#standalone-installers" msg = ( header + @@ -337,8 +339,7 @@ def _check_updates_ready(self): not box.result() # The installer dialog was skipped or ( box.result() == QMessageBox.No - and not is_pynsist() - and not running_in_mac_app() + and not self.is_installer() ) ): # Update-at-startup checkbox visible only if manual update @@ -421,10 +422,10 @@ def _check_updates_ready(self): elif feedback: box.setText(_("Spyder is up to date.")) box.show() - if self.application_update_status.isVisible(): + if self.is_installer(): self.application_update_status.set_no_status() else: - if self.application_update_status.isVisible(): + if self.is_installer(): self.application_update_status.set_no_status() self.set_conf(option, box.is_checked()) @@ -445,7 +446,7 @@ def check_updates(self, startup=False): self.check_updates_action.setDisabled(True) self.check_updates_action.setText(_("Checking for updates...")) - if self.application_update_status.isVisible(): + if self.is_installer(): self.application_update_status.set_status_checking() if self.thread_updates is not None: @@ -476,6 +477,9 @@ def set_installer_path(self, installer_path): """Set installer executable path to be run when closing.""" self.installer_path = installer_path + def is_installer(self): + return is_pynsist() or running_in_mac_app() + # ---- Dependencies # ------------------------------------------------------------------------- @Slot() diff --git a/spyder/plugins/application/plugin.py b/spyder/plugins/application/plugin.py index 7bbbcfbe1bc..015e70770ba 100644 --- a/spyder/plugins/application/plugin.py +++ b/spyder/plugins/application/plugin.py @@ -25,7 +25,6 @@ on_plugin_available, on_plugin_teardown) from spyder.api.widgets.menus import MENU_SEPARATOR from spyder.config.base import (DEV, get_module_path, get_debug_level, - is_pynsist, running_in_mac_app, running_under_pytest) from spyder.plugins.application.confpage import ApplicationConfigPage from spyder.plugins.application.container import ( @@ -150,7 +149,7 @@ def on_mainwindow_visible(self): # Users only need to see this widget in our apps. # Note: This can only be done at this point to take effect. - if not (is_pynsist() or running_in_mac_app()): + if not container.is_installer(): self.application_update_status.setVisible(False) # Handle DPI scale and window changes to show a restart message.