Skip to content
Snippets Groups Projects
Commit d8eb7d2b authored by Nick Draper's avatar Nick Draper
Browse files

Changed double click to show data if only one bin

Also included code suggestion
I've not removed the ability to plot from the Show data table because:
1. If they try that hard they deserve an empty graph
2. I can't work out how.
parent 120b750c
No related branches found
No related tags found
No related merge requests found
......@@ -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()
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment