#include "dialogs_provider.hpp"
#include "recents.hpp"
+#include "util/qt_dirs.hpp"
#include <QTabWidget>
#include <QGridLayout>
else if( !b_rawInstance )
{
/* Request the instance but change small details:
- - Button menu
- - Modality on top of the parent dialog */
+ - Button menu */
if( b_selectMode )
- {
- instance->setWindowModality( Qt::WindowModal );
_action_flag = SELECT; /* This should be useless, but we never know
if the call is correct */
- }
+ instance->setWindowModality( Qt::WindowModal );
instance->i_action_flag = _action_flag;
instance->b_pl = _b_pl;
instance->setMenuAction();
i_action_flag = _action_flag;
b_pl =_b_pl;
- /* Workaround the Win32 Vout that put the video on top at regular times */
-#ifdef WIN32
- setWindowFlags( Qt::WindowStaysOnTopHint | Qt::Dialog );
-#endif
-
if( b_selectMode ) /* Select mode */
- {
i_action_flag = SELECT;
- setWindowModality( Qt::WindowModal );
- }
/* Basic Creation of the Window */
ui.setupUi( this );
- setWindowTitle( qtr( "Open a Media" ) );
+ setWindowTitle( qtr( "Open Media" ) );
+ setWindowRole( "vlc-open-media" );
+ setWindowModality( Qt::WindowModal );
/* Tab definition and creation */
fileOpenPanel = new FileOpenPanel( this, p_intf );
captureOpenPanel = new CaptureOpenPanel( this, p_intf );
/* Insert the tabs */
- ui.Tab->insertTab( OPEN_FILE_TAB, fileOpenPanel, qtr( "&File" ) );
- ui.Tab->insertTab( OPEN_DISC_TAB, discOpenPanel, qtr( "&Disc" ) );
- ui.Tab->insertTab( OPEN_NETWORK_TAB, netOpenPanel, qtr( "&Network" ) );
+ ui.Tab->insertTab( OPEN_FILE_TAB, fileOpenPanel, QIcon( ":/type/folder-grey" ),
+ qtr( "&File" ) );
+ ui.Tab->insertTab( OPEN_DISC_TAB, discOpenPanel, QIcon( ":/type/disc" ),
+ qtr( "&Disc" ) );
+ ui.Tab->insertTab( OPEN_NETWORK_TAB, netOpenPanel, QIcon( ":/type/network" ),
+ qtr( "&Network" ) );
ui.Tab->insertTab( OPEN_CAPTURE_TAB, captureOpenPanel,
- qtr( "Capture &Device" ) );
+ QIcon( ":/type/capture-card" ), qtr( "Capture &Device" ) );
/* Hide the Slave input widgets */
ui.slaveLabel->hide();
openButtonMenu->addAction( qtr( "&Convert" ), this, SLOT( transcode() ) ,
QKeySequence( "Alt+C" ) );
- ui.menuButton->setMenu( openButtonMenu );
- ui.menuButton->setIcon( QIcon( ":/down_arrow" ) );
+ playButton->setMenu( openButtonMenu );
/* Add the three Buttons */
ui.buttonsBox->addButton( selectButton, QDialogButtonBox::AcceptRole );
/* Force MRL update on tab change */
CONNECT( ui.Tab, currentChanged( int ), this, signalCurrent( int ) );
- CONNECT( fileOpenPanel, mrlUpdated( QStringList, QString ),
- this, updateMRL( QStringList, QString ) );
- CONNECT( netOpenPanel, mrlUpdated( QStringList, QString ),
- this, updateMRL( QStringList, QString ) );
- CONNECT( discOpenPanel, mrlUpdated( QStringList, QString ),
- this, updateMRL( QStringList, QString ) );
- CONNECT( captureOpenPanel, mrlUpdated( QStringList, QString ),
- this, updateMRL( QStringList, QString ) );
-
- CONNECT( fileOpenPanel, methodChanged( QString ),
- this, newCachingMethod( QString ) );
- CONNECT( netOpenPanel, methodChanged( QString ),
- this, newCachingMethod( QString ) );
- CONNECT( discOpenPanel, methodChanged( QString ),
- this, newCachingMethod( QString ) );
- CONNECT( captureOpenPanel, methodChanged( QString ),
- this, newCachingMethod( QString ) );
+ CONNECT( fileOpenPanel, mrlUpdated( const QStringList&, const QString& ),
+ this, updateMRL( const QStringList&, const QString& ) );
+ CONNECT( netOpenPanel, mrlUpdated( const QStringList&, const QString& ),
+ this, updateMRL( const QStringList&, const QString& ) );
+ CONNECT( discOpenPanel, mrlUpdated( const QStringList&, const QString& ),
+ this, updateMRL( const QStringList&, const QString& ) );
+ CONNECT( captureOpenPanel, mrlUpdated( const QStringList&, const QString& ),
+ this, updateMRL( const QStringList&, const QString& ) );
+
+ CONNECT( fileOpenPanel, methodChanged( const QString& ),
+ this, newCachingMethod( const QString& ) );
+ CONNECT( netOpenPanel, methodChanged( const QString& ),
+ this, newCachingMethod( const QString& ) );
+ CONNECT( discOpenPanel, methodChanged( const QString& ),
+ this, newCachingMethod( const QString& ) );
+ CONNECT( captureOpenPanel, methodChanged( const QString& ),
+ this, newCachingMethod( const QString& ) );
/* Advanced frame Connects */
CONNECT( ui.slaveCheckbox, toggled( bool ), this, updateMRL() );
- CONNECT( ui.slaveText, textChanged( QString ), this, updateMRL() );
+ CONNECT( ui.slaveText, textChanged( const QString& ), this, updateMRL() );
CONNECT( ui.cacheSpinBox, valueChanged( int ), this, updateMRL() );
- CONNECT( ui.startTimeSpinBox, valueChanged( int ), this, updateMRL() );
+ CONNECT( ui.startTimeDoubleSpinBox, valueChanged( double ), this, updateMRL() );
BUTTONACT( ui.advancedCheckBox, toggleAdvancedPanel() );
BUTTONACT( ui.slaveBrowseButton, browseInputSlave() );
BUTTONACT( cancelButton, cancel() );
/* Hide the advancedPanel */
- if( !config_GetInt( p_intf, "qt-adv-options" ) )
+ if( !var_InheritBool( p_intf, "qt-adv-options" ) )
ui.advancedFrame->hide();
else
ui.advancedCheckBox->setChecked( true );
}
playButton->show();
selectButton->hide();
- playButton->setDefault( true );
}
}
bool b_start = !i && !b_enqueue;
input_item_t *p_input;
- p_input = input_item_New( p_intf, qtu( itemsMRL[i] ), NULL );
+ char* psz_uri = make_URI( qtu( itemsMRL[i] ) );
+ p_input = input_item_New( p_intf, psz_uri, NULL );
+ free( psz_uri );
/* Insert options only for the first element.
We don't know how to edit that anyway. */
if( i == 0 )
{
/* Take options from the UI, not from what we stored */
- QStringList optionsList = ui.advancedLineInput->text().split( ":" );
+ QStringList optionsList = ui.advancedLineInput->text().split( " :" );
/* Insert options */
for( int j = 0; j < optionsList.size(); j++ )
{
- QString qs = optionsList[j].trimmed();
+ QString qs = colon_unescape( optionsList[j] );
if( !qs.isEmpty() )
{
input_item_AddOption( p_input, qtu( qs ),
/* Dbg and send :D */
msg_Dbg( p_intf, "MRL passed to the Sout: %s", qtu( soutMRL ) );
THEDP->streamingDialog( this, soutMRL, b_transcode_only,
- ui.advancedLineInput->text().split( ":" ) );
+ ui.advancedLineInput->text().split( " :" ) );
}
/* Update the MRL */
-void OpenDialog::updateMRL( QStringList item, QString tempMRL )
+void OpenDialog::updateMRL( const QStringList& item, const QString& tempMRL )
{
optionsMRL = tempMRL;
itemsMRL = item;
if( ui.slaveCheckbox->isChecked() ) {
mrl += " :input-slave=" + ui.slaveText->text();
}
- int i_cache = config_GetInt( p_intf, qtu( storedMethod ) );
- if( i_cache != ui.cacheSpinBox->value() ) {
- mrl += QString( " :%1=%2" ).arg( storedMethod ).
- arg( ui.cacheSpinBox->value() );
- }
- if( ui.startTimeSpinBox->value() ) {
- mrl += " :start-time=" + QString( "%1" ).
- arg( ui.startTimeSpinBox->value() );
+ mrl += QString( " :%1=%2" ).arg( storedMethod ).
+ arg( ui.cacheSpinBox->value() );
+ if( ui.startTimeDoubleSpinBox->value() ) {
+ mrl += " :start-time=" + QString::number( ui.startTimeDoubleSpinBox->value() );
}
ui.advancedLineInput->setText( mrl );
ui.mrlLine->setText( itemsMRL.join( " " ) );
}
-void OpenDialog::newCachingMethod( QString method )
+void OpenDialog::newCachingMethod( const QString& method )
{
if( method != storedMethod ) {
storedMethod = method;
- int i_value = config_GetInt( p_intf, qtu( storedMethod ) );
+ int i_value = var_InheritInteger( p_intf, qtu( storedMethod ) );
ui.cacheSpinBox->setValue( i_value );
}
}
-QStringList OpenDialog::SeparateEntries( QString entries )
+QStringList OpenDialog::SeparateEntries( const QString& entries )
{
bool b_quotes_mode = false;