]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/open_panels.cpp
Qt: do not prefix VCD chapter with 'E'
[vlc] / modules / gui / qt4 / components / open_panels.cpp
index 8c3b50b0e9e589c32baadf4661628c86d5fead17..d032761bae3e123081bc50e3bb17bae616a20173 100644 (file)
@@ -336,6 +336,29 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     ui.deviceCombo->setToolTip( qtr(I_DEVICE_TOOLTIP) );
     ui.deviceCombo->setInsertPolicy( QComboBox::InsertAtTop );
 
+    /* CONNECTs */
+    BUTTONACT( ui.dvdRadioButton,     updateButtons() );
+    BUTTONACT( ui.bdRadioButton,      updateButtons() );
+    BUTTONACT( ui.vcdRadioButton,     updateButtons() );
+    BUTTONACT( ui.audioCDRadioButton, updateButtons() );
+    BUTTONACT( ui.dvdsimple,          updateButtons() );
+    BUTTONACT( ui.browseDiscButton, browseDevice() );
+    BUTTON_SET_ACT_I( ui.ejectButton, "", toolbar/eject, qtr( "Eject the disc" ),
+            eject() );
+
+    CONNECT( ui.deviceCombo, editTextChanged( QString ), this, updateMRL());
+    CONNECT( ui.deviceCombo, currentIndexChanged( QString ), this, updateMRL());
+    CONNECT( ui.titleSpin, valueChanged( int ), this, updateMRL());
+    CONNECT( ui.chapterSpin, valueChanged( int ), this, updateMRL());
+    CONNECT( ui.audioSpin, valueChanged( int ), this, updateMRL());
+    CONNECT( ui.subtitlesSpin, valueChanged( int ), this, updateMRL());
+
+    /* Run once the updateButtons function in order to fill correctly the comboBoxes */
+    updateButtons();
+}
+
+void DiscOpenPanel::onFocus()
+{
 #ifdef WIN32 /* Disc drives probing for Windows */
     wchar_t szDrives[512];
     szDrives[0] = '\0';
@@ -375,24 +398,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     POPULATE_WITH_DEVS( ppsz_discdevices, discCombo );
 #endif
 
-    /* CONNECTs */
-    BUTTONACT( ui.dvdRadioButton, updateButtons() );
-    BUTTONACT( ui.vcdRadioButton, updateButtons() );
-    BUTTONACT( ui.audioCDRadioButton, updateButtons() );
-    BUTTONACT( ui.dvdsimple, updateButtons() );
-    BUTTONACT( ui.browseDiscButton, browseDevice() );
-    BUTTON_SET_ACT_I( ui.ejectButton, "", toolbar/eject, qtr( "Eject the disc" ),
-            eject() );
-
-    CONNECT( ui.deviceCombo, editTextChanged( QString ), this, updateMRL());
-    CONNECT( ui.deviceCombo, currentIndexChanged( QString ), this, updateMRL());
-    CONNECT( ui.titleSpin, valueChanged( int ), this, updateMRL());
-    CONNECT( ui.chapterSpin, valueChanged( int ), this, updateMRL());
-    CONNECT( ui.audioSpin, valueChanged( int ), this, updateMRL());
-    CONNECT( ui.subtitlesSpin, valueChanged( int ), this, updateMRL());
 
-    /* Run once the updateButtons function in order to fill correctly the comboBoxes */
-    updateButtons();
 }
 
 DiscOpenPanel::~DiscOpenPanel()
@@ -436,6 +442,19 @@ void DiscOpenPanel::updateButtons()
         ui.diskOptionBox_2->show();
         ui.dvdsimple->setEnabled( true );
     }
+    if ( ui.bdRadioButton->isChecked() )
+    {
+        if( m_discType != BRD )
+        {
+            setDrive( psz_dvddiscpath );
+            m_discType = BRD;
+        }
+        ui.titleLabel->setText( qtr("Title") );
+        ui.chapterLabel->hide();
+        ui.chapterSpin->hide();
+        ui.diskOptionBox_2->hide();
+        ui.dvdsimple->setEnabled( true );
+    }
     else if ( ui.vcdRadioButton->isChecked() )
     {
         if( m_discType != Vcd )
@@ -500,14 +519,15 @@ void DiscOpenPanel::updateMRL()
                 mrl+= QString(":%1").arg( ui.chapterSpin->value() );
             }
         }
+    } else if ( ui.bdRadioButton->isChecked() ) {
+        mrl = "bluray://" LOCALHOST + discPath;
 
     /* VCD */
     } else if ( ui.vcdRadioButton->isChecked() ) {
         mrl = "vcd://" LOCALHOST + discPath;
 
-        if( ui.titleSpin->value() > 0 ) {
-            mrl += QString("@E%1").arg( ui.titleSpin->value() );
-        }
+        if( ui.titleSpin->value() > 0 )
+            mrl += QString("@%1").arg( ui.titleSpin->value() );
 
     /* CDDA */
     } else {
@@ -571,7 +591,7 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     if( var_InheritBool( p_intf, "qt-recentplay" ) )
     {
         b_recentList = true;
-        ui.urlComboBox->addItems( getSettings()->value( "Open/netMRL" ).toStringList() );
+        ui.urlComboBox->addItems( getSettings()->value( "OpenDialog/netMRL" ).toStringList() );
         ui.urlComboBox->setMaxCount( 10 );
     }
     else
@@ -592,11 +612,9 @@ NetOpenPanel::~NetOpenPanel()
         mrlList << ui.urlComboBox->itemText( i );
 
     /* Clean the list... */
-#if HAS_QT45
     mrlList.removeDuplicates();
-#endif
     /* ...and save the 8 last entries */
-    getSettings()->setValue( "Open/netMRL", mrlList );
+    getSettings()->setValue( "OpenDialog/netMRL", mrlList );
 }
 
 void NetOpenPanel::clear()
