diff --git a/qt/applications/workbench/workbench/plugins/workspacewidget.py b/qt/applications/workbench/workbench/plugins/workspacewidget.py index ce06d4eae68458e58aa5d4b2cfc62ca24691ad48..7160a9c282b0ff3b7322b2092e9518c97eecb846 100644 --- a/qt/applications/workbench/workbench/plugins/workspacewidget.py +++ b/qt/applications/workbench/workbench/plugins/workspacewidget.py @@ -203,13 +203,17 @@ class WorkspaceWidget(PluginWidget): CreateDetectorTable(InputWorkspace=ws) def _action_double_click_workspace(self, name): + ws = self._ads.retrieve(name) try: # if this is a table workspace (or peaks workspace), # then it can't be plotted automatically, so the data is shown instead - TableWorkspaceDisplay.supports(self._ads.retrieve(name)) + TableWorkspaceDisplay.supports(ws) self._do_show_data([name]) except ValueError: - plot_from_names([name], errors=False, overplot=False, show_colorfill_btn=True) + if ws.blocksize() > 1: + plot_from_names([name], errors=False, overplot=False, show_colorfill_btn=True) + else: + self._do_show_data([name]) def refresh_workspaces(self): self.workspacewidget.refreshWorkspaces() diff --git a/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidgetSimple.cpp b/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidgetSimple.cpp index 2412bd803dbccf2442d698c1a6d4fec036423e59..0c0ca8bbfc30d700d392286735395637971cbc4b 100644 --- a/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidgetSimple.cpp +++ b/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidgetSimple.cpp @@ -121,10 +121,10 @@ void WorkspaceTreeWidgetSimple::popupContextMenu() { } } } - m_plotSpectrum->setEnabled(multipleBins); - m_overplotSpectrum->setEnabled(multipleBins); - m_plotSpectrumWithErrs->setEnabled(multipleBins); - m_overplotSpectrumWithErrs->setEnabled(multipleBins); + //disable the actions created so far if only one bin + for (auto action : plotSubMenu->actions()) { + action->setEnabled(multipleBins); + } plotSubMenu->addSeparator(); plotSubMenu->addAction(m_plotColorfill);