Added: #1303 Added undo/redo command list.

This commit is contained in:
dnk-88 2011-06-14 13:29:16 +03:00
parent 0e3465b6a1
commit 5c47e96d79
2 changed files with 17 additions and 2 deletions

View file

@ -30,6 +30,7 @@
// Qt includes // Qt includes
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
#include <QtGui/QUndoView>
#include <QtGui/QtGui> #include <QtGui/QtGui>
namespace Core namespace Core
@ -382,8 +383,13 @@ void MainWindow::createMenus()
m_fileMenu->addAction(m_exitAction); m_fileMenu->addAction(m_exitAction);
m_editMenu = m_menuBar->addMenu(tr("&Edit")); m_editMenu = m_menuBar->addMenu(tr("&Edit"));
m_editMenu->addAction(m_undoGroup->createUndoAction(this)); QAction *undoAction = m_undoGroup->createUndoAction(this);
m_editMenu->addAction(m_undoGroup->createRedoAction(this)); undoAction->setShortcut(QKeySequence::Undo);
QAction *redoAction = m_undoGroup->createRedoAction(this);
redoAction->setShortcut(QKeySequence::Redo);
m_editMenu->addAction(undoAction);
m_editMenu->addAction(redoAction);
m_editMenu->addSeparator(); m_editMenu->addSeparator();
m_editMenu->addAction(m_cutAction); m_editMenu->addAction(m_cutAction);
m_editMenu->addAction(m_copyAction); m_editMenu->addAction(m_copyAction);
@ -398,6 +404,7 @@ void MainWindow::createMenus()
m_viewMenu = m_menuBar->addMenu(tr("&View")); m_viewMenu = m_menuBar->addMenu(tr("&View"));
m_viewMenu->addAction(m_fullscreenAction); m_viewMenu->addAction(m_fullscreenAction);
m_viewMenu->addAction(m_dockWidget->toggleViewAction());
menuManager()->registerMenu(m_viewMenu, Constants::M_VIEW); menuManager()->registerMenu(m_viewMenu, Constants::M_VIEW);
m_toolsMenu = m_menuBar->addMenu(tr("&Tools")); m_toolsMenu = m_menuBar->addMenu(tr("&Tools"));
@ -427,6 +434,13 @@ void MainWindow::createStatusBar()
void MainWindow::createDialogs() void MainWindow::createDialogs()
{ {
m_pluginView = new ExtensionSystem::CPluginView(m_pluginManager, this); m_pluginView = new ExtensionSystem::CPluginView(m_pluginManager, this);
// Create undo/redo command list
m_dockWidget = new QDockWidget("Command List", this);
m_dockWidget->setObjectName(QString::fromUtf8("UndoRedoCommandDockWidget"));
QUndoView *undoView = new QUndoView(m_undoGroup, m_dockWidget);
m_dockWidget->setWidget(undoView);
addDockWidget(Qt::RightDockWidgetArea, m_dockWidget);
} }
void MainWindow::readSettings() void MainWindow::readSettings()

View file

@ -101,6 +101,7 @@ private:
QPalette m_originalPalette; QPalette m_originalPalette;
QString m_lastDir; QString m_lastDir;
QDockWidget *m_dockWidget;
QUndoGroup *m_undoGroup; QUndoGroup *m_undoGroup;
QSettings *m_settings; QSettings *m_settings;