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