From bf20b6b97b9e76f77a1aa1d3c8ede95017bce860 Mon Sep 17 00:00:00 2001 From: Pete Peterson <petersonpf@ornl.gov> Date: Wed, 3 Oct 2018 15:15:42 -0400 Subject: [PATCH] Change to standard function names --- .../workbench/plugins/algorithmselectorwidget.py | 6 +++++- qt/applications/workbench/workbench/plugins/base.py | 7 ++++++- qt/applications/workbench/workbench/plugins/editor.py | 6 +++++- .../workbench/workbench/plugins/jupyterconsole.py | 8 ++++++-- .../workbench/workbench/plugins/plotselectorwidget.py | 6 +++++- .../workbench/workbench/plugins/workspacewidget.py | 6 +++++- 6 files changed, 32 insertions(+), 7 deletions(-) diff --git a/qt/applications/workbench/workbench/plugins/algorithmselectorwidget.py b/qt/applications/workbench/workbench/plugins/algorithmselectorwidget.py index b22951ed77b..366ed3958f5 100644 --- a/qt/applications/workbench/workbench/plugins/algorithmselectorwidget.py +++ b/qt/applications/workbench/workbench/plugins/algorithmselectorwidget.py @@ -17,6 +17,7 @@ from qtpy.QtWidgets import QVBoxLayout # local package imports from workbench.plugins.base import PluginWidget +# from mantidqt.utils.qt import toQSettings when readSettings/writeSettings are implemented class AlgorithmSelector(PluginWidget): @@ -39,5 +40,8 @@ class AlgorithmSelector(PluginWidget): def get_plugin_title(self): return "Algorithms" - def read_user_settings(self, _): + def readSettings(self, _): + pass + + def writeSettings(self, _): pass diff --git a/qt/applications/workbench/workbench/plugins/base.py b/qt/applications/workbench/workbench/plugins/base.py index d88ba0a6f67..7dc9e1fc3ea 100644 --- a/qt/applications/workbench/workbench/plugins/base.py +++ b/qt/applications/workbench/workbench/plugins/base.py @@ -36,11 +36,16 @@ class PluginWidget(QWidget): def get_plugin_title(self): raise NotImplementedError() - def read_user_settings(self, qsettings): + def readSettings(self, qsettings): """Called by the main window to ask the plugin to load user configuration""" raise NotImplementedError() + def writeSettings(self, qsettings): + """Called by the main window to ask the plugin to + save user configuration""" + raise NotImplementedError() + def register_plugin(self, menu=None): """Called by the parent widget/window and should perform any setup required to use the plugin. diff --git a/qt/applications/workbench/workbench/plugins/editor.py b/qt/applications/workbench/workbench/plugins/editor.py index 002f38853cb..ee320b3611e 100644 --- a/qt/applications/workbench/workbench/plugins/editor.py +++ b/qt/applications/workbench/workbench/plugins/editor.py @@ -19,6 +19,7 @@ from qtpy.QtWidgets import QVBoxLayout # local package imports from workbench.plugins.base import PluginWidget +# from mantidqt.utils.qt import toQSettings when readSettings/writeSettings are implemented # Initial content @@ -75,7 +76,10 @@ class MultiFileEditor(PluginWidget): def get_plugin_title(self): return "Editor" - def read_user_settings(self, _): + def readSettings(self, _): + pass + + def writeSettings(self, _): pass def register_plugin(self): diff --git a/qt/applications/workbench/workbench/plugins/jupyterconsole.py b/qt/applications/workbench/workbench/plugins/jupyterconsole.py index 31e83995fc7..185d0783cab 100644 --- a/qt/applications/workbench/workbench/plugins/jupyterconsole.py +++ b/qt/applications/workbench/workbench/plugins/jupyterconsole.py @@ -16,7 +16,7 @@ import sys from mantidqt.widgets.jupyterconsole import InProcessJupyterConsole try: from IPython.core.usage import quick_guide -except ImportError: # quick_guide was removed in IPython 6.0 +except ImportError: # quick_guide was removed in IPython 6.0 quick_guide = '' from IPython.core.usage import release as ipy_release from matplotlib import __version__ as mpl_version @@ -25,6 +25,7 @@ from qtpy.QtWidgets import QVBoxLayout # local package imports from workbench.plugins.base import PluginWidget +# from mantidqt.utils.qt import toQSettings when readSettings/writeSettings are implemented DEFAULT_BANNER_PARTS = [ 'IPython {version} -- An enhanced Interactive Python.\n'.format( @@ -63,7 +64,10 @@ class JupyterConsole(PluginWidget): def get_plugin_title(self): return "IPython" - def read_user_settings(self, _): + def readSettings(self, _): + pass + + def writeSettings(self, _): pass def register_plugin(self, menu=None): diff --git a/qt/applications/workbench/workbench/plugins/plotselectorwidget.py b/qt/applications/workbench/workbench/plugins/plotselectorwidget.py index d1993d1ff16..161b3eb6a66 100644 --- a/qt/applications/workbench/workbench/plugins/plotselectorwidget.py +++ b/qt/applications/workbench/workbench/plugins/plotselectorwidget.py @@ -18,6 +18,7 @@ from qtpy.QtWidgets import QVBoxLayout from workbench.plugins.base import PluginWidget from workbench.plotting.globalfiguremanager import GlobalFigureManager from workbench.widgets.plotselector.presenter import PlotSelectorPresenter +# from mantidqt.utils.qt import toQSettings when readSettings/writeSettings are implemented class PlotSelector(PluginWidget): @@ -42,5 +43,8 @@ class PlotSelector(PluginWidget): def get_plugin_title(self): return "Plots" - def read_user_settings(self, _): + def readSettings(self, _): + pass + + def writeSettings(self, _): pass diff --git a/qt/applications/workbench/workbench/plugins/workspacewidget.py b/qt/applications/workbench/workbench/plugins/workspacewidget.py index feeff952f96..369c661ec16 100644 --- a/qt/applications/workbench/workbench/plugins/workspacewidget.py +++ b/qt/applications/workbench/workbench/plugins/workspacewidget.py @@ -20,6 +20,7 @@ from qtpy.QtWidgets import QMessageBox, QVBoxLayout # local package imports from workbench.plugins.base import PluginWidget from workbench.plotting.functions import can_overplot, pcolormesh, plot_from_names +# from mantidqt.utils.qt import toQSettings when readSettings/writeSettings are implemented class WorkspaceWidget(PluginWidget): @@ -55,7 +56,10 @@ class WorkspaceWidget(PluginWidget): def get_plugin_title(self): return "Workspaces" - def read_user_settings(self, _): + def readSettings(self, _): + pass + + def writeSettings(self, _): pass # ----------------- Behaviour -------------------- -- GitLab