Skip to content
Snippets Groups Projects
Commit 31d3f56b authored by Gemma Guest's avatar Gemma Guest
Browse files

Add tools menu to main window menu bar

Add menu items for showing the Options dialog and the Slit Calculator
tool.

Re #26533
parent 5fa751ee
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,8 @@ public: ...@@ -29,6 +29,8 @@ public:
virtual void notifyCloseBatchRequested(int) = 0; virtual void notifyCloseBatchRequested(int) = 0;
virtual void notifySaveBatchRequested(int) = 0; virtual void notifySaveBatchRequested(int) = 0;
virtual void notifyLoadBatchRequested(int) = 0; virtual void notifyLoadBatchRequested(int) = 0;
virtual void notifyShowOptionsRequested() = 0;
virtual void notifyShowSlitCalculatorRequested() = 0;
virtual ~MainWindowSubscriber() = default; virtual ~MainWindowSubscriber() = default;
}; };
......
...@@ -77,6 +77,10 @@ void MainWindowPresenter::notifyCloseBatchRequested(int batchIndex) { ...@@ -77,6 +77,10 @@ void MainWindowPresenter::notifyCloseBatchRequested(int batchIndex) {
} }
} }
void MainWindowPresenter::notifyShowOptionsRequested() {}
void MainWindowPresenter::notifyShowSlitCalculatorRequested() {}
void MainWindowPresenter::notifyAnyBatchAutoreductionResumed() { void MainWindowPresenter::notifyAnyBatchAutoreductionResumed() {
for (const auto &batchPresenter : m_batchPresenters) { for (const auto &batchPresenter : m_batchPresenters) {
batchPresenter->notifyAnyBatchAutoreductionResumed(); batchPresenter->notifyAnyBatchAutoreductionResumed();
......
...@@ -60,6 +60,8 @@ public: ...@@ -60,6 +60,8 @@ public:
void notifyCloseBatchRequested(int batchIndex) override; void notifyCloseBatchRequested(int batchIndex) override;
void notifySaveBatchRequested(int batchIndex) override; void notifySaveBatchRequested(int batchIndex) override;
void notifyLoadBatchRequested(int batchIndex) override; void notifyLoadBatchRequested(int batchIndex) override;
void notifyShowOptionsRequested() override;
void notifyShowSlitCalculatorRequested() override;
protected: protected:
IMainWindowView *m_view; IMainWindowView *m_view;
......
...@@ -67,25 +67,43 @@ ...@@ -67,25 +67,43 @@
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuReflectometry"> <widget class="QMenu" name="menuBatch">
<property name="title"> <property name="title">
<string>Batch</string> <string>&amp;Batch</string>
</property> </property>
<addaction name="newBatch"/> <addaction name="newBatch"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="loadBatch"/> <addaction name="loadBatch"/>
<addaction name="saveBatch"/> <addaction name="saveBatch"/>
</widget> </widget>
<addaction name="menuReflectometry"/> <widget class="QMenu" name="menuTools">
<property name="title">
<string>&amp;Tools</string>
</property>
<addaction name="showOptions"/>
<addaction name="showSlitCalculator"/>
</widget>
<addaction name="menuBatch"/>
<addaction name="menuTools"/>
</widget> </widget>
<action name="newBatch"> <action name="newBatch">
<property name="text"> <property name="text">
<string>New</string> <string>&amp;New</string>
</property> </property>
</action> </action>
<action name="loadBatch"> <action name="loadBatch">
<property name="text"> <property name="text">
<string>Load</string> <string>&amp;Load</string>
</property>
</action>
<action name="showOptions">
<property name="text">
<string>&amp;Options</string>
</property>
</action>
<action name="showSlitCalculator">
<property name="text">
<string>&amp;Slit Calculator</string>
</property> </property>
</action> </action>
<action name="saveBatch"> <action name="saveBatch">
......
...@@ -62,6 +62,10 @@ void QtMainWindowView::initLayout() { ...@@ -62,6 +62,10 @@ void QtMainWindowView::initLayout() {
SLOT(onLoadBatchRequested(bool))); SLOT(onLoadBatchRequested(bool)));
connect(m_ui.saveBatch, SIGNAL(triggered(bool)), this, connect(m_ui.saveBatch, SIGNAL(triggered(bool)), this,
SLOT(onSaveBatchRequested(bool))); 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>( auto instruments = std::vector<std::string>(
{{"INTER", "SURF", "CRISP", "POLREF", "OFFSPEC"}}); {{"INTER", "SURF", "CRISP", "POLREF", "OFFSPEC"}});
...@@ -114,6 +118,14 @@ void QtMainWindowView::onSaveBatchRequested(bool) { ...@@ -114,6 +118,14 @@ void QtMainWindowView::onSaveBatchRequested(bool) {
m_notifyee->notifySaveBatchRequested(m_ui.mainTabs->currentIndex()); 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) { void QtMainWindowView::subscribe(MainWindowSubscriber *notifyee) {
m_notifyee = notifyee; m_notifyee = notifyee;
} }
......
...@@ -65,6 +65,8 @@ public slots: ...@@ -65,6 +65,8 @@ public slots:
void onNewBatchRequested(bool); void onNewBatchRequested(bool);
void onLoadBatchRequested(bool); void onLoadBatchRequested(bool);
void onSaveBatchRequested(bool); void onSaveBatchRequested(bool);
void onShowOptionsRequested(bool);
void onShowSlitCalculatorRequested(bool);
private: private:
/// Initializes the interface /// Initializes the interface
......
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