Commit 7294042b authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: sinput_pref: add dvd/cd devices listing

parent e6e4cb89
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <QStyleFactory> #include <QStyleFactory>
#include <QSettings> #include <QSettings>
#include <QtAlgorithms> #include <QtAlgorithms>
#include <QDir>
#define ICON_HEIGHT 64 #define ICON_HEIGHT 64
...@@ -407,7 +408,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -407,7 +408,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
/* Disk Devices */ /* Disk Devices */
{ {
ui.DVDDevice->setToolTip( ui.DVDDeviceComboBox->setToolTip(
qtr( "If this property is blank, different values\n" qtr( "If this property is blank, different values\n"
"for DVD, VCD, and CDDA are set.\n" "for DVD, VCD, and CDDA are set.\n"
"You can define a unique one or configure them \n" "You can define a unique one or configure them \n"
...@@ -419,14 +420,23 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -419,14 +420,23 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
if( !strcmp( psz_cddadiscpath, psz_dvddiscpath ) && if( !strcmp( psz_cddadiscpath, psz_dvddiscpath ) &&
!strcmp( psz_dvddiscpath, psz_vcddiscpath ) ) !strcmp( psz_dvddiscpath, psz_vcddiscpath ) )
{ {
ui.DVDDevice->setText( qfu( psz_dvddiscpath ) ); ui.DVDDeviceComboBox->setEditText( qfu( psz_dvddiscpath ) );
} }
free( psz_cddadiscpath ); free( psz_cddadiscpath );
free( psz_dvddiscpath ); free( psz_dvddiscpath );
free( psz_vcddiscpath ); free( psz_vcddiscpath );
} }
CONFIG_GENERIC_FILE( "dvd", File, ui.DVDLabel, #ifndef WIN32
ui.DVDDevice, ui.DVDBrowse ); 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, CONFIG_GENERIC_FILE( "input-record-path", Directory, ui.recordLabel,
ui.recordPath, ui.recordBrowse ); ui.recordPath, ui.recordBrowse );
...@@ -455,7 +465,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -455,7 +465,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#else #else
ui.systemCodecBox->hide(); ui.systemCodecBox->hide();
#endif #endif
optionWidgets.append( ui.DVDDevice ); optionWidgets.append( ui.DVDDeviceComboBox );
optionWidgets.append( ui.cachingCombo ); optionWidgets.append( ui.cachingCombo );
CONFIG_GENERIC( "ffmpeg-skiploopfilter", IntegerList, ui.filterLabel, loopFilterBox ); CONFIG_GENERIC( "ffmpeg-skiploopfilter", IntegerList, ui.filterLabel, loopFilterBox );
CONFIG_GENERIC( "sout-x264-tune", StringList, ui.x264Label, tuneBox ); CONFIG_GENERIC( "sout-x264-tune", StringList, ui.x264Label, tuneBox );
...@@ -752,7 +762,7 @@ void SPrefsPanel::apply() ...@@ -752,7 +762,7 @@ void SPrefsPanel::apply()
{ {
/* Device default selection */ /* Device default selection */
char *psz_devicepath = char *psz_devicepath =
strdup( qtu( qobject_cast<QLineEdit *>(optionWidgets[inputLE] )->text() ) ); strdup( qtu( qobject_cast<QComboBox *>(optionWidgets[inputLE])->currentText() ) );
if( !EMPTY_STR( psz_devicepath ) ) if( !EMPTY_STR( psz_devicepath ) )
{ {
config_PutPsz( p_intf, "dvd", psz_devicepath ); config_PutPsz( p_intf, "dvd", psz_devicepath );
......
...@@ -194,23 +194,22 @@ ...@@ -194,23 +194,22 @@
<string>Default optical device</string> <string>Default optical device</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>DVDDevice</cstring> <cstring>DVDDeviceComboBox</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5"> <widget class="QComboBox" name="DVDDeviceComboBox">
<item> <property name="sizePolicy">
<widget class="QLineEdit" name="DVDDevice"/> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
</item> <horstretch>0</horstretch>
<item> <verstretch>0</verstretch>
<widget class="QPushButton" name="DVDBrowse"> </sizepolicy>
<property name="text"> </property>
<string>Browse...</string> <property name="editable">
</property> <bool>true</bool>
</widget> </property>
</item> </widget>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>
...@@ -340,15 +339,22 @@ ...@@ -340,15 +339,22 @@
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>DVDDevice</tabstop> <tabstop>hwAccelBox</tabstop>
<tabstop>DVDBrowse</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>recordPath</tabstop>
<tabstop>recordBrowse</tabstop> <tabstop>recordBrowse</tabstop>
<tabstop>AviRepair</tabstop>
<tabstop>cachingCombo</tabstop>
<tabstop>proxy</tabstop> <tabstop>proxy</tabstop>
<tabstop>live555TransportHTTPRadio</tabstop> <tabstop>live555TransportHTTPRadio</tabstop>
<tabstop>live555TransportRTSP_TCPRadio</tabstop> <tabstop>live555TransportRTSP_TCPRadio</tabstop>
<tabstop>hwAccelBox</tabstop>
<tabstop>loopFilterBox</tabstop>
</tabstops> </tabstops>
<resources/> <resources/>
<connections/> <connections/>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment