[vlc-commits] Qt4: add the browsed folder to the device combo

Jean-Baptiste Kempf git at videolan.org
Wed Jun 8 02:51:16 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Jun  8 02:49:57 2011 +0200| [af6a6b2b5b918b55e93083889f72cf970770e82d] | committer: Jean-Baptiste Kempf

Qt4: add the browsed folder to the device combo

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

 modules/gui/qt4/components/open_panels.cpp |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index ce11312..6f7f381 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -334,6 +334,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
     ui.browseDiscButton->setToolTip( qtr( I_DEVICE_TOOLTIP ));
     ui.deviceCombo->setToolTip( qtr(I_DEVICE_TOOLTIP) );
+    ui.deviceCombo->setInsertPolicy( QComboBox::InsertAtTop );
 
 #ifdef WIN32 /* Disc drives probing for Windows */
     wchar_t szDrives[512];
@@ -545,8 +546,12 @@ void DiscOpenPanel::browseDevice()
 {
     QString dir = QFileDialog::getExistingDirectory( this,
             qtr( I_DEVICE_TOOLTIP ) );
-    if (!dir.isEmpty())
-        ui.deviceCombo->setEditText( toNativeSepNoSlash( dir ) );
+    if( !dir.isEmpty() )
+    {
+        ui.deviceCombo->addItem( toNativeSepNoSlash( dir ) );
+        ui.deviceCombo->setCurrentIndex( ui.deviceCombo->findText( toNativeSepNoSlash( dir ) ) );
+        updateMRL();
+    }
 
     updateMRL();
 }



More information about the vlc-commits mailing list