#include <QStackedLayout>
#include <QListView>
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
/**************************************************************************
* Open Files and subtitles *
**************************************************************************/
/* Ugly hacks to get the good Widget */
//This lineEdit is the normal line in the fileDialog.
+#if QT_VERSION >= 0x040300
+ lineFileEdit = findChildren<QLineEdit*>()[2];
+#else
lineFileEdit = findChildren<QLineEdit*>()[3];
+#endif
lineFileEdit->hide();
/* Make a list of QLabel inside the QFileDialog to access the good ones */
#define CuMRL( widget, slot ) CONNECT( widget , slot , this, updateMRL() );
-#define setMaxBound( spinbox ) spinbox->setRange ( 0, INT_MAX );
-
/*******
* V4L *
*******/
v4lFreq = new QSpinBox;
v4lFreq->setAlignment( Qt::AlignRight );
v4lFreq->setSuffix(" kHz");
+ setSpinBoxFreq( v4lFreq );
v4lPropLayout->addWidget( v4lFreq, 1 , 1 );
/* v4l CONNECTs */
pvrFreq = new QSpinBox;
pvrFreq->setAlignment( Qt::AlignRight );
pvrFreq->setSuffix(" kHz");
- setMaxBound( pvrFreq );
+ setSpinBoxFreq( pvrFreq );
pvrPropLayout->addWidget( pvrFreq, 1, 1 );
QLabel *pvrBitrLabel = new QLabel( qtr( "Bitrate" ) );
pvrBitr = new QSpinBox;
pvrBitr->setAlignment( Qt::AlignRight );
pvrBitr->setSuffix(" kHz");
- setMaxBound( pvrBitr );
+ setSpinBoxFreq( pvrBitr );
pvrPropLayout->addWidget( pvrBitr, 2, 1 );
/* PVR CONNECTs */
bdaFreq->setAlignment( Qt::AlignRight );
bdaFreq->setSuffix(" kHz");
bdaFreq->setSingleStep( 1000 );
- setMaxBound( bdaFreq )
+ setSpinBoxFreq( bdaFreq )
bdaPropLayout->addWidget( bdaFreq, 0, 1 );
bdaSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) );
bdaSrate = new QSpinBox;
bdaSrate->setAlignment( Qt::AlignRight );
bdaSrate->setSuffix(" kHz");
- setMaxBound( bdaSrate );
+ setSpinBoxFreq( bdaSrate );
bdaPropLayout->addWidget( bdaSrate, 1, 1 );
bdaBandLabel = new QLabel( qtr( "Bandwidth" ) );
dvbFreq = new QSpinBox;
dvbFreq->setAlignment( Qt::AlignRight );
dvbFreq->setSuffix(" kHz");
- setMaxBound( dvbFreq );
+ setSpinBoxFreq( dvbFreq );
dvbPropLayout->addWidget( dvbFreq, 0, 1 );
QLabel *dvbSrateLabel = new QLabel( qtr( "Transponder symbol rate" ) );
dvbSrate = new QSpinBox;
dvbSrate->setAlignment( Qt::AlignRight );
dvbSrate->setSuffix(" kHz");
- setMaxBound( dvbSrate );
+ setSpinBoxFreq( dvbSrate );
dvbPropLayout->addWidget( dvbSrate, 1, 1 );
/* DVB CONNECTs */
BUTTONACT( dvbt, updateButtons() );
BUTTONACT( dvbc, updateButtons() );
+ /**********
+ * Screen *
+ **********/
+
+ addModuleAndLayouts( SCREEN_DEVICE, screen, "Desktop" );
+ QLabel *screenLabel = new QLabel( "This option will open your own "
+ "desktop in order to save or stream it.");
+ screenLabel->setWordWrap( true );
+ screenDevLayout->addWidget( screenLabel, 0, 0 );
+
+
/* General connects */
connect( ui.deviceCombo, SIGNAL( activated( int ) ),
stackedDevLayout, SLOT( setCurrentIndex( int ) ) );
connect( ui.deviceCombo, SIGNAL( activated( int ) ),
stackedPropLayout, SLOT( setCurrentIndex( int ) ) );
CONNECT( ui.deviceCombo, activated( int ), this, updateMRL() );
+ CONNECT( ui.deviceCombo, activated( int ), this, updateButtons() );
#undef addModule
}
QString("%1").arg( bdaBandBox->itemData(
bdaBandBox->currentIndex() ).toInt() );
break;
- case DSHOW_DEVICE:
+ case DSHOW_DEVICE:
+ break;
+ case SCREEN_DEVICE:
+ mrl = "screen://";
+ updateButtons();
break;
}
emit mrlUpdated( mrl );
}
+/**
+ * Update the Buttons (show/hide) for the GUI as all device type don't
+ * use the same ui. elements.
+ **/
void CaptureOpenPanel::updateButtons()
{
+ /* Be sure to display the ui Elements in case they were hidden by
+ * some Device Type (like Screen://) */
+ ui.optionsBox->show();
+ ui.advancedButton->show();
+ /* Get the current Device Number */
int i_devicetype = ui.deviceCombo->itemData(
- ui.deviceCombo->currentIndex() ).toInt();
+ ui.deviceCombo->currentIndex() ).toInt();
msg_Dbg( p_intf, "Capture Type: %i", i_devicetype );
switch( i_devicetype )
{
bdaBandLabel->show();
}
break;
+ case SCREEN_DEVICE:
+ ui.optionsBox->hide();
+ ui.advancedButton->hide();
+ break;
}
}