Commit 64c4b59c authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: don't allow empty file on convert dialog (fix #11072)

parent 470602d5
...@@ -105,7 +105,7 @@ ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf, ...@@ -105,7 +105,7 @@ ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf,
mainLayout->addWidget( settingBox, 1, 0, 1, -1 ); mainLayout->addWidget( settingBox, 1, 0, 1, -1 );
/* Buttons */ /* Buttons */
QPushButton *okButton = new QPushButton( qtr( "&Start" ) ); okButton = new QPushButton( qtr( "&Start" ) );
QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ) ); QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ) );
QDialogButtonBox *buttonBox = new QDialogButtonBox; QDialogButtonBox *buttonBox = new QDialogButtonBox;
...@@ -121,6 +121,9 @@ ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf, ...@@ -121,6 +121,9 @@ ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf,
CONNECT( convertRadio, toggled(bool), convertPanel, setEnabled(bool) ); CONNECT( convertRadio, toggled(bool), convertPanel, setEnabled(bool) );
CONNECT(profile, optionsChanged(), this, setDestinationFileExtension()); CONNECT(profile, optionsChanged(), this, setDestinationFileExtension());
CONNECT(fileLine, editingFinished(), this, setDestinationFileExtension()); CONNECT(fileLine, editingFinished(), this, setDestinationFileExtension());
CONNECT(fileLine, textChanged(const QString&), this, validate());
validate();
} }
void ConvertDialog::fileBrowse() void ConvertDialog::fileBrowse()
...@@ -182,3 +185,8 @@ void ConvertDialog::setDestinationFileExtension() ...@@ -182,3 +185,8 @@ void ConvertDialog::setDestinationFileExtension()
} }
} }
} }
void ConvertDialog::validate()
{
okButton->setEnabled( !fileLine->text().isEmpty() );
}
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
class QLineEdit; class QLineEdit;
class QCheckBox; class QCheckBox;
class QRadioButton; class QRadioButton;
class QPushButton;
class VLCProfileSelector; class VLCProfileSelector;
class ConvertDialog : public QVLCDialog class ConvertDialog : public QVLCDialog
...@@ -45,6 +46,7 @@ private: ...@@ -45,6 +46,7 @@ private:
QCheckBox *displayBox, *deinterBox; QCheckBox *displayBox, *deinterBox;
QRadioButton *dumpRadio; QRadioButton *dumpRadio;
QPushButton *okButton;
VLCProfileSelector *profile; VLCProfileSelector *profile;
QString mrl; QString mrl;
private slots: private slots:
...@@ -52,6 +54,7 @@ private slots: ...@@ -52,6 +54,7 @@ private slots:
virtual void cancel(); virtual void cancel();
void fileBrowse(); void fileBrowse();
void setDestinationFileExtension(); void setDestinationFileExtension();
void validate();
}; };
#endif #endif
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