]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/open.cpp
make_URI: add scheme parameter
[vlc] / modules / gui / qt4 / dialogs / open.cpp
index b2e3d7e760b1dd259121442219315c31728b652d..3b157888fbc00d416757ccbfc6d40d46d865b484 100644 (file)
@@ -78,6 +78,7 @@ OpenDialog::OpenDialog( QWidget *parent,
     /* Basic Creation of the Window */
     ui.setupUi( this );
     setWindowTitle( qtr( "Open Media" ) );
+    setWindowRole( "vlc-open-media" );
     setWindowModality( Qt::WindowModal );
 
     /* Tab definition and creation */
@@ -122,8 +123,7 @@ OpenDialog::OpenDialog( QWidget *parent,
     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 );
@@ -167,7 +167,7 @@ OpenDialog::OpenDialog( QWidget *parent,
     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 );
@@ -222,7 +222,6 @@ void OpenDialog::setMenuAction()
         }
         playButton->show();
         selectButton->hide();
-        playButton->setDefault( true );
     }
 }
 
@@ -339,7 +338,9 @@ void OpenDialog::finish( bool b_enqueue = false )
         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] ), "file" );
+        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. */
@@ -405,11 +406,8 @@ void OpenDialog::updateMRL() {
     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() );
-    }
+    mrl += QString( " :%1=%2" ).arg( storedMethod ).
+                                arg( ui.cacheSpinBox->value() );
     if( ui.startTimeDoubleSpinBox->value() ) {
         mrl += " :start-time=" + QString::number( ui.startTimeDoubleSpinBox->value() );
     }
@@ -421,7 +419,7 @@ 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 );
     }
 }