Commit 8aa7563a authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: ConvertDialog: rewrite logic

parent 258973e8
......@@ -68,28 +68,41 @@ ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf,
destLayout->addWidget( fileSelectButton, 0, 2);
BUTTONACT( fileSelectButton, fileBrowse() );
displayBox = new QCheckBox( qtr( "Display the output" ) );
displayBox->setToolTip( qtr( "This display the resulting media, but can "
"slow things down." ) );
destLayout->addWidget( displayBox, 2, 0, 1, -1 );
mainLayout->addWidget( destBox, 1, 0, 1, -1 );
mainLayout->addWidget( destBox, 3, 0, 1, -1 );
/* Profile Editor */
QGroupBox *settingBox = new QGroupBox( qtr( "Settings" ) );
QGridLayout *settingLayout = new QGridLayout( settingBox );
profile = new VLCProfileSelector( this );
settingLayout->addWidget( profile, 0, 0, 1, -1 );
QRadioButton *convertRadio = new QRadioButton( qtr( "Convert" ) );
dumpRadio = new QRadioButton( qtr( "Dump raw input" ) );
QButtonGroup *buttonGroup = new QButtonGroup(this);
buttonGroup->addButton( convertRadio );
buttonGroup->addButton( dumpRadio );
convertRadio->setChecked( true );
settingLayout->addWidget( convertRadio, 1, 0 );
QWidget *convertPanel = new QWidget( this );
QVBoxLayout *convertLayout = new QVBoxLayout( convertPanel );
displayBox = new QCheckBox( qtr( "Display the output" ) );
displayBox->setToolTip( qtr( "This display the resulting media, but can "
"slow things down." ) );
convertLayout->addWidget( displayBox );
deinterBox = new QCheckBox( qtr( "Deinterlace" ) );
settingLayout->addWidget( deinterBox, 1, 0 );
convertLayout->addWidget( deinterBox );
profile = new VLCProfileSelector( this );
convertLayout->addWidget( profile );
dumpBox = new QCheckBox( qtr( "Dump raw input" ) );
settingLayout->addWidget( dumpBox, 1, 1 );
settingLayout->addWidget( convertPanel, 2, 0 );
mainLayout->addWidget( settingBox, 3, 0, 1, -1 );
settingLayout->addWidget( dumpRadio, 5, 0 );
mainLayout->addWidget( settingBox, 1, 0, 1, -1 );
/* Buttons */
QPushButton *okButton = new QPushButton( qtr( "&Start" ) );
......@@ -105,7 +118,7 @@ ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf,
BUTTONACT(okButton,close());
BUTTONACT(cancelButton,cancel());
CONNECT(dumpBox,toggled(bool),this,dumpChecked(bool));
CONNECT( convertRadio, toggled(bool), convertPanel, setEnabled(bool) );
CONNECT(profile, optionsChanged(), this, setDestinationFileExtension());
CONNECT(fileLine, editingFinished(), this, setDestinationFileExtension());
}
......@@ -130,7 +143,7 @@ void ConvertDialog::close()
{
hide();
if( dumpBox->isChecked() )
if( dumpRadio->isChecked() )
{
mrl = "demux=dump :demuxdump-file=" + fileLine->text();
}
......@@ -156,13 +169,6 @@ void ConvertDialog::close()
accept();
}
void ConvertDialog::dumpChecked( bool checked )
{
deinterBox->setEnabled( !checked );
displayBox->setEnabled( !checked );
profile->setEnabled( !checked );
}
void ConvertDialog::setDestinationFileExtension()
{
if( !fileLine->text().isEmpty() && profile->isEnabled() )
......
......@@ -28,6 +28,7 @@
class QLineEdit;
class QCheckBox;
class QRadioButton;
class VLCProfileSelector;
class ConvertDialog : public QVLCDialog
......@@ -42,14 +43,14 @@ public:
private:
QLineEdit *fileLine;
QCheckBox *displayBox, *deinterBox, *dumpBox;
QCheckBox *displayBox, *deinterBox;
QRadioButton *dumpRadio;
VLCProfileSelector *profile;
QString mrl;
private slots:
virtual void close();
virtual void cancel();
void fileBrowse();
void dumpChecked(bool);
void setDestinationFileExtension();
};
......
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