]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/open_panels.cpp
Qt: Fix protectedness of customEvent
[vlc] / modules / gui / qt4 / components / open_panels.cpp
index dec064b1829e84cb408f9b077c28bb2e984f1757..6e10465549ab9496528e9d0527bcd380c8a0a98f 100644 (file)
@@ -334,6 +334,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
     ui.browseDiscButton->setToolTip( qtr( I_DEVICE_TOOLTIP ));
     ui.deviceCombo->setToolTip( qtr(I_DEVICE_TOOLTIP) );
+    ui.deviceCombo->setInsertPolicy( QComboBox::InsertAtTop );
 
 #ifdef WIN32 /* Disc drives probing for Windows */
     wchar_t szDrives[512];
@@ -350,7 +351,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
                 GetVolumeInformationW( drive, psz_name, 511, NULL, NULL, NULL, NULL, 0 );
 
                 QString displayName = FromWide( drive );
-                if( !EMPTY_STR(psz_name) ) {
+                if( !*psz_name ) {
                     displayName = displayName + " - "  + FromWide( psz_name );
                 }
 
@@ -384,6 +385,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
             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());
@@ -544,8 +546,12 @@ void DiscOpenPanel::browseDevice()
 {
     QString dir = QFileDialog::getExistingDirectory( this,
             qtr( I_DEVICE_TOOLTIP ) );
-    if (!dir.isEmpty())
-        ui.deviceCombo->setEditText( toNativeSepNoSlash( dir ) );
+    if( !dir.isEmpty() )
+    {
+        ui.deviceCombo->addItem( toNativeSepNoSlash( dir ) );
+        ui.deviceCombo->setCurrentIndex( ui.deviceCombo->findText( toNativeSepNoSlash( dir ) ) );
+        updateMRL();
+    }
 
     updateMRL();
 }
@@ -667,7 +673,7 @@ void UrlValidator::fixup( QString& str ) const
     str = str.trimmed();
 }
 
-QValidator::State UrlValidator::validate( QString& str, int& pos ) const
+QValidator::State UrlValidator::validate( QString& str, int& ) const
 {
     if( str.contains( ' ' ) )
         return QValidator::Invalid;
@@ -729,12 +735,12 @@ void CaptureOpenPanel::initialize()
     module_config_t *p_config =
         config_FindConfig( VLC_OBJECT(p_intf), "dshow-vdev" );
     vdevDshowW = new StringListConfigControl(
-        VLC_OBJECT(p_intf), p_config, this, false, dshowDevLayout, line );
+        VLC_OBJECT(p_intf), p_config, this, dshowDevLayout, line );
     line++;
 
     p_config = config_FindConfig( VLC_OBJECT(p_intf), "dshow-adev" );
     adevDshowW = new StringListConfigControl(
-        VLC_OBJECT(p_intf), p_config, this, false, dshowDevLayout, line );
+        VLC_OBJECT(p_intf), p_config, this, dshowDevLayout, line );
     line++;
 
     /* dshow Properties */
@@ -929,14 +935,9 @@ void CaptureOpenPanel::initialize()
     dvbCard->setAlignment( Qt::AlignRight );
 #ifdef __linux__
     dvbCard->setPrefix( "/dev/dvb/adapter" );
-    dvbFE = new QSpinBox;
-    dvbFE->setPrefix( "/frontend" );
 #endif
     dvbDevLayout->addWidget( dvbDeviceLabel, 0, 0 );
     dvbDevLayout->addWidget( dvbCard, 0, 1, 1, 2 );
-#ifdef __linux__
-    dvbDevLayout->addWidget( dvbFE, 0, 3 );
-#endif
 
     dvbc = new QRadioButton( "DVB-C" );
     dvbs = new QRadioButton( "DVB-S" );
@@ -1016,9 +1017,6 @@ void CaptureOpenPanel::initialize()
 
     /* DVB CONNECTs */
     CuMRL( dvbCard, valueChanged ( int ) );
-#ifdef __linux__
-    CuMRL( dvbFE, valueChanged ( int ) );
-#endif
     CuMRL( dvbFreq, valueChanged ( int ) );
     CuMRL( dvbSrate, valueChanged ( int ) );
     CuMRL( dvbQamBox, currentIndexChanged ( int ) );
@@ -1153,7 +1151,7 @@ void CaptureOpenPanel::updateMRL()
         else
         if( cqam->isChecked() ) mrl = "cqam://";
 
-        mrl += "frequency=" + QString::number( dvbFreq->value() );
+        mrl += "frequency=" + QString::number( dvbFreq->value() ) + "000";
 
         if( dvbc->isChecked() || cqam->isChecked() )
             mrl += ":modulation="
@@ -1170,9 +1168,6 @@ void CaptureOpenPanel::updateMRL()
 
         fileList << mrl; mrl= "";
         mrl += " :dvb-adapter=" + QString::number( dvbCard->value() );
-#ifdef __linux__
-        mrl += " :dvb-device=" + QString::number( dvbFE->value() );
-#endif
         break;
     case SCREEN_DEVICE:
         fileList << "screen://";