Commit d76da238 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

MainWindow: Remove a silly order constraint.

There is no need to create the clip renderer before creating the library
widget.
Media Library widget default position is now "top"
parent 20d22297
...@@ -118,6 +118,15 @@ MainWindow::MainWindow( QWidget *parent ) : ...@@ -118,6 +118,15 @@ MainWindow::MainWindow( QWidget *parent ) :
canRedoChanged( UndoStack::getInstance( this )->canRedo() ); canRedoChanged( UndoStack::getInstance( this )->canRedo() );
canUndoChanged( UndoStack::getInstance( this )->canUndo() ); canUndoChanged( UndoStack::getInstance( this )->canUndo() );
//Connecting Library stuff:
const ClipRenderer* clipRenderer = qobject_cast<const ClipRenderer*>( m_clipPreview->getGenericRenderer() );
Q_ASSERT( clipRenderer != NULL );
connect( m_mediaLibrary, SIGNAL( clipSelected( Clip* ) ),
clipRenderer, SLOT( setClip( Clip* ) ) );
connect( m_mediaLibrary, SIGNAL( importRequired() ),
this, SLOT( on_actionImport_triggered() ) );
connect( Library::getInstance(), SIGNAL( clipRemoved( const QUuid& ) ),
clipRenderer, SLOT( clipUnloaded( const QUuid& ) ) );
// Wizard // Wizard
m_pWizard = new ProjectWizard( this ); m_pWizard = new ProjectWizard( this );
...@@ -409,7 +418,7 @@ MainWindow::createStatusBar() ...@@ -409,7 +418,7 @@ MainWindow::createStatusBar()
} }
void void
MainWindow::initializeDockWidgets( void ) MainWindow::initializeDockWidgets()
{ {
m_renderer = new WorkflowRenderer(); m_renderer = new WorkflowRenderer();
m_renderer->initializeRenderer(); m_renderer->initializeRenderer();
...@@ -420,11 +429,10 @@ MainWindow::initializeDockWidgets( void ) ...@@ -420,11 +429,10 @@ MainWindow::initializeDockWidgets( void )
m_importController = new ImportController(); m_importController = new ImportController();
setupLibrary();
setupEffectsList(); setupEffectsList();
setupClipPreview(); setupClipPreview();
setupProjectPreview(); setupProjectPreview();
//Clip renderer must exist before this method is called, as it connects the library with the renderer.
setupLibrary();
setupUndoRedoWidget(); setupUndoRedoWidget();
} }
...@@ -455,21 +463,12 @@ MainWindow::setupEffectsList() ...@@ -455,21 +463,12 @@ MainWindow::setupEffectsList()
void void
MainWindow::setupLibrary() MainWindow::setupLibrary()
{ {
const ClipRenderer* clipRenderer = qobject_cast<const ClipRenderer*>( m_clipPreview->getGenericRenderer() );
Q_ASSERT( clipRenderer != NULL );
QDockWidget *dockedLibrary = DockWidgetManager::getInstance()->createDockedWidget( QDockWidget *dockedLibrary = DockWidgetManager::getInstance()->createDockedWidget(
QT_TRANSLATE_NOOP( "DockWidgetManager", "Media Library" ), QT_TRANSLATE_NOOP( "DockWidgetManager", "Media Library" ),
Qt::AllDockWidgetAreas, Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures ); QDockWidget::AllDockWidgetFeatures );
m_mediaLibrary = new MediaLibrary( dockedLibrary ); m_mediaLibrary = new MediaLibrary( dockedLibrary );
connect( m_mediaLibrary, SIGNAL( clipSelected( Clip* ) ), DockWidgetManager::getInstance()->addDockedWidget( dockedLibrary, m_mediaLibrary, Qt::TopDockWidgetArea );
clipRenderer, SLOT( setClip( Clip* ) ) );
connect( m_mediaLibrary, SIGNAL( importRequired() ),
this, SLOT( on_actionImport_triggered() ) );
connect( Library::getInstance(), SIGNAL( clipRemoved( const QUuid& ) ),
clipRenderer, SLOT( clipUnloaded( const QUuid& ) ) );
DockWidgetManager::getInstance()->addDockedWidget( dockedLibrary, m_mediaLibrary, Qt::LeftDockWidgetArea );
} }
void void
......
...@@ -62,7 +62,7 @@ protected: ...@@ -62,7 +62,7 @@ protected:
virtual void closeEvent( QCloseEvent* e ); virtual void closeEvent( QCloseEvent* e );
private: private:
void initializeDockWidgets( void ); void initializeDockWidgets();
void checkFolders(); void checkFolders();
void createStatusBar(); void createStatusBar();
void createNotificationZone(); void createNotificationZone();
......
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