]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/open_panels.cpp
Connect the buttons to the actions.
[vlc] / modules / gui / qt4 / components / open_panels.cpp
index a9f27f461db40ffb1caf0fd2021559f00e326f1f..40b053fa683bb2dcf432fddc4570a2c1a27bcec3 100644 (file)
@@ -161,7 +161,7 @@ void FileOpenPanel::updateMRL()
     }
 
     if( ui.subCheckBox->isChecked() ) {
-        mrl.append( " :sub-file=" + ui.subInput->text() );
+        mrl.append( " :sub-file=\"" + ui.subInput->text() + "\"" );
         int align = ui.alignSubComboBox->itemData(
                     ui.alignSubComboBox->currentIndex() ).toInt();
         mrl.append( " :subsdec-align=" + QString().setNum( align ) );
@@ -337,9 +337,9 @@ void DiscOpenPanel::updateMRL()
     /* DVD */
     if( ui.dvdRadioButton->isChecked() ) {
         if( !ui.dvdsimple->isChecked() )
-            mrl = "dvd://";
+            mrl = "\"dvd://";
         else
-            mrl = "dvdsimple://";
+            mrl = "\"dvdsimple://";
         mrl += ui.deviceCombo->currentText();
         emit methodChanged( "dvdnav-caching" );
 
@@ -352,7 +352,7 @@ void DiscOpenPanel::updateMRL()
 
     /* VCD */
     } else if ( ui.vcdRadioButton->isChecked() ) {
-        mrl = "vcd://" + ui.deviceCombo->currentText();
+        mrl = "\"vcd://" + ui.deviceCombo->currentText();
         emit methodChanged( "vcd-caching" );
 
         if( ui.titleSpin->value() > 0 ) {
@@ -361,12 +361,14 @@ void DiscOpenPanel::updateMRL()
 
     /* CDDA */
     } else {
-        mrl = "cdda://" + ui.deviceCombo->currentText();
+        mrl = "\"cdda://" + ui.deviceCombo->currentText();
         if( ui.titleSpin->value() > 0 ) {
             QString("@%1").arg( ui.titleSpin->value() );
         }
     }
 
+    mrl += "\"";
+
     if ( ui.dvdRadioButton->isChecked() || ui.vcdRadioButton->isChecked() )
     {
         if ( ui.audioSpin->value() >= 0 ) {
@@ -452,11 +454,15 @@ void NetOpenPanel::updateProtocol( int idx ) {
 void NetOpenPanel::updateMRL() {
     QString mrl = "";
     QString addr = ui.addressText->text();
+    addr = QUrl::toPercentEncoding( addr, ":/?#@!$&'()*+,;=" );
     int proto = ui.protocolCombo->currentIndex();
 
-    if( addr.contains( "://") && proto != 5 ) {
+    if( addr.contains( "://") && ( proto != 5 || proto != 6 ) )
+    {
         mrl = addr;
-    } else {
+    }
+    else
+    {
         switch( proto ) {
         case 0:
             mrl = "http://" + addr;
@@ -480,7 +486,8 @@ void NetOpenPanel::updateMRL() {
             break;
         case 5:
             mrl = "udp://@";
-            if( ui.ipv6->isEnabled() && ui.ipv6->isChecked() ) {
+            if( ui.ipv6->isEnabled() && ui.ipv6->isChecked() )
+            {
                 mrl += "[::]";
             }
             mrl += QString(":%1").arg( ui.portSpin->value() );
@@ -489,16 +496,18 @@ void NetOpenPanel::updateMRL() {
         case 6: /* UDP multicast */
             mrl = "udp://@";
             /* Add [] to IPv6 */
-            if ( addr.contains(':') && !addr.contains('[') ) {
+            if ( addr.contains(':') && !addr.contains('[') )
+            {
                 mrl += "[" + addr + "]";
-            } else mrl += addr;
+            }
+            else mrl += addr;
             mrl += QString(":%1").arg( ui.portSpin->value() );
             emit methodChanged("udp-caching");
         }
     }
 
     // Encode the boring stuffs
-    mrl = QUrl( mrl ).toEncoded();
+
     if( ui.timeShift->isEnabled() && ui.timeShift->isChecked() ) {
         mrl += " :access-filter=timeshift";
     }