Commit c16233b3 authored by Clement CHAVANCE's avatar Clement CHAVANCE

Hide history window and set a minimum width to the medialibrary widget

parent 83d70f5a
...@@ -42,14 +42,14 @@ void DockWidgetManager::setMainWindow( MainWindow *mainWin ) ...@@ -42,14 +42,14 @@ void DockWidgetManager::setMainWindow( MainWindow *mainWin )
m_mainWin = mainWin; m_mainWin = mainWin;
} }
void DockWidgetManager::addDockedWidget( QWidget *widget, QDockWidget* DockWidgetManager::addDockedWidget( QWidget *widget,
const QString &qs_name, const QString &qs_name,
Qt::DockWidgetAreas areas, Qt::DockWidgetAreas areas,
QDockWidget::DockWidgetFeature features, QDockWidget::DockWidgetFeature features,
Qt::DockWidgetArea startArea) Qt::DockWidgetArea startArea)
{ {
if ( m_dockWidgets.contains( qs_name ) ) if ( m_dockWidgets.contains( qs_name ) )
return ; return 0;
QDockWidget* dock = new QDockWidget( tr( qs_name.toStdString().c_str() ), m_mainWin ); QDockWidget* dock = new QDockWidget( tr( qs_name.toStdString().c_str() ), m_mainWin );
...@@ -61,6 +61,7 @@ void DockWidgetManager::addDockedWidget( QWidget *widget, ...@@ -61,6 +61,7 @@ void DockWidgetManager::addDockedWidget( QWidget *widget,
m_mainWin->addDockWidget( startArea, dock ); m_mainWin->addDockWidget( startArea, dock );
m_mainWin->registerWidgetInWindowMenu( dock ); m_mainWin->registerWidgetInWindowMenu( dock );
widget->show(); widget->show();
return dock;
} }
......
...@@ -38,7 +38,7 @@ class DockWidgetManager : public QObject ...@@ -38,7 +38,7 @@ class DockWidgetManager : public QObject
public: public:
static DockWidgetManager *instance( QObject *parent = 0 ); static DockWidgetManager *instance( QObject *parent = 0 );
void setMainWindow( MainWindow *mainWin ); void setMainWindow( MainWindow *mainWin );
void addDockedWidget( QWidget *widget, QDockWidget* addDockedWidget( QWidget *widget,
const QString &qs_name, const QString &qs_name,
Qt::DockWidgetAreas areas, Qt::DockWidgetAreas areas,
QDockWidget::DockWidgetFeature features, QDockWidget::DockWidgetFeature features,
......
...@@ -172,7 +172,6 @@ void MainWindow::setupLibrary() ...@@ -172,7 +172,6 @@ void MainWindow::setupLibrary()
tr( "Media Library" ), tr( "Media Library" ),
Qt::AllDockWidgetAreas, Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures, QDockWidget::AllDockWidgetFeatures,
Qt::LeftDockWidgetArea ); Qt::LeftDockWidgetArea );
connect( mediaLibraryWidget, SIGNAL( mediaSelected( Media* ) ), connect( mediaLibraryWidget, SIGNAL( mediaSelected( Media* ) ),
m_clipPreview->getGenericRenderer(), SLOT( setMedia( Media* ) ) ); m_clipPreview->getGenericRenderer(), SLOT( setMedia( Media* ) ) );
...@@ -298,11 +297,13 @@ void MainWindow::initializeDockWidgets( void ) ...@@ -298,11 +297,13 @@ void MainWindow::initializeDockWidgets( void )
KeyboardShortcutHelper* renderShortcut = new KeyboardShortcutHelper( "Start render preview", this ); KeyboardShortcutHelper* renderShortcut = new KeyboardShortcutHelper( "Start render preview", this );
connect( renderShortcut, SIGNAL( activated() ), m_projectPreview, SLOT( on_pushButtonPlay_clicked() ) ); connect( renderShortcut, SIGNAL( activated() ), m_projectPreview, SLOT( on_pushButtonPlay_clicked() ) );
dockManager->addDockedWidget( UndoStack::getInstance( this ), QDockWidget* dock = dockManager->addDockedWidget( UndoStack::getInstance( this ),
tr( "History" ), tr( "History" ),
Qt::AllDockWidgetAreas, Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures, QDockWidget::AllDockWidgetFeatures,
Qt::LeftDockWidgetArea ); Qt::LeftDockWidgetArea );
if ( dock != 0 )
dock->hide();
setupLibrary(); setupLibrary();
} }
......
...@@ -41,6 +41,7 @@ MediaLibraryWidget::MediaLibraryWidget( QWidget* parent ) : QWidget( parent ) ...@@ -41,6 +41,7 @@ MediaLibraryWidget::MediaLibraryWidget( QWidget* parent ) : QWidget( parent )
connect( list, SIGNAL( clipSelected( Clip* ) ), this, SIGNAL( previewClipSetted( Clip* ) ) ); connect( list, SIGNAL( clipSelected( Clip* ) ), this, SIGNAL( previewClipSetted( Clip* ) ) );
connect( this, SIGNAL( addClipToViewController( Clip* ) ), list, SLOT( newClipAdded( Clip* ) ) ); connect( this, SIGNAL( addClipToViewController( Clip* ) ), list, SLOT( newClipAdded( Clip* ) ) );
m_nav->pushViewController( list ); m_nav->pushViewController( list );
setMinimumWidth( 280 );
} }
MediaLibraryWidget::~MediaLibraryWidget() MediaLibraryWidget::~MediaLibraryWidget()
......
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