[vlc-devel] commit: Qt: no need to restart VLC to get the new toolbars. ( Jean-Baptiste Kempf )
git version control
git at videolan.org
Mon Apr 20 15:45:19 CEST 2009
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Apr 20 15:44:18 2009 +0200| [29a015e035291735f08de8d6393f27bdca422aff] | committer: Jean-Baptiste Kempf
Qt: no need to restart VLC to get the new toolbars.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=29a015e035291735f08de8d6393f27bdca422aff
---
modules/gui/qt4/dialogs/toolbar.cpp | 5 ++-
modules/gui/qt4/dialogs_provider.cpp | 3 +-
modules/gui/qt4/dialogs_provider.hpp | 2 +
modules/gui/qt4/main_interface.cpp | 40 +++++++++++++++++++++++++--------
modules/gui/qt4/main_interface.hpp | 1 +
5 files changed, 38 insertions(+), 13 deletions(-)
diff --git a/modules/gui/qt4/dialogs/toolbar.cpp b/modules/gui/qt4/dialogs/toolbar.cpp
index 90838c4..0eca8e3 100644
--- a/modules/gui/qt4/dialogs/toolbar.cpp
+++ b/modules/gui/qt4/dialogs/toolbar.cpp
@@ -247,7 +247,6 @@ void ToolbarEditDialog::changeProfile( int i )
void ToolbarEditDialog::close()
{
msg_Dbg( p_intf, "Close and save" );
- hide();
getSettings()->setValue( "MainWindow/ToolbarPos",
positionCombo->itemData( positionCombo->currentIndex() ).toInt() );
getSettings()->setValue( "MainWindow/MainToolbar1", controller1->getValue() );
@@ -255,11 +254,13 @@ void ToolbarEditDialog::close()
getSettings()->setValue( "MainWindow/AdvToolbar", controllerA->getValue() );
getSettings()->setValue( "MainWindow/InputToolbar", controller->getValue() );
getSettings()->setValue( "MainWindow/FSCtoolbar", controllerFSC->getValue() );
+ getSettings()->sync();
+ accept();
}
void ToolbarEditDialog::cancel()
{
- hide();
+ reject();
}
/************************************************
diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index 746873e..a708290 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -242,7 +242,8 @@ void DialogsProvider::podcastConfigureDialog()
void DialogsProvider::toolbarDialog()
{
ToolbarEditDialog *toolbarEditor = new ToolbarEditDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
- toolbarEditor->exec();
+ if( toolbarEditor->exec() == QDialog::Accepted )
+ emit toolBarConfUpdated();
}
void DialogsProvider::pluginDialog()
diff --git a/modules/gui/qt4/dialogs_provider.hpp b/modules/gui/qt4/dialogs_provider.hpp
index d9854b8..105697c 100644
--- a/modules/gui/qt4/dialogs_provider.hpp
+++ b/modules/gui/qt4/dialogs_provider.hpp
@@ -193,6 +193,8 @@ private slots:
void menuAction( QObject *);
void menuUpdateAction( QObject * );
void SDMenuAction( QString );
+signals:
+ void toolBarConfUpdated();
};
class DialogEvent : public QEvent
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index f02edac..bcfcb50 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -221,6 +221,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
}
CONNECT( this, askUpdate(), this, doComponentsUpdate() );
+ CONNECT( THEDP, toolBarConfUpdated(), this, recreateToolbars() );
/* Size and placement of interface */
settings->beginGroup( "MainWindow" );
@@ -408,6 +409,24 @@ void MainInterface::setVLCWindowsTitle( QString aTitle )
}
}
+void MainInterface::recreateToolbars()
+{
+ settings->beginGroup( "MainWindow" );
+ delete controls;
+ delete inputC;
+ controls = new ControlsWidget( p_intf, false, this ); /* FIXME */
+ CONNECT( controls, advancedControlsToggled( bool ),
+ this, doComponentsUpdate() );
+ CONNECT( controls, sizeChanged(),
+ this, doComponentsUpdate() );
+ inputC = new InputControlsWidget( p_intf, this );
+
+ mainLayout->insertWidget( 2, inputC, 0, Qt::AlignBottom );
+ mainLayout->insertWidget( settings->value( "ToolbarPos", 0 ).toInt() ? 0: 3,
+ controls, 0, Qt::AlignBottom );
+ settings->endGroup();
+}
+
void MainInterface::handleMainUi( QSettings *settings )
{
/* Create the main Widget and the mainLayout */
@@ -421,16 +440,7 @@ void MainInterface::handleMainUi( QSettings *settings )
mainLayout->setSpacing( 0 );
mainLayout->setMargin( 0 );
- /* Create the CONTROLS Widget */
- controls = new ControlsWidget( p_intf,
- settings->value( "adv-controls", false ).toBool(), this );
- CONNECT( controls, advancedControlsToggled( bool ),
- this, doComponentsUpdate() );
- CONNECT( controls, sizeChanged(),
- this, doComponentsUpdate() );
- inputC = new InputControlsWidget( p_intf, this );
-
- /* Visualisation */
+ /* Visualisation */
/* Disabled for now, they SUCK */
#if 0
visualSelector = new VisualSelector( p_intf );
@@ -455,6 +465,16 @@ void MainInterface::handleMainUi( QSettings *settings )
if( videoEmbeddedFlag )
videoWidget = new VideoWidget( p_intf );
+ /* Create the CONTROLS Widget */
+ controls = new ControlsWidget( p_intf,
+ settings->value( "adv-controls", false ).toBool(), this );
+ CONNECT( controls, advancedControlsToggled( bool ),
+ this, doComponentsUpdate() );
+ CONNECT( controls, sizeChanged(),
+ this, doComponentsUpdate() );
+ inputC = new InputControlsWidget( p_intf, this );
+
+
/* Add the controls Widget to the main Widget */
mainLayout->insertWidget( 0, bgWidget );
if( videoWidget ) mainLayout->insertWidget( 0, videoWidget, 10 );
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index af0dcbc..04aa241 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -166,6 +166,7 @@ public slots:
private slots:
void debug();
+ void recreateToolbars();
void doComponentsUpdate();
void setName( QString );
void setVLCWindowsTitle( QString title = "" );
More information about the vlc-devel
mailing list