Commit a170f1bd authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MainWindow: Connect the UndoView & UndoStack when a project is loaded

parent 9720e9a9
...@@ -413,8 +413,7 @@ MainWindow::setupUndoRedoWidget() ...@@ -413,8 +413,7 @@ MainWindow::setupUndoRedoWidget()
QT_TRANSLATE_NOOP( "DockWidgetManager", "History" ), QT_TRANSLATE_NOOP( "DockWidgetManager", "History" ),
Qt::AllDockWidgetAreas, Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures ); QDockWidget::AllDockWidgetFeatures );
QWidget *undoRedoWidget = new QUndoView( Project::getInstance()->undoStack(), dockedWidget ); QUndoView *undoRedoWidget = new QUndoView( dockedWidget );
DockWidgetManager::getInstance()->addDockedWidget( dockedWidget, undoRedoWidget, Qt::TopDockWidgetArea ); DockWidgetManager::getInstance()->addDockedWidget( dockedWidget, undoRedoWidget, Qt::TopDockWidgetArea );
} }
...@@ -843,6 +842,7 @@ MainWindow::onProjectLoading(Project* project) ...@@ -843,6 +842,7 @@ MainWindow::onProjectLoading(Project* project)
connect( project->undoStack(), SIGNAL( canRedoChanged( bool ) ), this, SLOT( canRedoChanged( bool ) ) ); connect( project->undoStack(), SIGNAL( canRedoChanged( bool ) ), this, SLOT( canRedoChanged( bool ) ) );
canUndoChanged( project->undoStack()->canUndo() ); canUndoChanged( project->undoStack()->canUndo() );
canRedoChanged( project->undoStack()->canRedo() ); canRedoChanged( project->undoStack()->canRedo() );
m_undoView->setStack( project->undoStack() );
const ClipRenderer* clipRenderer = qobject_cast<const ClipRenderer*>( m_clipPreview->getGenericRenderer() ); const ClipRenderer* clipRenderer = qobject_cast<const ClipRenderer*>( m_clipPreview->getGenericRenderer() );
connect( project->library(), SIGNAL( clipRemoved( const QUuid& ) ), clipRenderer, SLOT( clipUnloaded( const QUuid& ) ) ); connect( project->library(), SIGNAL( clipRemoved( const QUuid& ) ), clipRenderer, SLOT( clipUnloaded( const QUuid& ) ) );
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#ifndef MAINWINDOW_H #ifndef MAINWINDOW_H
#define MAINWINDOW_H #define MAINWINDOW_H
class QUndoView;
#include <QApplication> #include <QApplication>
#include <QSlider> #include <QSlider>
#include <QToolButton> #include <QToolButton>
...@@ -135,7 +137,8 @@ private: ...@@ -135,7 +137,8 @@ private:
ProjectWizard* m_wizard; ProjectWizard* m_wizard;
ImportController* m_importController; ImportController* m_importController;
MediaLibrary *m_mediaLibrary; MediaLibrary *m_mediaLibrary;
EffectsListView *m_effectsList; EffectsListView* m_effectsList;
QUndoView* m_undoView;
private slots: private slots:
void on_actionFullscreen_triggered( bool checked ); void on_actionFullscreen_triggered( bool checked );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment