Skip to content

Commit

Permalink
Restore check for update preference to Application preference pane
Browse files Browse the repository at this point in the history
* Restore "Check for updates on startup" check box to Application plugin preference page.
* Add "Check for stable releases only" check box to Application plugin preference page.
  • Loading branch information
mrclary committed Dec 13, 2023
1 parent 205463b commit 4c0a3ae
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 46 deletions.
18 changes: 18 additions & 0 deletions spyder/plugins/application/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

from spyder.config.base import (_, DISABLED_LANGUAGES, LANGUAGE_CODES,
is_conda_based_app, save_lang_conf)
from spyder.api.plugins import Plugins
from spyder.api.preferences import PluginConfigPage
from spyder.py3compat import to_text_string

Expand Down Expand Up @@ -65,6 +66,16 @@ def setup_page(self):
prompt_box = newcb(_("Prompt when exiting"), 'prompt_on_exit')
popup_console_box = newcb(_("Show internal Spyder errors to report "
"them to Github"), 'show_internal_errors')
check_update_cb = newcb(
_("Check for updates on startup"),
'check_updates_on_startup',
section='update_manager'
)
stable_only_cb = newcb(
_("Check for stable releases only"),
'check_stable_only',
section='update_manager'
)

# Decide if it's possible to activate or not single instance mode
# ??? Should we allow multiple instances for macOS?
Expand All @@ -86,6 +97,8 @@ def setup_page(self):
advanced_layout.addWidget(single_instance_box)
advanced_layout.addWidget(prompt_box)
advanced_layout.addWidget(popup_console_box)
advanced_layout.addWidget(check_update_cb)
advanced_layout.addWidget(stable_only_cb)

advanced_widget = QWidget()
advanced_widget.setLayout(advanced_layout)
Expand Down Expand Up @@ -269,6 +282,11 @@ def apply_settings(self, options):
self.set_option(
'high_dpi_custom_scale_factors', scale_factors_text)
self.changed_options.add('high_dpi_custom_scale_factors')

um = self.plugin.get_plugin(Plugins.UpdateManager, error=False)
if um and 'check_stable_only' in self.changed_options:
um.update_manager_status.set_no_status()

self.plugin.apply_settings()

def _save_lang(self):
Expand Down
44 changes: 0 additions & 44 deletions spyder/plugins/updatemanager/confpage.py

This file was deleted.

2 changes: 0 additions & 2 deletions spyder/plugins/updatemanager/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
on_plugin_teardown
)
from spyder.config.base import DEV
from spyder.plugins.updatemanager.confpage import UpdateManagerConfigPage
from spyder.plugins.updatemanager.container import (
UpdateManagerActions,
UpdateManagerContainer
Expand All @@ -32,7 +31,6 @@ class UpdateManager(SpyderPluginV2):
CONTAINER_CLASS = UpdateManagerContainer
CONF_SECTION = 'update_manager'
CONF_FILE = False
CONF_WIDGET_CLASS = UpdateManagerConfigPage
CAN_BE_DISABLED = False

# ---- SpyderPluginV2 API
Expand Down

0 comments on commit 4c0a3ae

Please sign in to comment.