Add Undo/Redo actions.

--HG--
branch : feature
This commit is contained in:
dismine 2014-06-04 15:14:57 +03:00
parent c25f6d5dd5
commit 36949b8f45
8 changed files with 22 additions and 0 deletions

View File

@ -36,6 +36,7 @@
#include "exception/vexceptionwrongid.h" #include "exception/vexceptionwrongid.h"
#include "version.h" #include "version.h"
#include "xml/vstandardmeasurements.h" #include "xml/vstandardmeasurements.h"
#include "widgets/vapplication.h"
#include <QInputDialog> #include <QInputDialog>
#include <QtCore> #include <QtCore>
@ -1708,6 +1709,21 @@ void MainWindow::CreateMenus()
separatorAct->setSeparator(true); separatorAct->setSeparator(true);
ui->menuFile->insertAction(ui->actionPreferences, separatorAct); ui->menuFile->insertAction(ui->actionPreferences, separatorAct);
UpdateRecentFileActions(); UpdateRecentFileActions();
//Add Undo/Redo actions.
QAction *undoAction = qApp->getUndoStack()->createUndoAction(this, tr("&Undo"));
undoAction->setShortcuts(QKeySequence::Undo);
undoAction->setIcon(QIcon::fromTheme("edit-undo"));
ui->menuDrawing->insertAction(ui->actionPattern_properties, undoAction);
QAction *redoAction = qApp->getUndoStack()->createRedoAction(this, tr("&Redo"));
redoAction->setShortcuts(QKeySequence::Redo);
redoAction->setIcon(QIcon::fromTheme("edit-redo"));
ui->menuDrawing->insertAction(ui->actionPattern_properties, redoAction);
separatorAct = new QAction(this);
separatorAct->setSeparator(true);
ui->menuDrawing->insertAction(ui->actionPattern_properties, separatorAct);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -34,5 +34,11 @@
<file alias="24x24/actions/list-add.png">icons/win.icon.theme/24x24/actions/list-add.png</file> <file alias="24x24/actions/list-add.png">icons/win.icon.theme/24x24/actions/list-add.png</file>
<file alias="32x32/actions/list-remove.png">icons/win.icon.theme/32x32/actions/list-remove.png</file> <file alias="32x32/actions/list-remove.png">icons/win.icon.theme/32x32/actions/list-remove.png</file>
<file alias="32x32/actions/list-add.png">icons/win.icon.theme/32x32/actions/list-add.png</file> <file alias="32x32/actions/list-add.png">icons/win.icon.theme/32x32/actions/list-add.png</file>
<file>icons/win.icon.theme/16x16/actions/edit-redo.png</file>
<file>icons/win.icon.theme/16x16/actions/edit-undo.png</file>
<file>icons/win.icon.theme/24x24/actions/edit-undo.png</file>
<file>icons/win.icon.theme/24x24/actions/edit-redo.png</file>
<file>icons/win.icon.theme/32x32/actions/edit-redo.png</file>
<file>icons/win.icon.theme/32x32/actions/edit-undo.png</file>
</qresource> </qresource>
</RCC> </RCC>