Commit 0aef10fe authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf

Qt4: Open disc: Reset path when changing disc mode.

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent cd117a88
...@@ -329,9 +329,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -329,9 +329,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
psz_cddadiscpath = var_InheritString( p_intf, "cd-audio" ); psz_cddadiscpath = var_InheritString( p_intf, "cd-audio" );
/* State to avoid overwritting the users changes with the configuration */ /* State to avoid overwritting the users changes with the configuration */
b_firstdvd = true; m_discType = None;
b_firstvcd = true;
b_firstcdda = true;
ui.browseDiscButton->setToolTip( qtr( I_DEVICE_TOOLTIP )); ui.browseDiscButton->setToolTip( qtr( I_DEVICE_TOOLTIP ));
ui.deviceCombo->setToolTip( qtr(I_DEVICE_TOOLTIP) ); ui.deviceCombo->setToolTip( qtr(I_DEVICE_TOOLTIP) );
...@@ -391,9 +389,7 @@ void DiscOpenPanel::clear() ...@@ -391,9 +389,7 @@ void DiscOpenPanel::clear()
ui.chapterSpin->setValue( 0 ); ui.chapterSpin->setValue( 0 );
ui.subtitlesSpin->setValue( -1 ); ui.subtitlesSpin->setValue( -1 );
ui.audioSpin->setValue( -1 ); ui.audioSpin->setValue( -1 );
b_firstcdda = true; m_discType = None;
b_firstdvd = true;
b_firstvcd = true;
} }
#ifdef WIN32 #ifdef WIN32
...@@ -410,10 +406,10 @@ void DiscOpenPanel::updateButtons() ...@@ -410,10 +406,10 @@ void DiscOpenPanel::updateButtons()
{ {
if ( ui.dvdRadioButton->isChecked() ) if ( ui.dvdRadioButton->isChecked() )
{ {
if( b_firstdvd ) if( m_discType != Dvd )
{ {
setDrive( psz_dvddiscpath ); setDrive( psz_dvddiscpath );
b_firstdvd = false; m_discType = Dvd;
} }
ui.titleLabel->setText( qtr("Title") ); ui.titleLabel->setText( qtr("Title") );
ui.chapterLabel->show(); ui.chapterLabel->show();
...@@ -423,10 +419,10 @@ void DiscOpenPanel::updateButtons() ...@@ -423,10 +419,10 @@ void DiscOpenPanel::updateButtons()
} }
else if ( ui.vcdRadioButton->isChecked() ) else if ( ui.vcdRadioButton->isChecked() )
{ {
if( b_firstvcd ) if( m_discType != Vcd )
{ {
setDrive( psz_vcddiscpath ); setDrive( psz_vcddiscpath );
b_firstvcd = false; m_discType = Vcd;
} }
ui.titleLabel->setText( qtr("Entry") ); ui.titleLabel->setText( qtr("Entry") );
ui.chapterLabel->hide(); ui.chapterLabel->hide();
...@@ -436,10 +432,10 @@ void DiscOpenPanel::updateButtons() ...@@ -436,10 +432,10 @@ void DiscOpenPanel::updateButtons()
} }
else /* CDDA */ else /* CDDA */
{ {
if( b_firstcdda ) if( m_discType != Cdda )
{ {
setDrive( psz_cddadiscpath ); setDrive( psz_cddadiscpath );
b_firstcdda = false; m_discType = Cdda;
} }
ui.titleLabel->setText( qtr("Track") ); ui.titleLabel->setText( qtr("Track") );
ui.chapterLabel->hide(); ui.chapterLabel->hide();
......
...@@ -161,6 +161,13 @@ public: ...@@ -161,6 +161,13 @@ public:
class DiscOpenPanel: public OpenPanel class DiscOpenPanel: public OpenPanel
{ {
Q_OBJECT Q_OBJECT
enum DiscType
{
None,
Dvd,
Vcd,
Cdda
};
public: public:
DiscOpenPanel( QWidget *, intf_thread_t * ); DiscOpenPanel( QWidget *, intf_thread_t * );
virtual ~DiscOpenPanel(); virtual ~DiscOpenPanel();
...@@ -169,7 +176,7 @@ public: ...@@ -169,7 +176,7 @@ public:
private: private:
Ui::OpenDisk ui; Ui::OpenDisk ui;
char *psz_dvddiscpath, *psz_vcddiscpath, *psz_cddadiscpath; char *psz_dvddiscpath, *psz_vcddiscpath, *psz_cddadiscpath;
bool b_firstdvd, b_firstvcd, b_firstcdda; DiscType m_discType;
public slots: public slots:
virtual void updateMRL() ; virtual void updateMRL() ;
private slots: private slots:
......
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