[vlc-commits] Qt: re-probe the disc drives on each change of FocusPanel()

Jean-Baptiste Kempf git at videolan.org
Thu Nov 10 01:35:33 CET 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Nov 10 01:34:50 2011 +0100| [e84ae528c532e1686925d34d9a1492fb30c0d324] | committer: Jean-Baptiste Kempf

Qt: re-probe the disc drives on each change of FocusPanel()

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

 modules/gui/qt4/components/open_panels.cpp |   39 +++++++++++++++------------
 modules/gui/qt4/components/open_panels.hpp |    3 +-
 2 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index cf9ebd1..9aae460 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -336,6 +336,28 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     ui.deviceCombo->setToolTip( qtr(I_DEVICE_TOOLTIP) );
     ui.deviceCombo->setInsertPolicy( QComboBox::InsertAtTop );
 
+    /* CONNECTs */
+    BUTTONACT( ui.dvdRadioButton, updateButtons() );
+    BUTTONACT( ui.vcdRadioButton, updateButtons() );
+    BUTTONACT( ui.audioCDRadioButton, updateButtons() );
+    BUTTONACT( ui.dvdsimple, updateButtons() );
+    BUTTONACT( ui.browseDiscButton, browseDevice() );
+    BUTTON_SET_ACT_I( ui.ejectButton, "", toolbar/eject, qtr( "Eject the disc" ),
+            eject() );
+
+    CONNECT( ui.deviceCombo, editTextChanged( QString ), this, updateMRL());
+    CONNECT( ui.deviceCombo, currentIndexChanged( QString ), this, updateMRL());
+    CONNECT( ui.titleSpin, valueChanged( int ), this, updateMRL());
+    CONNECT( ui.chapterSpin, valueChanged( int ), this, updateMRL());
+    CONNECT( ui.audioSpin, valueChanged( int ), this, updateMRL());
+    CONNECT( ui.subtitlesSpin, valueChanged( int ), this, updateMRL());
+
+    /* Run once the updateButtons function in order to fill correctly the comboBoxes */
+    updateButtons();
+}
+
+void DiscOpenPanel::onFocus()
+{
 #ifdef WIN32 /* Disc drives probing for Windows */
     wchar_t szDrives[512];
     szDrives[0] = '\0';
@@ -375,24 +397,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     POPULATE_WITH_DEVS( ppsz_discdevices, discCombo );
 #endif
 
-    /* CONNECTs */
-    BUTTONACT( ui.dvdRadioButton, updateButtons() );
-    BUTTONACT( ui.vcdRadioButton, updateButtons() );
-    BUTTONACT( ui.audioCDRadioButton, updateButtons() );
-    BUTTONACT( ui.dvdsimple, updateButtons() );
-    BUTTONACT( ui.browseDiscButton, browseDevice() );
-    BUTTON_SET_ACT_I( ui.ejectButton, "", toolbar/eject, qtr( "Eject the disc" ),
-            eject() );
 
-    CONNECT( ui.deviceCombo, editTextChanged( QString ), this, updateMRL());
-    CONNECT( ui.deviceCombo, currentIndexChanged( QString ), this, updateMRL());
-    CONNECT( ui.titleSpin, valueChanged( int ), this, updateMRL());
-    CONNECT( ui.chapterSpin, valueChanged( int ), this, updateMRL());
-    CONNECT( ui.audioSpin, valueChanged( int ), this, updateMRL());
-    CONNECT( ui.subtitlesSpin, valueChanged( int ), this, updateMRL());
-
-    /* Run once the updateButtons function in order to fill correctly the comboBoxes */
-    updateButtons();
 }
 
 DiscOpenPanel::~DiscOpenPanel()
diff --git a/modules/gui/qt4/components/open_panels.hpp b/modules/gui/qt4/components/open_panels.hpp
index a49f5ee..bd714f7 100644
--- a/modules/gui/qt4/components/open_panels.hpp
+++ b/modules/gui/qt4/components/open_panels.hpp
@@ -174,10 +174,11 @@ public:
     virtual ~DiscOpenPanel();
     virtual void clear() ;
     virtual void accept() ;
+    void onFocus();
 private:
     Ui::OpenDisk ui;
     char *psz_dvddiscpath, *psz_vcddiscpath, *psz_cddadiscpath;
-    DiscType    m_discType;
+    DiscType m_discType;
 public slots:
     virtual void updateMRL() ;
 private slots:



More information about the vlc-commits mailing list