]> git.sesse.net Git - vlc/commitdiff
Qt4 - make the Browse Device button to actually do something. Fix Trax#49. This has...
authorJean-Baptiste Kempf <jb@videolan.org>
Fri, 19 Oct 2007 00:30:49 +0000 (00:30 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 19 Oct 2007 00:30:49 +0000 (00:30 +0000)
modules/gui/qt4/components/open.cpp
modules/gui/qt4/components/open.hpp
modules/gui/qt4/ui/open_disk.ui

index b05453c394015f4798a90f62cd2abc90c5b907ce..fdf3909cb2525eb24d84e0879b89a2426dbcef2b 100644 (file)
@@ -247,10 +247,11 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 #endif /* Disc Probing under Windows */
 
     /* CONNECTs */
-    BUTTONACT( ui.dvdRadioButton, updateButtons());
-    BUTTONACT( ui.vcdRadioButton, updateButtons());
-    BUTTONACT( ui.audioCDRadioButton, updateButtons());
-    BUTTONACT( ui.dvdsimple,  updateButtons());
+    BUTTONACT( ui.dvdRadioButton, updateButtons() );
+    BUTTONACT( ui.vcdRadioButton, updateButtons() );
+    BUTTONACT( ui.audioCDRadioButton, updateButtons() );
+    BUTTONACT( ui.dvdsimple, updateButtons() );
+    BUTTONACT( ui.browseDiscButton, browseDevice() );
 
     CONNECT( ui.deviceCombo, editTextChanged( QString ), this, updateMRL());
     CONNECT( ui.titleSpin, valueChanged( int ), this, updateMRL());
@@ -348,6 +349,15 @@ void DiscOpenPanel::updateMRL()
     emit mrlUpdated( mrl );
 }
 
+void DiscOpenPanel::browseDevice()
+{
+    QString dir = QFileDialog::getExistingDirectory( 0, 
+            qtr("Open a device or a VIDEO_TS directory") );
+    if (!dir.isEmpty()) {
+        ui.deviceCombo->setEditText( dir );
+    }
+    updateMRL();
+}
 
 /**************************************************************************
  * Open Network streams and URL pages                                     *
index 791e3a31ea49c7e1309def07004c2c51d6fa6d37..944ed72eed3c258b74b210256f801e093b843038 100644 (file)
@@ -139,6 +139,8 @@ private:
 public slots:
     virtual void updateMRL() ;
     virtual void updateButtons() ;
+private slots:
+    void browseDevice();
 };
 
 
index 43a95824788645fb77bd2d6fb013981e3dcb3f54..f404e406c02c40398c153baf8db070bcc2488c97 100644 (file)
@@ -54,7 +54,7 @@
        </widget>
       </item>
       <item row="3" column="7" >
-       <widget class="QToolButton" name="toolButton" >
+       <widget class="QPushButton" name="browseDiscButton" >
         <property name="toolTip" >
          <string>_("Select the device")</string>
         </property>