Skip to content

Commit

Permalink
refs #6133 Remove Table Toolbars.
Browse files Browse the repository at this point in the history
Should be entirely gone now.
  • Loading branch information
OwenArnold committed Jan 25, 2013
1 parent 665b67c commit 74a1b36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 52 deletions.
52 changes: 2 additions & 50 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,6 @@ void ApplicationWindow::initGlobalConstants()

d_matrix_tool_bar = true;
d_file_tool_bar = true;
d_table_tool_bar = true;
d_column_tool_bar = true;
d_edit_tool_bar = true;
d_plot_tool_bar = true;
Expand Down Expand Up @@ -1053,34 +1052,6 @@ void ApplicationWindow::initToolBars()
plotTools->addAction(actionAddImage);
plotTools->hide();

tableTools = new QToolBar(tr("Table"), this);
tableTools->setObjectName("tableTools"); // this is needed for QMainWindow::restoreState()
tableTools->setIconSize( QSize(16, 20));
addToolBar(Qt::TopToolBarArea, tableTools);

tableTools->addAction(actionPlotL);
tableTools->addAction(actionPlotP);
tableTools->addAction(actionPlotLP);
tableTools->addAction(actionPlotVerticalBars);
tableTools->addAction(actionPlotHorizontalBars);
tableTools->addAction(actionPlotArea);
tableTools->addAction(actionPlotPie);
tableTools->addAction(actionPlotHistogram);
tableTools->addAction(actionBoxPlot);
tableTools->addAction(actionPlotVectXYXY);
tableTools->addAction(actionPlotVectXYAM);
tableTools->addSeparator ();
tableTools->addAction(actionPlot3DRibbon);
tableTools->addAction(actionPlot3DBars);
tableTools->addAction(actionPlot3DScatter);
tableTools->addAction(actionPlot3DTrajectory);
tableTools->addSeparator();
tableTools->addAction(actionAddColToTable);
tableTools->addAction(actionShowColStatistics);
tableTools->addAction(actionShowRowStatistics);
tableTools->setEnabled(false);
tableTools->hide();

