[vlmc-devel] MainWindow: Connect the UndoView & UndoStack when a project is loaded
Hugo Beauzée-Luyssen
git at videolan.org
Tue Apr 1 00:13:29 CEST 2014
vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Apr 1 01:07:06 2014 +0300| [a170f1bd90855f68035a2da2eff3df03aa10cb24] | committer: Hugo Beauzée-Luyssen
MainWindow: Connect the UndoView & UndoStack when a project is loaded
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=a170f1bd90855f68035a2da2eff3df03aa10cb24
---
src/Gui/MainWindow.cpp | 4 ++--
src/Gui/MainWindow.h | 5 ++++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index beeddff..d83dec3 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -413,8 +413,7 @@ MainWindow::setupUndoRedoWidget()
QT_TRANSLATE_NOOP( "DockWidgetManager", "History" ),
Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures );
- QWidget *undoRedoWidget = new QUndoView( Project::getInstance()->undoStack(), dockedWidget );
-
+ QUndoView *undoRedoWidget = new QUndoView( dockedWidget );
DockWidgetManager::getInstance()->addDockedWidget( dockedWidget, undoRedoWidget, Qt::TopDockWidgetArea );
}
@@ -843,6 +842,7 @@ MainWindow::onProjectLoading(Project* project)
connect( project->undoStack(), SIGNAL( canRedoChanged( bool ) ), this, SLOT( canRedoChanged( bool ) ) );
canUndoChanged( project->undoStack()->canUndo() );
canRedoChanged( project->undoStack()->canRedo() );
+ m_undoView->setStack( project->undoStack() );
const ClipRenderer* clipRenderer = qobject_cast<const ClipRenderer*>( m_clipPreview->getGenericRenderer() );
connect( project->library(), SIGNAL( clipRemoved( const QUuid& ) ), clipRenderer, SLOT( clipUnloaded( const QUuid& ) ) );
diff --git a/src/Gui/MainWindow.h b/src/Gui/MainWindow.h
index 4795b76..514eee2 100644
--- a/src/Gui/MainWindow.h
+++ b/src/Gui/MainWindow.h
@@ -23,6 +23,8 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
+class QUndoView;
+
#include <QApplication>
#include <QSlider>
#include <QToolButton>
@@ -135,7 +137,8 @@ private:
ProjectWizard* m_wizard;
ImportController* m_importController;
MediaLibrary *m_mediaLibrary;
- EffectsListView *m_effectsList;
+ EffectsListView* m_effectsList;
+ QUndoView* m_undoView;
private slots:
void on_actionFullscreen_triggered( bool checked );
More information about the Vlmc-devel
mailing list