Skip to content

Commit f5c2470

Browse files
committed
Hide output name label and warning
1 parent e0eb3d7 commit f5c2470

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

qt/scientific_interfaces/Indirect/Reduction/ISISEnergyTransferPresenter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ IETPresenter::IETPresenter(IDataReduction *idrUI, IIETView *view, std::unique_pt
6060
setOutputPlotOptionsPresenter(m_view->getPlotOptionsView(), PlotWidget::SpectraSliceSurface);
6161
setOutputNamePresenter(m_view->getOutputName());
6262
m_outputNamePresenter->setWsSuffixes(SUFFIXES);
63+
m_outputNamePresenter->hideOutputNameBox();
6364
}
6465

6566
void IETPresenter::validateInstrumentDetails(IUserInputValidator *validator) const {

qt/widgets/spectroscopy/inc/MantidQtWidgets/Spectroscopy/OutputWidget/OutputNamePresenter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class MANTID_SPECTROSCOPY_DLL IOutputNamePresenter {
1919
virtual std::string generateOutputLabel() = 0;
2020
virtual void generateWarningLabel() const = 0;
2121
virtual void handleUpdateOutputLabel() = 0;
22-
virtual void enableEditing() = 0;
2322
virtual std::string getCurrentLabel() = 0;
23+
virtual void hideOutputNameBox() const = 0;
2424

2525
virtual void setWsSuffixes(std::vector<std::string> const &suffixes) = 0;
2626
virtual void setOutputWsBasename(std::string const &outputName, std::string const &outputSuffix = "") = 0;
@@ -34,8 +34,8 @@ class MANTID_SPECTROSCOPY_DLL OutputNamePresenter final : public IOutputNamePres
3434
std::string generateOutputLabel() override;
3535
void generateWarningLabel() const override;
3636
void handleUpdateOutputLabel() override;
37-
void enableEditing() override;
3837
std::string getCurrentLabel() override;
38+
void hideOutputNameBox() const override;
3939

4040
void setOutputWsBasename(std::string const &outputBasename, std::string const &outputSuffix = "") override;
4141
void setWsSuffixes(std::vector<std::string> const &suffixes) override;

qt/widgets/spectroscopy/inc/MantidQtWidgets/Spectroscopy/OutputWidget/OutputNameView.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class MANTID_SPECTROSCOPY_DLL IOutputNameView {
2828

2929
virtual std::string getCurrentLabel() const = 0;
3030
virtual std::string getCurrentOutputName() const = 0;
31+
32+
virtual void hideOutputNameBox() const = 0;
3133
};
3234

3335
class MANTID_SPECTROSCOPY_DLL OutputNameView final : public QWidget, public IOutputNameView {
@@ -45,6 +47,8 @@ class MANTID_SPECTROSCOPY_DLL OutputNameView final : public QWidget, public IOut
4547
std::string getCurrentLabel() const override;
4648
std::string getCurrentOutputName() const override;
4749

50+
void hideOutputNameBox() const override;
51+
4852
private slots:
4953
void notifyUpdateOutputLabel();
5054

qt/widgets/spectroscopy/src/OutputWidget/OutputNamePresenter.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ void OutputNamePresenter::setOutputWsBasename(std::string const &outputBasename,
2727
handleUpdateOutputLabel();
2828
}
2929

30-
void OutputNamePresenter::enableEditing() {
31-
m_view->enableLabelEditor();
32-
// m_view->hideWarning();
33-
}
34-
3530
std::string OutputNamePresenter::getCurrentLabel() { return m_view->getCurrentLabel(); }
3631

3732
void OutputNamePresenter::generateWarningLabel() const {
@@ -44,6 +39,8 @@ void OutputNamePresenter::generateWarningLabel() const {
4439
m_view->setWarningLabel(text, textColor);
4540
}
4641

42+
void OutputNamePresenter::hideOutputNameBox() const { m_view->hideOutputNameBox(); }
43+
4744
std::string OutputNamePresenter::generateOutputLabel() {
4845
auto outputName = m_model->outputBasename();
4946
return outputName.insert(m_model->findIndexToInsertLabel(outputName), addLabelUnderscore(m_view->getCurrentLabel()));

qt/widgets/spectroscopy/src/OutputWidget/OutputNameView.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ std::string OutputNameView::getCurrentOutputName() const { return m_uiForm.lbNam
4040

4141
std::string OutputNameView::getCurrentLabel() const { return m_uiForm.leLabel->text().toStdString(); }
4242

43+
void OutputNameView::hideOutputNameBox() const {
44+
m_uiForm.lbName->hide();
45+
m_uiForm.lbOutput->hide();
46+
m_uiForm.lbWarning->hide();
47+
}
48+
4349
void OutputNameView::notifyUpdateOutputLabel() { m_presenter->handleUpdateOutputLabel(); }
4450

4551
} // namespace MantidQt::CustomInterfaces

0 commit comments

Comments
 (0)