-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[spy-plugin-registry-teardown] PR: Add preference page to enable and disable plugins #12
Conversation
# Do not add Spyder 4 plugins to the disable page | ||
continue | ||
|
||
if not PluginClass.CAN_BE_DISABLED: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to determine which plugins shouldn't be closed, e.g., Application
a4ff31d
to
e2ae13e
Compare
fd98e5f
to
b1ce43c
Compare
e2ae13e
to
46d7e30
Compare
403d6bc
to
daaba86
Compare
633d41f
to
7dba6e4
Compare
daaba86
to
577f069
Compare
7dba6e4
to
c53685c
Compare
57e1025
to
5d4c815
Compare
33f8152
to
97463db
Compare
5d4c815
to
1d2a8fc
Compare
97463db
to
92bb0ab
Compare
1d2a8fc
to
33deab4
Compare
92bb0ab
to
5567df5
Compare
33deab4
to
51c5f85
Compare
5567df5
to
fb3a218
Compare
ed244f8
to
3ae2b96
Compare
c9cfaab
to
dc6358c
Compare
3ae2b96
to
948ae21
Compare
dc6358c
to
b2a3645
Compare
5ccf666
to
fb45f2c
Compare
fea7936
to
4cfad3c
Compare
3a2cd1e
to
3dbaf0d
Compare
03c245e
to
f612326
Compare
3dbaf0d
to
c153780
Compare
f612326
to
3dcec22
Compare
c153780
to
10b109d
Compare
@@ -0,0 +1,117 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename this module to _confpage.py
so that people don't consider it as part of our public API.
# Licensed under the terms of the MIT License | ||
# (see spyder/__init__.py for details) | ||
|
||
"""Spyder completion plugin configuration page.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Spyder completion plugin configuration page.""" | |
"""Plugin registry configuration page.""" |
from spyder.config.base import _ | ||
from spyder.config.manager import CONF | ||
from spyder.api.preferences import PluginConfigPage | ||
from spyder.api.plugins import SpyderPlugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from spyder.config.base import _ | |
from spyder.config.manager import CONF | |
from spyder.api.preferences import PluginConfigPage | |
from spyder.api.plugins import SpyderPlugin | |
from spyder.api.plugins import SpyderPlugin | |
from spyder.api.preferences import PluginConfigPage | |
from spyder.config.base import _ | |
from spyder.config.manager import CONF |
Organize import in alphabetical order.
_("Spyder can run with a reduced number of internal and external " | ||
"plugins in order to provide a lighter experience. Any plugin " | ||
"unchecked in this page will be unloaded immediately and will " | ||
"not be loaded next time Spyder starts.")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you can turn on/off any internal or external Spyder plugin to disable functionality that you don't use or have a lighter experience. Unchecked plugins in this page will be unloaded immediately and will not be loaded the next time Spyder starts.
What do you think about rewriting this message like this?
|
||
self.main = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.main = None | |
# To hold a reference to the main window | |
self.main = None |
# ---- Quit and restart, and reset spyder defaults | ||
@Slot() | ||
def reset_spyder(self): | ||
""" | ||
Quit and reset Spyder and then Restart application. | ||
""" | ||
answer = QMessageBox.warning(self, _("Warning"), | ||
_("Spyder will restart and reset to default settings: <br><br>" | ||
"Do you want to continue?"), | ||
QMessageBox.Yes | QMessageBox.No) | ||
if answer == QMessageBox.Yes: | ||
self.restart(reset=True) | ||
|
||
@Slot() | ||
def restart(self, reset=False, close_immediately=False): | ||
"""Wrapper to handle plugins request to restart Spyder.""" | ||
self.application.restart( | ||
reset=reset, close_immediately=close_immediately) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods are not necessary anymore (see below for the reasoning). Please remove them.
@@ -326,7 +327,7 @@ def apply_settings(self): | |||
self._main.apply_settings() | |||
|
|||
@Slot() | |||
def restart(self): | |||
def restart(self, reset=False, close_immediately=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reset
is not used in this method. Should it be removed? It's also mentioned in the docstring, so it should be removed from it too.
spyder/plugins/editor/plugin.py
Outdated
"""Return widget title""" | ||
# TODO: This is a temporary measure to get the title of the plugins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# TODO: This is a temporary measure to get the title of the plugins | |
# TODO: This is a temporary measure to get the title of plugins |
"""Return widget title""" | ||
# TODO: This is a temporary measure to get the title of the plugins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# TODO: This is a temporary measure to get the title of the plugins | |
# TODO: This is a temporary measure to get the title of plugins | |
|
||
def restart(self): | ||
"""Restart Spyder.""" | ||
self.main.restart(close_immediately=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After PR spyder-ide#15629, we now emit sig_restart_requested
from the Application plugin, so that other plugins can connect to it and perform actions when a restart happens.
So, you need to find a way of using that signal here, as it was before.
59c1f42
to
be70728
Compare
be70728
to
c842817
Compare
2adcce1
to
ec6f410
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last comment for you @andfoy and then this should be ready.
Stacked PR Chain: [spy-plugin-registry-teardown]