vlc | branch: master | Erwan Tulou <[email protected]> | Tue Oct 11 16:16:56 
2011 +0200| [8fc17f107d6dc63f88cbb6f56279732b0c5d5079] | committer: Erwan Tulou

qt4: fix logo selection dialog box not working right away

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8fc17f107d6dc63f88cbb6f56279732b0c5d5079
---

 modules/gui/qt4/components/extended_panels.cpp |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/extended_panels.cpp 
b/modules/gui/qt4/components/extended_panels.cpp
index e1b2434..b2f5179 100644
--- a/modules/gui/qt4/components/extended_panels.cpp
+++ b/modules/gui/qt4/components/extended_panels.cpp
@@ -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 );

_______________________________________________
vlc-commits mailing list
[email protected]
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to