Skip to content

Commit

Permalink
Refs #10295 Change buttons to actions in Refl UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Jeffery committed Oct 1, 2014
1 parent 4ac920a commit 275ad26
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 20 deletions.
Expand Up @@ -78,12 +78,12 @@ namespace MantidQt
private slots:
void setModel(QString name);
void setNew();
void saveButton();
void saveAsButton();
void addRowButton();
void deleteRowButton();
void processButton();
void groupRowsButton();
void actionSave();
void actionSaveAs();
void actionAddRow();
void actionDeleteRow();
void actionProcess();
void actionGroupRows();
};


Expand Down
Expand Up @@ -421,6 +421,41 @@
</item>
</layout>
</widget>
<action name="actionNewTable">
<property name="text">
<string>New Table</string>
</property>
</action>
<action name="actionSaveTable">
<property name="text">
<string>Save Table</string>
</property>
</action>
<action name="actionSaveTableAs">
<property name="text">
<string>Save Table As</string>
</property>
</action>
<action name="actionAddRow">
<property name="text">
<string>Add Row</string>
</property>
</action>
<action name="actionDeleteRow">
<property name="text">
<string>Delete Row</string>
</property>
</action>
<action name="actionGroupRows">
<property name="text">
<string>Group Rows</string>
</property>
</action>
<action name="actionProcess">
<property name="text">
<string>Process</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
Expand All @@ -436,5 +471,48 @@
<tabstop>buttonProcess</tabstop>
</tabstops>
<resources/>
<connections/>
<connections>
<connection>
<sender>buttonNew</sender>
<signal>clicked()</signal>
<receiver>actionNewTable</receiver>
<slot>trigger()</slot>
</connection>
<connection>
<sender>buttonAddRow</sender>
<signal>clicked()</signal>
<receiver>actionAddRow</receiver>
<slot>trigger()</slot>
</connection>
<connection>
<sender>buttonDeleteRow</sender>
<signal>clicked()</signal>
<receiver>actionDeleteRow</receiver>
<slot>trigger()</slot>
</connection>
<connection>
<sender>buttonGroupRows</sender>
<signal>clicked()</signal>
<receiver>actionGroupRows</receiver>
<slot>trigger()</slot>
</connection>
<connection>
<sender>buttonProcess</sender>
<signal>clicked()</signal>
<receiver>actionProcess</receiver>
<slot>trigger()</slot>
</connection>
<connection>
<sender>buttonSave</sender>
<signal>clicked()</signal>
<receiver>actionSaveTable</receiver>
<slot>trigger()</slot>
</connection>
<connection>
<sender>buttonSaveAs</sender>
<signal>clicked()</signal>
<receiver>actionSaveTableAs</receiver>
<slot>trigger()</slot>
</connection>
</connections>
</ui>
26 changes: 13 additions & 13 deletions Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp
Expand Up @@ -64,13 +64,13 @@ namespace MantidQt
}

connect(ui.workspaceSelector,SIGNAL(activated(QString)),this,SLOT(setModel(QString)));
connect(ui.buttonSave, SIGNAL(clicked()),this, SLOT(saveButton()));
connect(ui.buttonSaveAs, SIGNAL(clicked()),this, SLOT(saveAsButton()));
connect(ui.buttonNew, SIGNAL(clicked()),this, SLOT(setNew()));
connect(ui.buttonAddRow, SIGNAL(clicked()),this, SLOT(addRowButton()));
connect(ui.buttonDeleteRow, SIGNAL(clicked()),this, SLOT(deleteRowButton()));
connect(ui.buttonProcess, SIGNAL(clicked()),this, SLOT(processButton()));
connect(ui.buttonGroupRows, SIGNAL(clicked()),this, SLOT(groupRowsButton()));
connect(ui.actionSaveTable, SIGNAL(triggered()),this, SLOT(actionSave()));
connect(ui.actionSaveTableAs, SIGNAL(triggered()),this, SLOT(actionSaveAs()));
connect(ui.actionNewTable, SIGNAL(triggered()),this, SLOT(setNew()));
connect(ui.actionAddRow, SIGNAL(triggered()),this, SLOT(actionAddRow()));
connect(ui.actionDeleteRow, SIGNAL(triggered()),this, SLOT(actionDeleteRow()));
connect(ui.actionProcess, SIGNAL(triggered()),this, SLOT(actionProcess()));
connect(ui.actionGroupRows, SIGNAL(triggered()),this, SLOT(actionGroupRows()));
setNew();
}

Expand Down Expand Up @@ -107,47 +107,47 @@ namespace MantidQt
/**
This slot notifies the presenter that the "save" button has been pressed
*/
void QtReflMainView::saveButton()
void QtReflMainView::actionSave()
{
m_presenter->notify(SaveFlag);
}

/**
This slot notifies the presenter that the "save as" button has been pressed
*/
void QtReflMainView::saveAsButton()
void QtReflMainView::actionSaveAs()
{
m_presenter->notify(SaveAsFlag);
}

/**
This slot notifies the presenter that the "add row" button has been pressed
*/
void QtReflMainView::addRowButton()
void QtReflMainView::actionAddRow()
{
m_presenter->notify(AddRowFlag);
}

/**
This slot notifies the presenter that the "delete" button has been pressed
*/
void QtReflMainView::deleteRowButton()
void QtReflMainView::actionDeleteRow()
{
m_presenter->notify(DeleteRowFlag);
}

/**
This slot notifies the presenter that the "process" button has been pressed
*/
void QtReflMainView::processButton()
void QtReflMainView::actionProcess()
{
m_presenter->notify(ProcessFlag);
}

/**
This slot notifies the presenter that the "group rows" button has been pressed
*/
void QtReflMainView::groupRowsButton()
void QtReflMainView::actionGroupRows()
{
m_presenter->notify(GroupRowsFlag);
}
Expand Down

0 comments on commit 275ad26

Please sign in to comment.