Skip to content

Commit

Permalink
Re #8239. Remove unused undo stack code.
Browse files Browse the repository at this point in the history
This is inherited code from qtiPlot that was disabled on our
side a long time ago. It provided undo functionality on matrices.
  • Loading branch information
RussellTaylor committed Nov 25, 2013
1 parent 76a0da3 commit edc3872
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
24 changes: 0 additions & 24 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,16 +413,6 @@ void ApplicationWindow::init(bool factorySettings, const QStringList& args)
explorerSplitter->setSizes( splitterSizes << 45 << 45);
explorerWindow->hide();

undoStackWindow = new QDockWidget(this);
undoStackWindow->setObjectName("undoStackWindow"); // this is needed for QMainWindow::restoreState()
undoStackWindow->setWindowTitle(tr("Undo Stack"));
addDockWidget(Qt::RightDockWidgetArea, undoStackWindow);

d_undo_view = new QUndoView(undoStackWindow);
d_undo_view->setCleanIcon(QIcon(getQPixmap("filesave_xpm")));
undoStackWindow->setWidget(d_undo_view);
undoStackWindow->hide();

// Needs to be done after initialization of dock windows,
// because we now use QDockWidget::toggleViewAction()
createActions();
Expand Down Expand Up @@ -1120,7 +1110,6 @@ void ApplicationWindow::insertTranslatedStrings()

explorerWindow->setWindowTitle(tr("Project Explorer"));
logWindow->setWindowTitle(tr("Results Log"));
undoStackWindow->setWindowTitle(tr("Undo Stack"));
displayBar->setWindowTitle(tr("Data Display"));
plotTools->setWindowTitle(tr("Plot"));
standardTools->setWindowTitle(tr("Standard Tools"));
Expand Down Expand Up @@ -1436,11 +1425,6 @@ void ApplicationWindow::customMenu(MdiSubWindow* w)
// these use the same keyboard shortcut (Ctrl+Return) and should not be enabled at the same time
actionTableRecalculate->setEnabled(false);

// clear undo stack view (in case window is not a matrix)
d_undo_view->setStack(0);
actionUndo->setEnabled(false);
actionRedo->setEnabled(false);

if(w){
actionPrintAllPlots->setEnabled(projectHas2DPlots());
actionPrint->setEnabled(true);
Expand Down Expand Up @@ -1545,9 +1529,6 @@ void ApplicationWindow::customMenu(MdiSubWindow* w)
matrixMenuAboutToShow();
myMenuBar()->insertItem(tr("&Analysis"), analysisMenu);
analysisMenuAboutToShow();
d_undo_view->setEmptyLabel(w->objectName() + ": " + tr("Empty Stack"));
QUndoStack *stack = dynamic_cast<Matrix *>(w)->undoStack();
d_undo_view->setStack(stack);

} else if (w->isA("Note")) {
actionSaveTemplate->setEnabled(false);
Expand Down Expand Up @@ -12726,8 +12707,6 @@ void ApplicationWindow::createActions()
actionShowLog = logWindow->toggleViewAction();
actionShowLog->setIcon(getQPixmap("log_xpm"));

actionShowUndoStack = undoStackWindow->toggleViewAction();

actionAddLayer = new QAction(QIcon(getQPixmap("newLayer_xpm")), tr("Add La&yer"), this);
actionAddLayer->setShortcut( tr("Alt+L") );
connect(actionAddLayer, SIGNAL(activated()), this, SLOT(addLayer()));
Expand Down Expand Up @@ -13566,9 +13545,6 @@ void ApplicationWindow::translateActionsStrings()
actionShowLog->setMenuText(tr("Results &Log"));
actionShowLog->setToolTip(tr("Results Log"));

actionShowUndoStack->setMenuText(tr("&Undo/Redo Stack"));
actionShowUndoStack->setToolTip(tr("Show available undo/redo commands"));

#ifdef SCRIPTING_PYTHON
actionShowScriptWindow->setMenuText(tr("&Script Window"));
actionShowScriptWindow->setToolTip(tr("Script Window"));
Expand Down
4 changes: 1 addition & 3 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ public slots:
ScriptingWindow *scriptingWindow; //Mantid
Script *m_iface_script;
QTranslator *appTranslator, *qtTranslator;
QDockWidget *explorerWindow, *undoStackWindow;
QDockWidget *explorerWindow;
MantidQt::MantidWidgets::MessageDisplay *resultsLog;
QMdiArea *d_workspace;

Expand Down Expand Up @@ -1462,7 +1462,6 @@ public slots:
QAction *Box, *Frame, *None;
QAction *front, *back, *right, *left, *ceil, *floor, *floordata, *flooriso, *floornone;
QAction *wireframe, *hiddenline, *polygon, *filledmesh, *pointstyle, *barstyle, *conestyle, *crossHairStyle;
QAction *actionShowUndoStack;
QActionGroup *coord, *floorstyle, *grids, *plotstyle, *dataTools;
QAction *actionPanPlot;
QAction *actionWaterfallPlot;
Expand All @@ -1472,7 +1471,6 @@ public slots:

QList<QAction *> m_interfaceActions;

QUndoView *d_undo_view;
/// list of mantidmatrix windows opened from project file.
QList<MantidMatrix*> m_mantidmatrixWindows;

Expand Down

0 comments on commit edc3872

Please sign in to comment.