#include "dialogs_provider.hpp" /* Open Subtitle file */
#include "util/qt_dirs.hpp"
#include <vlc_intf_strings.h>
+#include <vlc_modules.h>
#include <QFileDialog>
#include <QDialogButtonBox>
fileList << ui.fileListWidg->item( i )->text();
}
else
+ {
fileList = dialogBox->selectedFiles();
+ for( int i = 0; i < fileList.count(); i++ )
+ fileList[i] = toNativeSeparators( fileList[i] );
+ }
/* Options */
if( ui.subCheckBox->isChecked() && !ui.subInput->text().isEmpty() ) {
psz_cddadiscpath = var_InheritString( p_intf, "cd-audio" );
/* State to avoid overwritting the users changes with the configuration */
- b_firstdvd = true;
- b_firstvcd = true;
- b_firstcdda = true;
+ m_discType = None;
ui.browseDiscButton->setToolTip( qtr( I_DEVICE_TOOLTIP ));
ui.deviceCombo->setToolTip( qtr(I_DEVICE_TOOLTIP) );
ui.chapterSpin->setValue( 0 );
ui.subtitlesSpin->setValue( -1 );
ui.audioSpin->setValue( -1 );
- b_firstcdda = true;
- b_firstdvd = true;
- b_firstvcd = true;
+ m_discType = None;
}
#ifdef WIN32
{
if ( ui.dvdRadioButton->isChecked() )
{
- if( b_firstdvd )
+ if( m_discType != Dvd )
{
setDrive( psz_dvddiscpath );
- b_firstdvd = false;
+ m_discType = Dvd;
}
ui.titleLabel->setText( qtr("Title") );
ui.chapterLabel->show();
}
else if ( ui.vcdRadioButton->isChecked() )
{
- if( b_firstvcd )
+ if( m_discType != Vcd )
{
setDrive( psz_vcddiscpath );
- b_firstvcd = false;
+ m_discType = Vcd;
}
ui.titleLabel->setText( qtr("Entry") );
ui.chapterLabel->hide();
}
else /* CDDA */
{
- if( b_firstcdda )
+ if( m_discType != Cdda )
{
setDrive( psz_cddadiscpath );
- b_firstcdda = false;
+ m_discType = Cdda;
}
ui.titleLabel->setText( qtr("Track") );
ui.chapterLabel->hide();
ui.setupUi( this );
/* CONNECTs */
- CONNECT( ui.urlText, textChanged( const QString& ), this, updateMRL());
+ CONNECT( ui.urlComboBox->lineEdit(), textChanged( const QString& ), this, updateMRL());
+ CONNECT( ui.urlComboBox, currentIndexChanged( const QString& ), this, updateMRL());
if( var_InheritBool( p_intf, "qt-recentplay" ) )
{
mrlList = new QStringListModel(
getSettings()->value( "Open/netMRL" ).toStringList() );
- QCompleter *completer = new QCompleter( mrlList, this );
- ui.urlText->setCompleter( completer );
-
- CONNECT( ui.urlText, editingFinished(), this, updateCompleter() );
+ ui.urlComboBox->setModel( mrlList );
+ ui.urlComboBox->clearEditText();
+ CONNECT( ui.urlComboBox->lineEdit(), editingFinished(), this, updateModel() );
}
else
mrlList = NULL;
+
+ ui.urlComboBox->setValidator( new UrlValidator( this ) );
+ ui.urlComboBox->setFocus();
}
NetOpenPanel::~NetOpenPanel()
{ "udp", "udp" },
};
- QString url = ui.urlText->text();
+ QString url = ui.urlComboBox->lineEdit()->text();
if( !url.contains( "://") )
return; /* nothing to do this far */
emit mrlUpdated( qsl, "" );
}
-void NetOpenPanel::updateCompleter()
+void NetOpenPanel::updateModel()
{
assert( mrlList );
QStringList tempL = mrlList->stringList();
- if( !tempL.contains( ui.urlText->text() ) )
- tempL.append( ui.urlText->text() );
+ if( !tempL.contains( ui.urlComboBox->lineEdit()->text() ) )
+ tempL.append( ui.urlComboBox->lineEdit()->text() );
mrlList->setStringList( tempL );
}
+void UrlValidator::fixup( QString& str ) const
+{
+ str = str.trimmed();
+}
+
+QValidator::State UrlValidator::validate( QString& str, int& pos ) const
+{
+ if( str.contains( ' ' ) )
+ return QValidator::Invalid;
+ if( !str.contains( "://" ) )
+ return QValidator::Intermediate;
+ return QValidator::Acceptable;
+}
+
/**************************************************************************
* Open Capture device ( DVB, PVR, V4L, and similar ) *
**************************************************************************/
bdac = new QRadioButton( "DVB-C" );
bdat = new QRadioButton( "DVB-T" );
bdaa = new QRadioButton( "ATSC" );
+ bdaq = new QRadioButton( "Clear QAM" );
bdaDevLayout->addWidget( bdaTypeLabel, 0, 0 );
bdaDevLayout->addWidget( bdas, 0, 1 );
bdaDevLayout->addWidget( bdac, 0, 2 );
bdaDevLayout->addWidget( bdat, 0, 3 );
bdaDevLayout->addWidget( bdaa, 0, 4 );
+ bdaDevLayout->addWidget( bdaq, 0, 5 );
/* bda Props */
QLabel *bdaFreqLabel =
BUTTONACT( bdat, updateButtons() );
BUTTONACT( bdac, updateButtons() );
BUTTONACT( bdaa, updateButtons() );
+ BUTTONACT( bdaq, updateButtons() );
BUTTONACT( bdas, updateMRL() );
BUTTONACT( bdat, updateMRL() );
BUTTONACT( bdac, updateMRL() );
BUTTONACT( bdaa, updateMRL() );
+ BUTTONACT( bdaq, updateMRL() );
}
#else /* WIN32 */
jackPropLayout->addWidget( jackPace, 2, 1 );
/* Auto Connect */
- jackConnect = new QCheckBox( qtr( "Auto connnection" ));
+ jackConnect = new QCheckBox( qtr( "Auto connection" ));
jackPropLayout->addWidget( jackConnect, 2, 2 );
/* Jack CONNECTs */
else if( bdat->isChecked() ) mrl = "dvb-t://";
else if( bdac->isChecked() ) mrl = "dvb-c://";
else if( bdaa->isChecked() ) mrl = "atsc://";
+ else if( bdaq->isChecked() ) mrl = "cqam://";
else return;
mrl += "frequency=" + QString::number( bdaFreq->value() );
if( bdac->isChecked() || bdat->isChecked() || bdaa->isChecked() )
bdaBandBox->show();
bdaBandLabel->show();
}
+ else if( bdaq->isChecked() )
+ {
+ bdaSrate->hide();
+ bdaSrateLabel->hide();
+ bdaBandBox->hide();
+ bdaBandLabel->hide();
+ }
break;
#else
case DVB_DEVICE: