Commit 8fc17f10 authored by Erwan Tulou's avatar 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.
parent 55a47406
...@@ -406,20 +406,30 @@ void ExtVideo::updateFilters() ...@@ -406,20 +406,30 @@ void ExtVideo::updateFilters()
: groupbox->isChecked() ); : 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() void ExtVideo::browseLogo()
{ {
QString file = QFileDialog::getOpenFileName( NULL, qtr( "Logo filenames" ), QString file = QFileDialog::getOpenFileName( NULL, qtr( "Logo filenames" ),
p_intf->p_sys->filepath, "Images (*.png *.jpg);;All (*)" ); p_intf->p_sys->filepath, "Images (*.png *.jpg);;All (*)" );
ui.logoFileText->setText( toNativeSeparators( file ) );
UPDATE_AND_APPLY_TEXT( logoFileText, file );
} }
void ExtVideo::browseEraseFile() void ExtVideo::browseEraseFile()
{ {
QString file = QFileDialog::getOpenFileName( NULL, qtr( "Image mask" ), QString file = QFileDialog::getOpenFileName( NULL, qtr( "Image mask" ),
p_intf->p_sys->filepath, "Images (*.png *.jpg);;All (*)" ); 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 ) void ExtVideo::initComboBoxItems( QObject *widget )
{ {
QComboBox *combobox = qobject_cast<QComboBox*>( widget ); QComboBox *combobox = qobject_cast<QComboBox*>( widget );
......
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