diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/IMainWindowView.h b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/IMainWindowView.h index d7885459759115373a839a345a118f0e16e500ce..84e931e7790fd9fae8932877adff13908840fbcc 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/IMainWindowView.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/IMainWindowView.h @@ -29,6 +29,8 @@ public: virtual void notifyCloseBatchRequested(int) = 0; virtual void notifySaveBatchRequested(int) = 0; virtual void notifyLoadBatchRequested(int) = 0; + virtual void notifyShowOptionsRequested() = 0; + virtual void notifyShowSlitCalculatorRequested() = 0; virtual ~MainWindowSubscriber() = default; }; diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowPresenter.cpp index 8e5fba32eee30ceca30acba569047424fe204720..f705a96d57f22643b0139e15be21f3e1a695221c 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowPresenter.cpp @@ -77,6 +77,10 @@ void MainWindowPresenter::notifyCloseBatchRequested(int batchIndex) { } } +void MainWindowPresenter::notifyShowOptionsRequested() {} + +void MainWindowPresenter::notifyShowSlitCalculatorRequested() {} + void MainWindowPresenter::notifyAnyBatchAutoreductionResumed() { for (const auto &batchPresenter : m_batchPresenters) { batchPresenter->notifyAnyBatchAutoreductionResumed(); diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowPresenter.h b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowPresenter.h index 52b32f7f5891f094b797234dee6ba4337bfee6ae..f7703674a97d67d89ffc090dac6d6a193452d46d 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowPresenter.h @@ -60,6 +60,8 @@ public: void notifyCloseBatchRequested(int batchIndex) override; void notifySaveBatchRequested(int batchIndex) override; void notifyLoadBatchRequested(int batchIndex) override; + void notifyShowOptionsRequested() override; + void notifyShowSlitCalculatorRequested() override; protected: IMainWindowView *m_view; diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowWidget.ui b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowWidget.ui index b62220972d61681d1ba122df22970ed7bc779466..2f82e5a54913fbdac16f48ea575075c4cf8fef10 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowWidget.ui +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/MainWindowWidget.ui @@ -67,25 +67,43 @@ <height>31</height> </rect> </property> - <widget class="QMenu" name="menuReflectometry"> + <widget class="QMenu" name="menuBatch"> <property name="title"> - <string>Batch</string> + <string>&Batch</string> </property> <addaction name="newBatch"/> <addaction name="separator"/> <addaction name="loadBatch"/> <addaction name="saveBatch"/> </widget> - <addaction name="menuReflectometry"/> + <widget class="QMenu" name="menuTools"> + <property name="title"> + <string>&Tools</string> + </property> + <addaction name="showOptions"/> + <addaction name="showSlitCalculator"/> + </widget> + <addaction name="menuBatch"/> + <addaction name="menuTools"/> </widget> <action name="newBatch"> <property name="text"> - <string>New</string> + <string>&New</string> </property> </action> <action name="loadBatch"> <property name="text"> - <string>Load</string> + <string>&Load</string> + </property> + </action> + <action name="showOptions"> + <property name="text"> + <string>&Options</string> + </property> + </action> + <action name="showSlitCalculator"> + <property name="text"> + <string>&Slit Calculator</string> </property> </action> <action name="saveBatch"> diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/QtMainWindowView.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/QtMainWindowView.cpp index bc16c9cb9934399941eb76e55c73cf1cf541625d..59be273fcb1e4f7fbeeceb2574f365bd9bc3091b 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/QtMainWindowView.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/QtMainWindowView.cpp @@ -62,6 +62,10 @@ void QtMainWindowView::initLayout() { SLOT(onLoadBatchRequested(bool))); connect(m_ui.saveBatch, SIGNAL(triggered(bool)), this, SLOT(onSaveBatchRequested(bool))); + connect(m_ui.showOptions, SIGNAL(triggered(bool)), this, + SLOT(onShowOptionsRequested(bool))); + connect(m_ui.showSlitCalculator, SIGNAL(triggered(bool)), this, + SLOT(onShowSlitCalculatorRequested(bool))); auto instruments = std::vector<std::string>( {{"INTER", "SURF", "CRISP", "POLREF", "OFFSPEC"}}); @@ -114,6 +118,14 @@ void QtMainWindowView::onSaveBatchRequested(bool) { m_notifyee->notifySaveBatchRequested(m_ui.mainTabs->currentIndex()); } +void QtMainWindowView::onShowOptionsRequested(bool) { + m_notifyee->notifyShowOptionsRequested(); +} + +void QtMainWindowView::onShowSlitCalculatorRequested(bool) { + m_notifyee->notifyShowSlitCalculatorRequested(); +} + void QtMainWindowView::subscribe(MainWindowSubscriber *notifyee) { m_notifyee = notifyee; } diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/QtMainWindowView.h b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/QtMainWindowView.h index 400af1ad7523aa4b487f0de7284ef08347eaa6ed..550abdcf3587b57735516e51b94461a68ff7da03 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/QtMainWindowView.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/MainWindow/QtMainWindowView.h @@ -65,6 +65,8 @@ public slots: void onNewBatchRequested(bool); void onLoadBatchRequested(bool); void onSaveBatchRequested(bool); + void onShowOptionsRequested(bool); + void onShowSlitCalculatorRequested(bool); private: /// Initializes the interface