Commit 757962a0 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Open Capture Panel and file Panel: Don't build by hand the ComboChoices...

Make it automatic.
parent d258537d
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#endif #endif
/************************************************************************** /**************************************************************************
* File open * Open Files and subtitles *
**************************************************************************/ **************************************************************************/
FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
OpenPanel( _parent, _p_intf ) OpenPanel( _parent, _p_intf )
...@@ -65,7 +65,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -65,7 +65,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
dialogBox = new FileOpenBox( ui.tempWidget, NULL, dialogBox = new FileOpenBox( ui.tempWidget, NULL,
qfu( p_intf->p_libvlc->psz_homedir ), fileTypes ); qfu( p_intf->p_libvlc->psz_homedir ), fileTypes );
/* dialogBox->setFileMode( QFileDialog::ExistingFiles );*/ /* dialogBox->setFileMode( QFileDialog::ExistingFiles );*/
dialogBox->setAcceptMode( QFileDialog::AcceptOpen ); /* dialogBox->setAcceptMode( QFileDialog::AcceptOpen );*/
/* retrieve last known path used in file browsing */ /* retrieve last known path used in file browsing */
char *psz_filepath = config_GetPsz( p_intf, "qt-filedialog-path" ); char *psz_filepath = config_GetPsz( p_intf, "qt-filedialog-path" );
...@@ -77,6 +77,8 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -77,6 +77,8 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
/* We don't want to see a grip in the middle of the window, do we? */ /* We don't want to see a grip in the middle of the window, do we? */
dialogBox->setSizeGripEnabled( false ); dialogBox->setSizeGripEnabled( false );
/* Add a tooltip */
dialogBox->setToolTip( qtr( "Select one or multiple files, or a folder" )); dialogBox->setToolTip( qtr( "Select one or multiple files, or a folder" ));
// Add it to the layout // Add it to the layout
...@@ -84,7 +86,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -84,7 +86,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
// But hide the two OK/Cancel buttons. Enable them for debug. // But hide the two OK/Cancel buttons. Enable them for debug.
QDialogButtonBox *fileDialogAcceptBox = QDialogButtonBox *fileDialogAcceptBox =
findChildren<QDialogButtonBox*>()[0]; findChildren<QDialogButtonBox*>()[0];
fileDialogAcceptBox->hide(); fileDialogAcceptBox->hide();
/* Ugly hacks to get the good Widget */ /* Ugly hacks to get the good Widget */
...@@ -116,47 +118,23 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -116,47 +118,23 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
ui.subFrame->hide(); ui.subFrame->hide();
/* Build the subs size combo box */ /* Build the subs size combo box */
module_config_t *p_item = setfillVLCConfigCombo( "freetype-rel-fontsize" , p_intf,
config_FindConfig( VLC_OBJECT(p_intf), "freetype-rel-fontsize" ); ui.sizeSubComboBox );
if( p_item )
{
for( int i_index = 0; i_index < p_item->i_list; i_index++ )
{
ui.sizeSubComboBox->addItem(
qfu( p_item->ppsz_list_text[i_index] ),
QVariant( p_item->pi_list[i_index] ) );
if( p_item->value.i == p_item->pi_list[i_index] )
{
ui.sizeSubComboBox->setCurrentIndex( i_index );
}
}
}
/* Build the subs align combo box */ /* Build the subs align combo box */
p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-align" ); setfillVLCConfigCombo( "subsdec-align", p_intf, ui.alignSubComboBox );
if( p_item )
{
for( int i_index = 0; i_index < p_item->i_list; i_index++ )
{
ui.alignSubComboBox->addItem(
qfu( p_item->ppsz_list_text[i_index] ),
QVariant( p_item->pi_list[i_index] ) );
if( p_item->value.i == p_item->pi_list[i_index] )
{
ui.alignSubComboBox->setCurrentIndex( i_index );
}
}
}
/* Connects */ /* Connects */
BUTTONACT( ui.subBrowseButton, browseFileSub() ); BUTTONACT( ui.subBrowseButton, browseFileSub() );
BUTTONACT( ui.subCheckBox, toggleSubtitleFrame()); BUTTONACT( ui.subCheckBox, toggleSubtitleFrame());
CONNECT( ui.fileInput, editTextChanged( QString ), this, updateMRL()); CONNECT( ui.fileInput, editTextChanged( QString ), this, updateMRL() );
CONNECT( ui.subInput, editTextChanged( QString ), this, updateMRL()); CONNECT( ui.subInput, editTextChanged( QString ), this, updateMRL() );
CONNECT( ui.alignSubComboBox, currentIndexChanged( int ), this, updateMRL()); CONNECT( ui.alignSubComboBox, currentIndexChanged( int ), this,
CONNECT( ui.sizeSubComboBox, currentIndexChanged( int ), this, updateMRL()); updateMRL() );
CONNECT( lineFileEdit, textChanged( QString ), this, browseFile()); CONNECT( ui.sizeSubComboBox, currentIndexChanged( int ), this,
updateMRL() );
CONNECT( lineFileEdit, textChanged( QString ), this, browseFile() );
} }
FileOpenPanel::~FileOpenPanel() FileOpenPanel::~FileOpenPanel()
...@@ -255,13 +233,14 @@ void FileOpenPanel::toggleSubtitleFrame() ...@@ -255,13 +233,14 @@ void FileOpenPanel::toggleSubtitleFrame()
} }
/************************************************************************** /**************************************************************************
* Disk open * Open Discs ( DVD, CD, VCD and similar devices ) *
**************************************************************************/ **************************************************************************/
DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
OpenPanel( _parent, _p_intf ) OpenPanel( _parent, _p_intf )
{ {
ui.setupUi( this ); ui.setupUi( this );
/* CONNECTs */
BUTTONACT( ui.dvdRadioButton, updateButtons()); BUTTONACT( ui.dvdRadioButton, updateButtons());
BUTTONACT( ui.vcdRadioButton, updateButtons()); BUTTONACT( ui.vcdRadioButton, updateButtons());
BUTTONACT( ui.audioCDRadioButton, updateButtons()); BUTTONACT( ui.audioCDRadioButton, updateButtons());
...@@ -358,20 +337,20 @@ void DiscOpenPanel::updateMRL() ...@@ -358,20 +337,20 @@ void DiscOpenPanel::updateMRL()
QString("%1").arg( ui.subtitlesSpin->value() ); QString("%1").arg( ui.subtitlesSpin->value() );
} }
} }
emit mrlUpdated( mrl ); emit mrlUpdated( mrl );
} }
/************************************************************************** /**************************************************************************
* Net open * Open Network streams and URL pages *
**************************************************************************/ **************************************************************************/
NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
OpenPanel( _parent, _p_intf ) OpenPanel( _parent, _p_intf )
{ {
ui.setupUi( this ); ui.setupUi( this );
/* CONNECTs */
CONNECT( ui.protocolCombo, currentIndexChanged( int ), CONNECT( ui.protocolCombo, currentIndexChanged( int ),
this, updateProtocol( int ) ); this, updateProtocol( int ) );
CONNECT( ui.portSpin, valueChanged( int ), this, updateMRL() ); CONNECT( ui.portSpin, valueChanged( int ), this, updateMRL() );
...@@ -409,7 +388,6 @@ void NetOpenPanel::updateProtocol( int idx ) { ...@@ -409,7 +388,6 @@ void NetOpenPanel::updateProtocol( int idx ) {
addr.replace( QRegExp("^.*://"), proto + "://"); addr.replace( QRegExp("^.*://"), proto + "://");
ui.addressText->setText( addr ); ui.addressText->setText( addr );
} }
updateMRL(); updateMRL();
} }
...@@ -468,19 +446,21 @@ void NetOpenPanel::updateMRL() { ...@@ -468,19 +446,21 @@ void NetOpenPanel::updateMRL() {
} }
/************************************************************************** /**************************************************************************
* Capture open * Open Capture device ( DVB, PVR, V4L, and similar ) *
**************************************************************************/ **************************************************************************/
CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
OpenPanel( _parent, _p_intf ) OpenPanel( _parent, _p_intf )
{ {
ui.setupUi( this ); ui.setupUi( this );
/* Create two stacked layouts in the main comboBoxes */
QStackedLayout *stackedDevLayout = new QStackedLayout; QStackedLayout *stackedDevLayout = new QStackedLayout;
ui.cardBox->setLayout( stackedDevLayout ); ui.cardBox->setLayout( stackedDevLayout );
QStackedLayout *stackedPropLayout = new QStackedLayout; QStackedLayout *stackedPropLayout = new QStackedLayout;
ui.optionsBox->setLayout( stackedPropLayout ); ui.optionsBox->setLayout( stackedPropLayout );
/* Creation and connections of the WIdgets in the stacked layout */
#define addModuleAndLayouts( number, name, label ) \ #define addModuleAndLayouts( number, name, label ) \
QWidget * name ## DevPage = new QWidget( this ); \ QWidget * name ## DevPage = new QWidget( this ); \
QWidget * name ## PropPage = new QWidget( this ); \ QWidget * name ## PropPage = new QWidget( this ); \
...@@ -499,36 +479,36 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -499,36 +479,36 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
/******* /*******
* V4L * * V4L *
*******/ *******/
/* V4l Main */
addModuleAndLayouts( V4L_DEVICE, v4l, "Video for Linux" ); addModuleAndLayouts( V4L_DEVICE, v4l, "Video for Linux" );
/* V4l Main panel */
QLabel *v4lVideoDeviceLabel = new QLabel( qtr( "Video device name" ) ); QLabel *v4lVideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
v4lDevLayout->addWidget( v4lVideoDeviceLabel, 0, 0 ); v4lDevLayout->addWidget( v4lVideoDeviceLabel, 0, 0 );
v4lVideoDevice = new QLineEdit; v4lVideoDevice = new QLineEdit;
v4lDevLayout->addWidget( v4lVideoDevice, 0, 1 ); v4lDevLayout->addWidget( v4lVideoDevice, 0, 1 );
QLabel *v4lAudioDeviceLabel = new QLabel( qtr( "Audio device name" ) ); QLabel *v4lAudioDeviceLabel = new QLabel( qtr( "Audio device name" ) );
v4lDevLayout->addWidget( v4lAudioDeviceLabel, 1, 0 ); v4lDevLayout->addWidget( v4lAudioDeviceLabel, 1, 0 );
v4lAudioDevice = new QLineEdit; v4lAudioDevice = new QLineEdit;
v4lDevLayout->addWidget( v4lAudioDevice, 1, 1 ); v4lDevLayout->addWidget( v4lAudioDevice, 1, 1 );
/* V4l Props */ /* V4l Props panel */
v4lNormBox = new QComboBox; v4lNormBox = new QComboBox;
v4lNormBox->insertItem( 3, qtr( "Automatic" ) ); setfillVLCConfigCombo( "v4l-norm", p_intf, v4lNormBox );
v4lNormBox->insertItem( 0, "SECAM" ); v4lPropLayout->addWidget( v4lNormBox, 0 , 1 );
v4lNormBox->insertItem( 1, "NTSC" );
v4lNormBox->insertItem( 2, "PAL" );
v4lFreq = new QSpinBox; v4lFreq = new QSpinBox;
v4lFreq->setAlignment( Qt::AlignRight ); v4lFreq->setAlignment( Qt::AlignRight );
v4lFreq->setSuffix(" kHz"); v4lFreq->setSuffix(" kHz");
v4lPropLayout->addWidget( v4lFreq, 1 , 1 );
QLabel *v4lNormLabel = new QLabel( qtr( "Norm" ) ); QLabel *v4lNormLabel = new QLabel( qtr( "Norm" ) );
QLabel *v4lFreqLabel = new QLabel( qtr( "Frequency" ) );
v4lPropLayout->addWidget( v4lNormLabel, 0 , 0 ); v4lPropLayout->addWidget( v4lNormLabel, 0 , 0 );
v4lPropLayout->addWidget( v4lNormBox, 0 , 1 );
QLabel *v4lFreqLabel = new QLabel( qtr( "Frequency" ) );
v4lPropLayout->addWidget( v4lFreqLabel, 1 , 0 ); v4lPropLayout->addWidget( v4lFreqLabel, 1 , 0 );
v4lPropLayout->addWidget( v4lFreq, 1 , 1 );
/* v4l CONNECTs */ /* v4l CONNECTs */
CuMRL( v4lVideoDevice, textChanged( QString ) ); CuMRL( v4lVideoDevice, textChanged( QString ) );
...@@ -541,43 +521,44 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -541,43 +521,44 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
************/ ************/
addModuleAndLayouts( PVR_DEVICE, pvr, "PVR" ); addModuleAndLayouts( PVR_DEVICE, pvr, "PVR" );
/* PVR Main */ /* PVR Main panel */
QLabel *pvrDeviceLabel = new QLabel( qtr( "Device name" ) ); QLabel *pvrDeviceLabel = new QLabel( qtr( "Device name" ) );
pvrDevLayout->addWidget( pvrDeviceLabel, 0, 0 ); pvrDevLayout->addWidget( pvrDeviceLabel, 0, 0 );
pvrDevice = new QLineEdit; pvrDevice = new QLineEdit;
pvrDevLayout->addWidget( pvrDevice, 0, 1 ); pvrDevLayout->addWidget( pvrDevice, 0, 1 );
QLabel *pvrRadioDeviceLabel = new QLabel( qtr( "Radio device name" ) ); QLabel *pvrRadioDeviceLabel = new QLabel( qtr( "Radio device name" ) );
pvrDevLayout->addWidget( pvrRadioDeviceLabel, 1, 0 ); pvrDevLayout->addWidget( pvrRadioDeviceLabel, 1, 0 );
pvrRadioDevice = new QLineEdit; pvrRadioDevice = new QLineEdit;
pvrDevLayout->addWidget( pvrRadioDevice, 1, 1 ); pvrDevLayout->addWidget( pvrRadioDevice, 1, 1 );
/* PVR props */ /* PVR props panel */
pvrNormBox = new QComboBox; pvrNormBox = new QComboBox;
pvrNormBox->insertItem( 3, qtr( "Automatic" ) ); setfillVLCConfigCombo( "pvr-norm", p_intf, pvrNormBox );
pvrNormBox->insertItem( 0, "SECAM" ); pvrPropLayout->addWidget( pvrNormBox, 0, 1 );
pvrNormBox->insertItem( 1, "NTSC" );
pvrNormBox->insertItem( 2, "PAL" ); QLabel *pvrNormLabel = new QLabel( qtr( "Norm" ) );
pvrPropLayout->addWidget( pvrNormLabel, 0, 0 );
pvrFreq = new QSpinBox; pvrFreq = new QSpinBox;
pvrFreq->setAlignment( Qt::AlignRight ); pvrFreq->setAlignment( Qt::AlignRight );
pvrFreq->setSuffix(" kHz"); pvrFreq->setSuffix(" kHz");
setMaxBound( pvrFreq ); setMaxBound( pvrFreq );
pvrPropLayout->addWidget( pvrFreq, 1, 1 );
pvrBitr = new QSpinBox; pvrBitr = new QSpinBox;
pvrBitr->setAlignment( Qt::AlignRight ); pvrBitr->setAlignment( Qt::AlignRight );
pvrBitr->setSuffix(" kHz"); pvrBitr->setSuffix(" kHz");
setMaxBound( pvrBitr ); setMaxBound( pvrBitr );
QLabel *pvrNormLabel = new QLabel( qtr( "Norm" ) ); pvrPropLayout->addWidget( pvrBitr, 2, 1 );
QLabel *pvrFreqLabel = new QLabel( qtr( "Frequency" ) );
QLabel *pvrBitrLabel = new QLabel( qtr( "Bitrate" ) );
pvrPropLayout->addWidget( pvrNormLabel, 0, 0 );
pvrPropLayout->addWidget( pvrNormBox, 0, 1 );
QLabel *pvrFreqLabel = new QLabel( qtr( "Frequency" ) );
pvrPropLayout->addWidget( pvrFreqLabel, 1, 0 ); pvrPropLayout->addWidget( pvrFreqLabel, 1, 0 );
pvrPropLayout->addWidget( pvrFreq, 1, 1 );
QLabel *pvrBitrLabel = new QLabel( qtr( "Bitrate" ) );
pvrPropLayout->addWidget( pvrBitrLabel, 2, 0 ); pvrPropLayout->addWidget( pvrBitrLabel, 2, 0 );
pvrPropLayout->addWidget( pvrBitr, 2, 1 );
/* PVR CONNECTs */ /* PVR CONNECTs */
CuMRL( pvrDevice, textChanged( QString ) ); CuMRL( pvrDevice, textChanged( QString ) );
...@@ -592,7 +573,6 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -592,7 +573,6 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
*********************/ *********************/
addModuleAndLayouts( DSHOW_DEVICE, dshow, "DirectShow" ); addModuleAndLayouts( DSHOW_DEVICE, dshow, "DirectShow" );
/************** /**************
* BDA Stuffs * * BDA Stuffs *
**************/ **************/
...@@ -614,29 +594,30 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -614,29 +594,30 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
/* bda Props */ /* bda Props */
QLabel *bdaFreqLabel = QLabel *bdaFreqLabel =
new QLabel( qtr( "Transponder/multiplex frequency" ) ); new QLabel( qtr( "Transponder/multiplex frequency" ) );
bdaPropLayout->addWidget( bdaFreqLabel, 0, 0 );
bdaFreq = new QSpinBox; bdaFreq = new QSpinBox;
bdaFreq->setAlignment( Qt::AlignRight ); bdaFreq->setAlignment( Qt::AlignRight );
bdaFreq->setSuffix(" kHz"); bdaFreq->setSuffix(" kHz");
setMaxBound( bdaFreq ) setMaxBound( bdaFreq )
bdaPropLayout->addWidget( bdaFreqLabel, 0, 0 );
bdaPropLayout->addWidget( bdaFreq, 0, 1 ); bdaPropLayout->addWidget( bdaFreq, 0, 1 );
bdaSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) ); bdaSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) );
bdaPropLayout->addWidget( bdaSrateLabel, 1, 0 );
bdaSrate = new QSpinBox; bdaSrate = new QSpinBox;
bdaSrate->setAlignment( Qt::AlignRight ); bdaSrate->setAlignment( Qt::AlignRight );
bdaSrate->setSuffix(" kHz"); bdaSrate->setSuffix(" kHz");
setMaxBound( bdaSrate ); setMaxBound( bdaSrate );
bdaPropLayout->addWidget( bdaSrateLabel, 1, 0 );
bdaPropLayout->addWidget( bdaSrate, 1, 1 ); bdaPropLayout->addWidget( bdaSrate, 1, 1 );
bdaBandLabel = new QLabel( qtr( "Bandwidth" ) ); bdaBandLabel = new QLabel( qtr( "Bandwidth" ) );
bdaBandBox = new QComboBox;
bdaBandBox->insertItem( 0, qtr( "Automatic" ), QVariant( -1 ) );
bdaBandBox->insertItem( 1, "6 MHz", QVariant( 6 ) );
bdaBandBox->insertItem( 2, "7 MHz", QVariant( 7 ) );
bdaBandBox->insertItem( 3, "8 MHz", QVariant( 8 ) );
bdaPropLayout->addWidget( bdaBandLabel, 2, 0 ); bdaPropLayout->addWidget( bdaBandLabel, 2, 0 );
bdaBandBox = new QComboBox;
setfillVLCConfigCombo( "dvb-bandwidth", p_intf, bdaBandBox );
bdaPropLayout->addWidget( bdaBandBox, 2, 1 ); bdaPropLayout->addWidget( bdaBandBox, 2, 1 );
bdaBandLabel->hide(); bdaBandLabel->hide();
bdaBandBox->hide(); bdaBandBox->hide();
...@@ -677,28 +658,31 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -677,28 +658,31 @@ CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
dvbDevLayout->addWidget( dvbc, 1, 2 ); dvbDevLayout->addWidget( dvbc, 1, 2 );
dvbDevLayout->addWidget( dvbt, 1, 3 ); dvbDevLayout->addWidget( dvbt, 1, 3 );
/* DVB Props */ /* DVB Props panel */
QLabel *dvbFreqLabel = QLabel *dvbFreqLabel =
new QLabel( qtr( "Transponder/multiplex frequency" ) ); new QLabel( qtr( "Transponder/multiplex frequency" ) );
dvbPropLayout->addWidget( dvbFreqLabel, 0, 0 );
dvbFreq = new QSpinBox; dvbFreq = new QSpinBox;
dvbFreq->setAlignment( Qt::AlignRight ); dvbFreq->setAlignment( Qt::AlignRight );
dvbFreq->setSuffix(" kHz"); dvbFreq->setSuffix(" kHz");
setMaxBound( dvbFreq ); setMaxBound( dvbFreq );
dvbPropLayout->addWidget( dvbFreqLabel, 0, 0 );
dvbPropLayout->addWidget( dvbFreq, 0, 1 ); dvbPropLayout->addWidget( dvbFreq, 0, 1 );
QLabel *dvbSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) ); QLabel *dvbSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) );
dvbPropLayout->addWidget( dvbSrateLabel, 1, 0 );
dvbSrate = new QSpinBox; dvbSrate = new QSpinBox;
dvbSrate->setAlignment( Qt::AlignRight ); dvbSrate->setAlignment( Qt::AlignRight );
dvbSrate->setSuffix(" kHz"); dvbSrate->setSuffix(" kHz");
setMaxBound( dvbSrate ); setMaxBound( dvbSrate );
dvbPropLayout->addWidget( dvbSrateLabel, 1, 0 );
dvbPropLayout->addWidget( dvbSrate, 1, 1 ); dvbPropLayout->addWidget( dvbSrate, 1, 1 );
/* DVB CONNECTs */ /* DVB CONNECTs */
CuMRL( dvbCard, valueChanged ( int ) ); CuMRL( dvbCard, valueChanged ( int ) );
CuMRL( dvbFreq, valueChanged ( int ) ); CuMRL( dvbFreq, valueChanged ( int ) );
CuMRL( dvbSrate, valueChanged ( int ) ); CuMRL( dvbSrate, valueChanged ( int ) );
BUTTONACT( dvbs, updateButtons() ); BUTTONACT( dvbs, updateButtons() );
BUTTONACT( dvbt, updateButtons() ); BUTTONACT( dvbt, updateButtons() );
BUTTONACT( dvbc, updateButtons() ); BUTTONACT( dvbc, updateButtons() );
...@@ -759,14 +743,13 @@ void CaptureOpenPanel::updateMRL() ...@@ -759,14 +743,13 @@ void CaptureOpenPanel::updateMRL()
if( bdas->isChecked() || bdac->isChecked() ) if( bdas->isChecked() || bdac->isChecked() )
mrl += " :dvb-srate=" + QString("%1").arg( bdaSrate->value() ); mrl += " :dvb-srate=" + QString("%1").arg( bdaSrate->value() );
else else
mrl += " :dvb-bandwidth=" + mrl += " :dvb-bandwidth=" +
QString("%1").arg( bdaBandBox->itemData( QString("%1").arg( bdaBandBox->itemData(
bdaBandBox->currentIndex() ).toInt() ); bdaBandBox->currentIndex() ).toInt() );
break; break;
case DSHOW_DEVICE: case DSHOW_DEVICE:
break; break;
} }
emit mrlUpdated( mrl ); emit mrlUpdated( mrl );
} }
......
...@@ -196,3 +196,25 @@ QString VLCKeyToString( int val ) ...@@ -196,3 +196,25 @@ QString VLCKeyToString( int val )
} }
return r; return r;
} }
#include <QComboBox>
void setfillVLCConfigCombo( const char *configname, intf_thread_t *p_intf,
QComboBox *combo, QWidget *parent )
{
module_config_t *p_config =
config_FindConfig( VLC_OBJECT(p_intf), configname );
if( p_config )
{
for ( int i_index = 0; i_index < p_config->i_list; i_index++ )
{
combo->addItem( qfu( p_config->ppsz_list_text[i_index] ),
QVariant( p_config->pi_list[i_index] ) );
if( p_config->value.i == p_config->pi_list[i_index] )
{
combo->setCurrentIndex( i_index );
}
}
combo->setToolTip( qfu( p_config->psz_longtext ) );
}
}
...@@ -92,4 +92,10 @@ int qtEventToVLCKey( QKeyEvent *e ); ...@@ -92,4 +92,10 @@ int qtEventToVLCKey( QKeyEvent *e );
int qtWheelEventToVLCKey( QWheelEvent *e ); int qtWheelEventToVLCKey( QWheelEvent *e );
QString VLCKeyToString( int val ); QString VLCKeyToString( int val );
#include "qt4.hpp"
#include <vlc/vlc.h>
class QComboBox;
void setfillVLCConfigCombo(const char *configname, intf_thread_t *p_intf,
QComboBox *combo, QWidget *parent = 0 );
#endif #endif
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