[vlc-commits] commit: Qt4: Open disc: Reset path when changing disc mode. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Sun Jul 18 20:33:49 CEST 2010


vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Jul 18 20:27:54 2010 +0200| [0aef10fe623b3d3a561f5ee4da688d0b76ff272d] | committer: Jean-Baptiste Kempf 

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

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0aef10fe623b3d3a561f5ee4da688d0b76ff272d
---

 modules/gui/qt4/components/open_panels.cpp |   20 ++++++++------------
 modules/gui/qt4/components/open_panels.hpp |    9 ++++++++-
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index 6431ebd..a32d77e 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -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();
diff --git a/modules/gui/qt4/components/open_panels.hpp b/modules/gui/qt4/components/open_panels.hpp
index 723fe45..4322024 100644
--- a/modules/gui/qt4/components/open_panels.hpp
+++ b/modules/gui/qt4/components/open_panels.hpp
@@ -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:



More information about the vlc-commits mailing list