Commit 7294042b authored by François Cartegnie's avatar François Cartegnie 🤞

Qt: sinput_pref: add dvd/cd devices listing

parent e6e4cb89
......@@ -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 );
......
......@@ -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/>
......
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