From 5c47e96d79d373336b9d3819f5bf093d3fd96b18 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Tue, 14 Jun 2011 13:29:16 +0300 Subject: [PATCH] Added: #1303 Added undo/redo command list. --- .../src/plugins/core/main_window.cpp | 18 ++++++++++++++++-- .../src/plugins/core/main_window.h | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp index 21334f7ea..d54431a46 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp @@ -30,6 +30,7 @@ // Qt includes #include +#include #include namespace Core @@ -382,8 +383,13 @@ void MainWindow::createMenus() m_fileMenu->addAction(m_exitAction); m_editMenu = m_menuBar->addMenu(tr("&Edit")); - m_editMenu->addAction(m_undoGroup->createUndoAction(this)); - m_editMenu->addAction(m_undoGroup->createRedoAction(this)); + QAction *undoAction = m_undoGroup->createUndoAction(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->addAction(m_cutAction); m_editMenu->addAction(m_copyAction); @@ -398,6 +404,7 @@ void MainWindow::createMenus() m_viewMenu = m_menuBar->addMenu(tr("&View")); m_viewMenu->addAction(m_fullscreenAction); + m_viewMenu->addAction(m_dockWidget->toggleViewAction()); menuManager()->registerMenu(m_viewMenu, Constants::M_VIEW); m_toolsMenu = m_menuBar->addMenu(tr("&Tools")); @@ -427,6 +434,13 @@ void MainWindow::createStatusBar() void MainWindow::createDialogs() { 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() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h index ce439b885..d594692ee 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h @@ -101,6 +101,7 @@ private: QPalette m_originalPalette; QString m_lastDir; + QDockWidget *m_dockWidget; QUndoGroup *m_undoGroup; QSettings *m_settings;