Commit e315142a authored by Christophe Courtaut's avatar Christophe Courtaut

Revert "GUI: Link the dock widgets with their menu action"

This reverts commit eaffc365.
parent bbab1db1
......@@ -29,10 +29,10 @@ DockWidgetManager *DockWidgetManager::m_instance = 0;
DockWidgetManager *DockWidgetManager::instance( QObject *parent )
{
if ( !m_instance )
if (m_instance == 0)
m_instance = new DockWidgetManager( parent );
return m_instance;
return (m_instance);
}
void DockWidgetManager::setMainWindow( MainWindow *mainWin )
......@@ -40,15 +40,14 @@ void DockWidgetManager::setMainWindow( MainWindow *mainWin )
m_mainWin = mainWin;
}
QDockWidget* DockWidgetManager::addDockedWidget( QWidget *widget,
void DockWidgetManager::addDockedWidget( QWidget *widget,
const QString &qs_name,
Qt::DockWidgetAreas areas,
QDockWidget::DockWidgetFeature features,
Qt::DockWidgetArea startArea,
QAction* action )
Qt::DockWidgetArea startArea)
{
if ( m_dockWidgets.contains( qs_name ) )
return NULL;
return ;
QDockWidget* dock = new QDockWidget( tr( qs_name.toStdString().c_str() ), m_mainWin );
......@@ -59,17 +58,6 @@ QDockWidget* DockWidgetManager::addDockedWidget( QWidget *widget,
m_mainWin->addDockWidget( startArea, dock );
m_mainWin->registerWidgetInViewMenu( dock );
widget->show();
if ( action )
{
// Link the dock visibility with the menu
connect( action, SIGNAL( toggled(bool) ),
dock, SLOT( setVisible(bool) ) );
connect( dock, SIGNAL( visibilityChanged(bool) ),
action, SLOT( setChecked(bool) ) );
}
return dock;
}
......
......@@ -39,12 +39,11 @@ class DockWidgetManager : public QObject
public:
static DockWidgetManager *instance( QObject *parent = 0 );
void setMainWindow( MainWindow *mainWin );
QDockWidget* addDockedWidget( QWidget *widget,
void addDockedWidget( QWidget *widget,
const QString &qs_name,
Qt::DockWidgetAreas areas,
QDockWidget::DockWidgetFeature features,
Qt::DockWidgetArea startArea,
QAction* action = 0 );
Qt::DockWidgetArea startArea );
protected:
//virtual void changeEvent( QEvent *e );
......
......@@ -108,8 +108,7 @@ void MainWindow::setupLibrary()
tr( "Media Library" ),
Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures,
Qt::LeftDockWidgetArea,
m_ui.actionMedia_library );
Qt::LeftDockWidgetArea );
//Connecting GUI and Frontend :
connect( libraryWidget,
......@@ -234,36 +233,31 @@ void MainWindow::initializeDockWidgets( void )
setCentralWidget( m_timeline );
DockWidgetManager *dockManager = DockWidgetManager::instance();
dockManager->addDockedWidget( new FileBrowser( this ),
tr( "FileBrowser" ),
Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures,
Qt::TopDockWidgetArea,
m_ui.actionFile_browser );
Qt::TopDockWidgetArea);
m_clipPreview = new PreviewWidget( new ClipRenderer, this );
dockManager->addDockedWidget( m_clipPreview,
tr( "Clip Preview" ),
Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures,
Qt::TopDockWidgetArea,
m_ui.actionClip_preview );
Qt::TopDockWidgetArea );
m_projectPreview = new PreviewWidget( new WorkflowRenderer(), this );
dockManager->addDockedWidget( m_projectPreview,
tr( "Project Preview" ),
Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures,
Qt::TopDockWidgetArea,
m_ui.actionProject_preview );
Qt::TopDockWidgetArea );
dockManager->addDockedWidget( UndoStack::getInstance( this ),
tr( "History" ),
Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures,
Qt::LeftDockWidgetArea,
m_ui.actionUndoRedo );
Qt::LeftDockWidgetArea );
setupLibrary();
m_metaDataManager = MetaDataManager::getInstance();
}
......
......@@ -27,7 +27,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>24</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
......@@ -70,11 +70,8 @@
<property name="title">
<string>Window</string>
</property>
<addaction name="actionFile_browser"/>
<addaction name="actionMedia_library"/>
<addaction name="actionProject_preview"/>
<addaction name="actionClip_preview"/>
<addaction name="actionUndoRedo"/>
<addaction name="actionMedia_Library"/>
<addaction name="actionPreview"/>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
......@@ -116,15 +113,15 @@
<string>Preferences</string>
</property>
</action>
<action name="actionMedia_library">
<action name="actionMedia_Library">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Media library</string>
<string>Media Library</string>
</property>
</action>
<action name="actionProject_preview">
<action name="actionPreview">
<property name="checkable">
<bool>true</bool>
</property>
......@@ -132,7 +129,7 @@
<bool>false</bool>
</property>
<property name="text">
<string>Project preview</string>
<string>Preview</string>
</property>
</action>
<action name="actionTranscode">
......@@ -182,30 +179,6 @@
<string>Save</string>
</property>
</action>
<action name="actionFile_browser">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>File browser</string>
</property>
</action>
<action name="actionClip_preview">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Clip preview</string>
</property>
</action>
<action name="actionUndoRedo">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Undo/Redo</string>
</property>
</action>
</widget>
<resources>
<include location="../../../ressources.qrc"/>
......
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