[vlc-commits] commit: Qt: sinput_pref: add dvd/cd devices listing (Francois Cartegnie )
git at videolan.org
git at videolan.org
Sun Oct 3 17:20:52 CEST 2010
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Oct 2 19:28:21 2010 +0200| [7294042bb9c3459fe0b11b1100360cd3cf8a0c87] | committer: Francois Cartegnie
Qt: sinput_pref: add dvd/cd devices listing
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7294042bb9c3459fe0b11b1100360cd3cf8a0c87
---
modules/gui/qt4/components/simple_preferences.cpp | 22 ++++++++---
modules/gui/qt4/ui/sprefs_input.ui | 40 ++++++++++++---------
2 files changed, 39 insertions(+), 23 deletions(-)
diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
index 8bc0a32..658d0a7 100644
--- a/modules/gui/qt4/components/simple_preferences.cpp
+++ b/modules/gui/qt4/components/simple_preferences.cpp
@@ -43,6 +43,7 @@
#include <QStyleFactory>
#include <QSettings>
#include <QtAlgorithms>
+#include <QDir>
#define ICON_HEIGHT 64
@@ -407,7 +408,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
/* Disk Devices */
{
- ui.DVDDevice->setToolTip(
+ ui.DVDDeviceComboBox->setToolTip(
qtr( "If this property is blank, different values\n"
"for DVD, VCD, and CDDA are set.\n"
"You can define a unique one or configure them \n"
@@ -419,14 +420,23 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
if( !strcmp( psz_cddadiscpath, psz_dvddiscpath ) &&
!strcmp( psz_dvddiscpath, psz_vcddiscpath ) )
{
- ui.DVDDevice->setText( qfu( psz_dvddiscpath ) );
+ ui.DVDDeviceComboBox->setEditText( qfu( psz_dvddiscpath ) );
}
free( psz_cddadiscpath );
free( psz_dvddiscpath );
free( psz_vcddiscpath );
}
- CONFIG_GENERIC_FILE( "dvd", File, ui.DVDLabel,
- ui.DVDDevice, ui.DVDBrowse );
+#ifndef WIN32
+ QStringList DVDDeviceComboBoxStringList = QStringList();
+ DVDDeviceComboBoxStringList
+ << "dvd*" << "scd*" << "sr*" << "sg*" << "cd*";
+ ui.DVDDeviceComboBox->addItems( QDir( "/dev/" )
+ .entryList( DVDDeviceComboBoxStringList, QDir::System )
+ .replaceInStrings( QRegExp("^"), "/dev/" )
+ );
+#endif
+ CONFIG_GENERIC( "dvd", String, ui.DVDLabel,
+ DVDDeviceComboBox->lineEdit() );
CONFIG_GENERIC_FILE( "input-record-path", Directory, ui.recordLabel,
ui.recordPath, ui.recordBrowse );
@@ -455,7 +465,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#else
ui.systemCodecBox->hide();
#endif
- optionWidgets.append( ui.DVDDevice );
+ optionWidgets.append( ui.DVDDeviceComboBox );
optionWidgets.append( ui.cachingCombo );
CONFIG_GENERIC( "ffmpeg-skiploopfilter", IntegerList, ui.filterLabel, loopFilterBox );
CONFIG_GENERIC( "sout-x264-tune", StringList, ui.x264Label, tuneBox );
@@ -752,7 +762,7 @@ void SPrefsPanel::apply()
{
/* Device default selection */
char *psz_devicepath =
- strdup( qtu( qobject_cast<QLineEdit *>(optionWidgets[inputLE] )->text() ) );
+ strdup( qtu( qobject_cast<QComboBox *>(optionWidgets[inputLE])->currentText() ) );
if( !EMPTY_STR( psz_devicepath ) )
{
config_PutPsz( p_intf, "dvd", psz_devicepath );
diff --git a/modules/gui/qt4/ui/sprefs_input.ui b/modules/gui/qt4/ui/sprefs_input.ui
index 79ed1c0..dd4e2cd 100644
--- a/modules/gui/qt4/ui/sprefs_input.ui
+++ b/modules/gui/qt4/ui/sprefs_input.ui
@@ -194,23 +194,22 @@
<string>Default optical device</string>
</property>
<property name="buddy">
- <cstring>DVDDevice</cstring>
+ <cstring>DVDDeviceComboBox</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_5">
- <item>
- <widget class="QLineEdit" name="DVDDevice"/>
- </item>
- <item>
- <widget class="QPushButton" name="DVDBrowse">
- <property name="text">
- <string>Browse...</string>
- </property>
- </widget>
- </item>
- </layout>
+ <widget class="QComboBox" name="DVDDeviceComboBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
</layout>
</widget>
@@ -340,15 +339,22 @@
</layout>
</widget>
<tabstops>
- <tabstop>DVDDevice</tabstop>
- <tabstop>DVDBrowse</tabstop>
+ <tabstop>hwAccelBox</tabstop>
+ <tabstop>PostProcLevel</tabstop>
+ <tabstop>loopFilterBox</tabstop>
+ <tabstop>systemCodecBox</tabstop>
+ <tabstop>presetBox</tabstop>
+ <tabstop>tuneBox</tabstop>
+ <tabstop>profileBox</tabstop>
+ <tabstop>levelBox</tabstop>
+ <tabstop>DVDDeviceComboBox</tabstop>
<tabstop>recordPath</tabstop>
<tabstop>recordBrowse</tabstop>
+ <tabstop>AviRepair</tabstop>
+ <tabstop>cachingCombo</tabstop>
<tabstop>proxy</tabstop>
<tabstop>live555TransportHTTPRadio</tabstop>
<tabstop>live555TransportRTSP_TCPRadio</tabstop>
- <tabstop>hwAccelBox</tabstop>
- <tabstop>loopFilterBox</tabstop>
</tabstops>
<resources/>
<connections/>
More information about the vlc-commits
mailing list