]> git.sesse.net Git - vlc/commitdiff
Qt: re-probe the disc drives on each change of FocusPanel()
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 10 Nov 2011 00:34:50 +0000 (01:34 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 10 Nov 2011 00:35:26 +0000 (01:35 +0100)
modules/gui/qt4/components/open_panels.cpp
modules/gui/qt4/components/open_panels.hpp

index cf9ebd1b090ed11ebd3af83c3b6fa8dd28fec232..9aae4606b05b02c53018ea0958d41fb477acb2fc 100644 (file)
@@ -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()
index a49f5ee6e57f2034d3d034f8bbf447e8ed29e01c..bd714f742f35f2098b5b7df43ab4e9d4d041148f 100644 (file)
@@ -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: