Commit 29a015e0 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: no need to restart VLC to get the new toolbars.

parent 11871cfe
......@@ -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();
}
/************************************************
......
......@@ -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()
......
......@@ -193,6 +193,8 @@ private slots:
void menuAction( QObject *);
void menuUpdateAction( QObject * );
void SDMenuAction( QString );
signals:
void toolBarConfUpdated();
};
class DialogEvent : public QEvent
......
......@@ -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 );
......
......@@ -166,6 +166,7 @@ public slots:
private slots:
void debug();
void recreateToolbars();
void doComponentsUpdate();
void setName( QString );
void setVLCWindowsTitle( QString title = "" );
......
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