Skip to content
Snippets Groups Projects
Commit f6177374 authored by Dan Nixon's avatar Dan Nixon
Browse files

Merge remote-tracking branch 'origin/feature/10457_qtreflmainview_clean_up'

parents 56759bd6 49e699c6
No related merge requests found
...@@ -91,17 +91,18 @@ namespace MantidQt ...@@ -91,17 +91,18 @@ namespace MantidQt
QSignalMapper* m_openMap; QSignalMapper* m_openMap;
private slots: private slots:
void on_actionNewTable_triggered();
void on_actionSaveTable_triggered();
void on_actionSaveTableAs_triggered();
void on_actionAppendRow_triggered();
void on_actionPrependRow_triggered();
void on_actionDeleteRow_triggered();
void on_actionProcess_triggered();
void on_actionGroupRows_triggered();
void on_actionExpandSelection_triggered();
void on_actionOptionsDialog_triggered();
void setModel(QString name); void setModel(QString name);
void actionNewTable();
void actionSave();
void actionSaveAs();
void actionAppendRow();
void actionPrependRow();
void actionDeleteRow();
void actionProcess();
void actionGroupRows();
void actionExpandSelection();
void actionOptionsDialog();
void tableUpdated(const QModelIndex& topLeft, const QModelIndex& bottomRight); void tableUpdated(const QModelIndex& topLeft, const QModelIndex& bottomRight);
void showContextMenu(const QPoint& pos); void showContextMenu(const QPoint& pos);
}; };
......
...@@ -232,49 +232,15 @@ ...@@ -232,49 +232,15 @@
<number>1</number> <number>1</number>
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="layoutTableButtons"> <widget class="QToolBar" name="rowToolBar">
<item> <property name="styleSheet">
<widget class="QToolButton" name="buttonAppendRow"> <string>QToolBar{border: none;}</string>
<property name="text"> </property>
<string>AppendRow</string> <addaction name="actionAppendRow"/>
</property> <addaction name="actionDeleteRow"/>
</widget> <addaction name="actionGroupRows"/>
</item> <addaction name="actionExpandSelection"/>
<item> </widget>
<widget class="QToolButton" name="buttonDeleteRow">
<property name="text">
<string>DeleteRow</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonGroupRows">
<property name="text">
<string>GroupRows</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonExpandSelection">
<property name="text">
<string>ExpandSelection</string>
</property>
</widget>
</item>
<item>
<spacer name="spacerTableButtons">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QTableView" name="viewTable"> <widget class="QTableView" name="viewTable">
...@@ -319,7 +285,11 @@ ...@@ -319,7 +285,11 @@
<number>1</number> <number>1</number>
</property> </property>
<item> <item>
<widget class="QProgressBar" name="progressBar"/> <widget class="QProgressBar" name="progressBar">
<property name="value">
<number>0</number>
</property>
</widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="labelProcessInstrument"> <widget class="QLabel" name="labelProcessInstrument">
...@@ -478,7 +448,7 @@ ...@@ -478,7 +448,7 @@
<normaloff>:/drag_curves.png</normaloff>:/drag_curves.png</iconset> <normaloff>:/drag_curves.png</normaloff>:/drag_curves.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Group Rows</string> <string>Group Selected</string>
</property> </property>
</action> </action>
<action name="actionProcess"> <action name="actionProcess">
......
...@@ -36,37 +36,18 @@ namespace MantidQt ...@@ -36,37 +36,18 @@ namespace MantidQt
{ {
ui.setupUi(this); ui.setupUi(this);
ui.buttonAppendRow->setDefaultAction(ui.actionAppendRow);
ui.buttonDeleteRow->setDefaultAction(ui.actionDeleteRow);
ui.buttonGroupRows->setDefaultAction(ui.actionGroupRows);
ui.buttonExpandSelection->setDefaultAction(ui.actionExpandSelection);
ui.buttonProcess->setDefaultAction(ui.actionProcess); ui.buttonProcess->setDefaultAction(ui.actionProcess);
//Expand the process runs column at the expense of the search column //Expand the process runs column at the expense of the search column
ui.splitterTables->setStretchFactor(0, 0); ui.splitterTables->setStretchFactor(0, 0);
ui.splitterTables->setStretchFactor(1, 1); ui.splitterTables->setStretchFactor(1, 1);
//Zero out the progress bar
ui.progressBar->setRange(0, 100);
ui.progressBar->setValue(0);
//Allow rows to be reordered //Allow rows to be reordered
ui.viewTable->verticalHeader()->setMovable(true); ui.viewTable->verticalHeader()->setMovable(true);
//Custom context menu for table //Custom context menu for table
connect(ui.viewTable, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showContextMenu(const QPoint&))); connect(ui.viewTable, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showContextMenu(const QPoint&)));
connect(ui.actionSaveTable, SIGNAL(triggered()), this, SLOT(actionSave()));
connect(ui.actionSaveTableAs, SIGNAL(triggered()), this, SLOT(actionSaveAs()));
connect(ui.actionNewTable, SIGNAL(triggered()), this, SLOT(actionNewTable()));
connect(ui.actionAppendRow, SIGNAL(triggered()), this, SLOT(actionAppendRow()));
connect(ui.actionPrependRow, SIGNAL(triggered()), this, SLOT(actionPrependRow()));
connect(ui.actionDeleteRow, SIGNAL(triggered()), this, SLOT(actionDeleteRow()));
connect(ui.actionProcess, SIGNAL(triggered()), this, SLOT(actionProcess()));
connect(ui.actionGroupRows, SIGNAL(triggered()), this, SLOT(actionGroupRows()));
connect(ui.actionExpandSelection, SIGNAL(triggered()), this, SLOT(actionExpandSelection()));
connect(ui.actionOptionsDialog, SIGNAL(triggered()), this, SLOT(actionOptionsDialog()));
//Finally, create a presenter to do the thinking for us //Finally, create a presenter to do the thinking for us
m_presenter = boost::shared_ptr<IReflPresenter>(new ReflMainViewPresenter(this)); m_presenter = boost::shared_ptr<IReflPresenter>(new ReflMainViewPresenter(this));
} }
...@@ -118,7 +99,7 @@ namespace MantidQt ...@@ -118,7 +99,7 @@ namespace MantidQt
/** /**
This slot notifies the presenter that the "save" button has been pressed This slot notifies the presenter that the "save" button has been pressed
*/ */
void QtReflMainView::actionSave() void QtReflMainView::on_actionSaveTable_triggered()
{ {
m_presenter->notify(SaveFlag); m_presenter->notify(SaveFlag);
} }
...@@ -126,7 +107,7 @@ namespace MantidQt ...@@ -126,7 +107,7 @@ namespace MantidQt
/** /**
This slot notifies the presenter that the "save as" button has been pressed This slot notifies the presenter that the "save as" button has been pressed
*/ */
void QtReflMainView::actionSaveAs() void QtReflMainView::on_actionSaveTableAs_triggered()
{ {
m_presenter->notify(SaveAsFlag); m_presenter->notify(SaveAsFlag);
} }
...@@ -134,7 +115,7 @@ namespace MantidQt ...@@ -134,7 +115,7 @@ namespace MantidQt
/** /**
This slot notifies the presenter that the "append row" button has been pressed This slot notifies the presenter that the "append row" button has been pressed
*/ */
void QtReflMainView::actionAppendRow() void QtReflMainView::on_actionAppendRow_triggered()
{ {
m_presenter->notify(AppendRowFlag); m_presenter->notify(AppendRowFlag);
} }
...@@ -142,7 +123,7 @@ namespace MantidQt ...@@ -142,7 +123,7 @@ namespace MantidQt
/** /**
This slot notifies the presenter that the "prepend row" button has been pressed This slot notifies the presenter that the "prepend row" button has been pressed
*/ */
void QtReflMainView::actionPrependRow() void QtReflMainView::on_actionPrependRow_triggered()
{ {
m_presenter->notify(PrependRowFlag); m_presenter->notify(PrependRowFlag);
} }
...@@ -150,7 +131,7 @@ namespace MantidQt ...@@ -150,7 +131,7 @@ namespace MantidQt
/** /**
This slot notifies the presenter that the "delete" button has been pressed This slot notifies the presenter that the "delete" button has been pressed
*/ */
void QtReflMainView::actionDeleteRow() void QtReflMainView::on_actionDeleteRow_triggered()
{ {
m_presenter->notify(DeleteRowFlag); m_presenter->notify(DeleteRowFlag);
} }
...@@ -158,7 +139,7 @@ namespace MantidQt ...@@ -158,7 +139,7 @@ namespace MantidQt
/** /**
This slot notifies the presenter that the "process" button has been pressed This slot notifies the presenter that the "process" button has been pressed
*/ */
void QtReflMainView::actionProcess() void QtReflMainView::on_actionProcess_triggered()
{ {
m_presenter->notify(ProcessFlag); m_presenter->notify(ProcessFlag);
} }
...@@ -166,7 +147,7 @@ namespace MantidQt ...@@ -166,7 +147,7 @@ namespace MantidQt
/** /**
This slot notifies the presenter that the "group rows" button has been pressed This slot notifies the presenter that the "group rows" button has been pressed
*/ */
void QtReflMainView::actionGroupRows() void QtReflMainView::on_actionGroupRows_triggered()
{ {
m_presenter->notify(GroupRowsFlag); m_presenter->notify(GroupRowsFlag);
} }
...@@ -174,7 +155,7 @@ namespace MantidQt ...@@ -174,7 +155,7 @@ namespace MantidQt
/** /**
This slot notifies the presenter that the "new table" button has been pressed This slot notifies the presenter that the "new table" button has been pressed
*/ */
void QtReflMainView::actionNewTable() void QtReflMainView::on_actionNewTable_triggered()
{ {
m_presenter->notify(NewTableFlag); m_presenter->notify(NewTableFlag);
} }
...@@ -182,27 +163,27 @@ namespace MantidQt ...@@ -182,27 +163,27 @@ namespace MantidQt
/** /**
This slot notifies the presenter that the "expand selection" button has been pressed This slot notifies the presenter that the "expand selection" button has been pressed
*/ */
void QtReflMainView::actionExpandSelection() void QtReflMainView::on_actionExpandSelection_triggered()
{ {
m_presenter->notify(ExpandSelectionFlag); m_presenter->notify(ExpandSelectionFlag);
} }
/** /**
This slot notifies the presenter that the table has been updated/changed by the user This slot notifies the presenter that the "options..." button has been pressed
*/ */
void QtReflMainView::tableUpdated(const QModelIndex& topLeft, const QModelIndex& bottomRight) void QtReflMainView::on_actionOptionsDialog_triggered()
{ {
Q_UNUSED(topLeft); m_presenter->notify(OptionsDialogFlag);
Q_UNUSED(bottomRight);
m_presenter->notify(TableUpdatedFlag);
} }
/** /**
This slot notifies the presenter that the "options..." button has been pressed This slot notifies the presenter that the table has been updated/changed by the user
*/ */
void QtReflMainView::actionOptionsDialog() void QtReflMainView::tableUpdated(const QModelIndex& topLeft, const QModelIndex& bottomRight)
{ {
m_presenter->notify(OptionsDialogFlag); Q_UNUSED(topLeft);
Q_UNUSED(bottomRight);
m_presenter->notify(TableUpdatedFlag);
} }
/** /**
......
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