columnTools = new QToolBar(tr( "Column"), this);
columnTools->setObjectName("columnTools"); // this is needed for QMainWindow::restoreState()
columnTools->setIconSize(QSize(16, 20));
Expand Down Expand Up @@ -1197,7 +1168,6 @@ void ApplicationWindow::insertTranslatedStrings()
undoStackWindow->setWindowTitle(tr("Undo Stack"));
consoleWindow->setWindowTitle(tr("Scripting Console"));
displayBar->setWindowTitle(tr("Data Display"));
tableTools->setWindowTitle(tr("Table"));
columnTools->setWindowTitle(tr("Column"));
plotTools->setWindowTitle(tr("Plot"));
fileTools->setWindowTitle(tr("File"));
Expand Down Expand Up @@ -1776,11 +1746,6 @@ void ApplicationWindow::customToolBars(MdiSubWindow* w)
formatToolBar->show();
}
} else if (w->inherits("Table")){
if(d_table_tool_bar){
if(!tableTools->isVisible())
tableTools->show();
tableTools->setEnabled (true);
}
if (d_column_tool_bar){
if(!columnTools->isVisible())
columnTools->show();
Expand All @@ -1806,7 +1771,6 @@ void ApplicationWindow::customToolBars(MdiSubWindow* w)
void ApplicationWindow::disableToolbars()
{
plotTools->setEnabled(false);
tableTools->setEnabled(false);
columnTools->setEnabled(false);
plot3DTools->setEnabled(false);
plotMatrixBar->setEnabled(false);
Expand All @@ -1818,7 +1782,6 @@ void ApplicationWindow::hideToolbars()
displayBar->setVisible(false);
editTools->setVisible(false);
plotTools->setVisible(false);
tableTools->setVisible(false);
columnTools->setVisible(false);
plot3DTools->setVisible(false);
plotMatrixBar->setVisible(false);
Expand All @@ -1831,7 +1794,6 @@ void ApplicationWindow::showToolbars()
displayBar->setVisible(true);
editTools->setVisible(true);
plotTools->setVisible(true);
tableTools->setVisible(true);
columnTools->setVisible(true);
//plot3DTools->setVisible(true);
plotMatrixBar->setVisible(true);
Expand Down Expand Up @@ -5408,7 +5370,6 @@ void ApplicationWindow::readSettings()
settings.beginGroup("/ToolBars");
d_file_tool_bar = settings.value("/FileToolBar", true).toBool();
d_edit_tool_bar = settings.value("/EditToolBar", true).toBool();
d_table_tool_bar = settings.value("/TableToolBar", true).toBool();
d_column_tool_bar = settings.value("/ColumnToolBar", true).toBool();
d_matrix_tool_bar = settings.value("/MatrixToolBar", true).toBool();
d_plot_tool_bar = settings.value("/PlotToolBar", true).toBool();
Expand Down Expand Up @@ -5785,7 +5746,6 @@ void ApplicationWindow::saveSettings()
settings.beginGroup("/ToolBars");
settings.setValue("/FileToolBar", d_file_tool_bar);
settings.setValue("/EditToolBar", d_edit_tool_bar);
settings.setValue("/TableToolBar", d_table_tool_bar);
settings.setValue("/ColumnToolBar", d_column_tool_bar);
settings.setValue("/MatrixToolBar", d_matrix_tool_bar);
settings.setValue("/PlotToolBar", d_plot_tool_bar);
Expand Down Expand Up @@ -16843,12 +16803,6 @@ void ApplicationWindow::showToolBarsMenu()
connect(actionEditTools, SIGNAL(toggled(bool)), editTools, SLOT(setVisible(bool)));
toolBarsMenu.addAction(actionEditTools);

QAction *actionTableTools = new QAction(tableTools->windowTitle(), this);
actionTableTools->setCheckable(true);
actionTableTools->setChecked(tableTools->isVisible());
connect(actionTableTools, SIGNAL(toggled(bool)), tableTools, SLOT(setVisible(bool)));
toolBarsMenu.addAction(actionTableTools);

QAction *actionColumnTools = new QAction(columnTools->windowTitle(), this);
actionColumnTools->setCheckable(true);
actionColumnTools->setChecked(columnTools->isVisible());
Expand Down Expand Up @@ -16894,10 +16848,8 @@ void ApplicationWindow::showToolBarsMenu()
if (action->text() == plotMatrixBar->windowTitle()){
d_matrix_tool_bar = action->isChecked();
plotMatrixBar->setEnabled(w && w->isA("Matrix"));
} else if (action->text() == tableTools->windowTitle()){
d_table_tool_bar = action->isChecked();
tableTools->setEnabled(w && w->inherits("Table"));
} else if (action->text() == columnTools->windowTitle()){
}
else if (action->text() == columnTools->windowTitle()){
d_column_tool_bar = action->isChecked();
columnTools->setEnabled(w && w->inherits("Table"));
} else if (action->text() == plotTools->windowTitle()){
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ public slots:
//! Flag telling if the application is opening a project file or not
bool d_opening_file;
QString customActionsDirPath;
bool d_matrix_tool_bar, d_file_tool_bar, d_table_tool_bar, d_column_tool_bar, d_edit_tool_bar;
bool d_matrix_tool_bar, d_file_tool_bar, d_column_tool_bar, d_edit_tool_bar;
bool d_plot_tool_bar, d_plot3D_tool_bar, d_display_tool_bar, d_format_tool_bar;
bool d_backup_files;
WindowType d_init_window_type;
Expand Down Expand Up @@ -1395,7 +1395,7 @@ public slots:
CommandLineInterpreter *m_scriptInterpreter;
QMdiArea *d_workspace;

QToolBar *fileTools, *plotTools, *tableTools, *columnTools, *plot3DTools, *displayBar, *editTools, *plotMatrixBar;
QToolBar *fileTools, *plotTools, *columnTools, *plot3DTools, *displayBar, *editTools, *plotMatrixBar;
QToolBar *formatToolBar;
QToolButton *btnResults;
QWidgetList *hiddenWindows;
Expand Down

0 comments on commit 74a1b36

Please sign in to comment.