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