[vlc-commits] Qt4: add the browsed folder to the device combo
Jean-Baptiste Kempf
git at videolan.org
Mon Jun 27 21:42:26 CEST 2011
vlc/vlc-1.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Jun 8 02:49:57 2011 +0200| [15f4f967e4a339ff1423f2dac44aa9ff11b41250] | committer: Jean-Baptiste Kempf
Qt4: add the browsed folder to the device combo
(cherry picked from commit af6a6b2b5b918b55e93083889f72cf970770e82d)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=15f4f967e4a339ff1423f2dac44aa9ff11b41250
---
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 70257fa..b32108e 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -296,6 +296,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];
@@ -496,8 +497,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