]> git.sesse.net Git - vlc/commitdiff
qt4: fix logo selection dialog box not working right away
authorErwan Tulou <erwan10@videolan.org>
Tue, 11 Oct 2011 14:16:56 +0000 (16:16 +0200)
committerErwan Tulou <erwan10@videolan.org>
Thu, 23 Feb 2012 16:29:59 +0000 (17:29 +0100)
This patch ensures that, as soon as the user comes back from the filename selection dialog box, the filter is updated accordingly and the expected result (logo insertion or deletion) can be seen right away.

modules/gui/qt4/components/extended_panels.cpp

index e1b24341a393587784393d02a8471941cdc86c82..b2f51796e028af2a8327587ea2ebab72bbd925f4 100644 (file)
@@ -406,20 +406,30 @@ void ExtVideo::updateFilters()
                                    : groupbox->isChecked() );
 }
 
+#define UPDATE_AND_APPLY_TEXT( widget, file ) \
+    CONNECT( ui.widget, textChanged( const QString& ), \
+             this, updateFilterOptions() ); \
+    ui.widget->setText( toNativeSeparators( file ) ); \
+    ui.widget->disconnect( SIGNAL( textChanged( const QString& ) ) );
+
 void ExtVideo::browseLogo()
 {
     QString file = QFileDialog::getOpenFileName( NULL, qtr( "Logo filenames" ),
                    p_intf->p_sys->filepath, "Images (*.png *.jpg);;All (*)" );
-    ui.logoFileText->setText( toNativeSeparators( file ) );
+
+    UPDATE_AND_APPLY_TEXT( logoFileText, file );
 }
 
 void ExtVideo::browseEraseFile()
 {
     QString file = QFileDialog::getOpenFileName( NULL, qtr( "Image mask" ),
                    p_intf->p_sys->filepath, "Images (*.png *.jpg);;All (*)" );
-    ui.eraseMaskText->setText( toNativeSeparators( file ) );
+
+    UPDATE_AND_APPLY_TEXT( eraseMaskText, file );
 }
 
+#undef UPDATE_AND_APPLY_TEXT
+
 void ExtVideo::initComboBoxItems( QObject *widget )
 {
     QComboBox *combobox = qobject_cast<QComboBox*>( widget );