Commit eabfe065 authored by Mathieu Tillet's avatar Mathieu Tillet
Browse files

Reset picktab when replacing workspace

When the workspace is replaced, all of the widgets in the pick tab are
reset to a void status, and the tool comes back to pixel select.

Also, if the workspace is not integrable, the plot is folded.
parent 4dddb22a
......@@ -92,6 +92,7 @@ public:
void selectTool(const ToolType tool);
std::shared_ptr<ProjectionSurface> getSurface() const;
const InstrumentWidget *getInstrumentWidget() const;
void clearWidgets();
/// Load settings for the pick tab from a project file
virtual void loadFromProject(const std::string &lines) override;
/// Save settings for the pick tab to a project file
......
......@@ -600,6 +600,9 @@ void InstrumentWidget::replaceWorkspace(
// update the integration widget
updateIntegrationWidget();
// reset the plot and the info widget in the pick tab
m_pickTab->clearWidgets();
// change the title of the instrument window
nativeParentWidget()->setWindowTitle(
QString().fromStdString(newInstrumentWindowName));
......
......@@ -571,7 +571,7 @@ QColor InstrumentWidgetPickTab::getShapeBorderColor() const {
}
/**
* Do something when the time bin integraion range has changed.
* Do something when the time bin integration range has changed.
*/
void InstrumentWidgetPickTab::changedIntegrationRange(double /*unused*/,
double /*unused*/) {
......@@ -804,6 +804,16 @@ void InstrumentWidgetPickTab::updatePlotMultipleDetectors() {
m_plot->replot();
}
/**
* Clear all the tab's widgets.
*/
void InstrumentWidgetPickTab::clearWidgets() {
m_plotController->clear();
m_infoController->clear();
selectTool(ToolType::PixelSelect);
collapsePlotPanel();
}
/**
* Save data plotted on the miniplot into a MatrixWorkspace.
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment