]> git.sesse.net Git - vlc/commitdiff
Qt4: Open disc: Reset path when changing disc mode.
authorHugo Beauzée-Luyssen <beauze.h@gmail.com>
Sun, 18 Jul 2010 18:27:54 +0000 (20:27 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 18 Jul 2010 18:34:10 +0000 (20:34 +0200)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/components/open_panels.cpp
modules/gui/qt4/components/open_panels.hpp

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