@@ -657,7 +675,6 @@ void CaptureOpenPanel::initialize()
 {
     if( isInitialized ) return;
 
-    msg_Dbg( p_intf, "Initialization of Capture device panel" );
     isInitialized = true;
 
     ui.setupUi( this );
@@ -718,6 +735,7 @@ void CaptureOpenPanel::initialize()
     CuMRL( vdevDshowW->combo, currentIndexChanged ( int ) );
     CuMRL( adevDshowW->combo, currentIndexChanged ( int ) );
     CuMRL( dshowVSizeLine, textChanged( const QString& ) );
+    configList << "dshow-vdev" << "dshow-adev" << "dshow-size";
     }
 #else /* WIN32 */
     /*******
@@ -730,12 +748,7 @@ void CaptureOpenPanel::initialize()
         "video*"
     };
 
-    char const * const ppsz_v4ladevices[] = {
-        "dsp*",
-        "radio*"
-    };
-
-    /* V4l Main panel */
+    /* V4L2 main panel */
     QLabel *v4l2VideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
     v4l2DevLayout->addWidget( v4l2VideoDeviceLabel, 0, 0 );
 
@@ -750,7 +763,17 @@ void CaptureOpenPanel::initialize()
 
     v4l2AudioDevice = new QComboBox( this );
     v4l2AudioDevice->setEditable( true );
-    POPULATE_WITH_DEVS( ppsz_v4ladevices, v4l2AudioDevice );
+    {
+        QStringList patterns = QStringList();
+        patterns << QString( "pcmC*D*c" );
+
+        QStringList nodes = QDir( "/dev/snd" ).entryList( patterns,
+                                                          QDir::System );
+        QStringList names = nodes.replaceInStrings( QRegExp("^pcmC"), "hw:" )
+                                 .replaceInStrings( QRegExp("c$"), "" )
+                                 .replaceInStrings( QRegExp("D"), "," );
+        v4l2AudioDevice->addItems( names );
+    }
     v4l2AudioDevice->clearEditText();
     v4l2DevLayout->addWidget( v4l2AudioDevice, 1, 1 );
 
@@ -770,6 +793,7 @@ void CaptureOpenPanel::initialize()
     CuMRL( v4l2AudioDevice->lineEdit(), textChanged( const QString& ) );
     CuMRL( v4l2AudioDevice,  currentIndexChanged ( int ) );
     CuMRL( v4l2StdBox,  currentIndexChanged ( int ) );
+    configList << "v4l2-standard" << "v4l2-dev";
     }
 
     /*******
@@ -814,6 +838,7 @@ void CaptureOpenPanel::initialize()
     CuMRL( jackPace, stateChanged( int ) );
     CuMRL( jackConnect, stateChanged( int ) );
     CuMRL( jackPortsSelected, textChanged( const QString& ) );
+    configList << "jack-input-use-vlc-pace" << "jack-input-auto-connect";
     }
 
     /************
@@ -870,6 +895,8 @@ void CaptureOpenPanel::initialize()
     CuMRL( pvrFreq, valueChanged ( int ) );
     CuMRL( pvrBitr, valueChanged ( int ) );
     CuMRL( pvrNormBox, currentIndexChanged ( int ) );
+    configList << "pvr-device" << "pvr-radio-device" << "pvr-norm"
+               << "pvr-frequency" << "pvr-bitrate";
     }
 #endif
     /*************
@@ -988,6 +1015,8 @@ void CaptureOpenPanel::initialize()
     BUTTONACT( dvbs2, updateMRL() );
     BUTTONACT( atsc, updateMRL() );
     BUTTONACT( cqam, updateMRL() );
+    configList << "dvb-adapter" << "dvb-frequency" << "dvb-modulation"
+               << "dvb-bandwidth";
     }
 
     /**********
@@ -1230,9 +1259,15 @@ void CaptureOpenPanel::advancedDialog()
     for( int n = 0; n < (int)i_confsize; n++ )
     {
         module_config_t *p_item = p_config + n;
+        QString name = p_item->psz_name;
+
+        if( name.isEmpty() || configList.contains( name ) )
+            continue;
+
+        msg_Err( p_intf, "%s", p_item->psz_name);
         ConfigControl *config = ConfigControl::createControl(
                         VLC_OBJECT( p_intf ), p_item, advFrame, gLayout, n );
-        if ( config )
+        if( config )
             controls.append( config );
     }
 
@@ -1284,7 +1319,6 @@ void CaptureOpenPanel::advancedDialog()
         }
         advMRL = tempMRL;
         updateMRL();
-        msg_Dbg( p_intf, "%s", qtu( advMRL ) );
     }
     qDeleteAll( controls );
     delete adv;