#include <QDirModel>
#include <QScrollArea>
#include <QUrl>
-#include <QSettings>
+
+#define I_DEVICE_TOOLTIP N_("Select the device or the VIDEO_TS directory")
/**************************************************************************
* Open Files and subtitles *
dialogBox->setFileMode( QFileDialog::ExistingFiles );
dialogBox->setAcceptMode( QFileDialog::AcceptOpen );
#if HAS_QT43
- QSettings settings( "vlc", "vlc-qt-interface" );
dialogBox->restoreState(
- settings.value( "file-dialog-state" ).toByteArray() );
+ getSettings()->value( "file-dialog-state" ).toByteArray() );
#endif
- dialogBox->setViewMode( config_GetInt( p_intf, "qt-open-detail" ) ?
- QFileDialog::Detail : QFileDialog::List );
/* We don't want to see a grip in the middle of the window, do we? */
dialogBox->setSizeGripEnabled( false );
/* Add a tooltip */
dialogBox->setToolTip( qtr( "Select one or multiple files" ) );
+ dialogBox->setMinimumHeight( 250 );
// But hide the two OK/Cancel buttons. Enable them for debug.
QDialogButtonBox *fileDialogAcceptBox =
FileOpenPanel::~FileOpenPanel()
{
#if HAS_QT43
- QSettings settings( "vlc", "vlc-qt-interface" );
- settings.setValue( "file-dialog-state", dialogBox->saveState() );
+ getSettings()->setValue( "file-dialog-state", dialogBox->saveState() );
#endif
}
OpenDialog::getInstance( NULL, NULL, true )->selectSlots();
}
+void FileOpenBox::reject()
+{
+ OpenDialog::getInstance( NULL, NULL, true )->cancel();
+}
+
/* Function called by Open Dialog when clicked on cancel */
void FileOpenPanel::clear()
{
b_firstvcd = true;
b_firstcdda = true;
-#if WIN32 /* Disc drives probing for Windows */
+ ui.browseDiscButton->setToolTip( qtr( I_DEVICE_TOOLTIP ));
+ ui.deviceCombo->setToolTip( I_DEVICE_TOOLTIP );
+
+#ifdef WIN32 /* Disc drives probing for Windows */
char szDrives[512];
szDrives[0] = '\0';
if( GetLogicalDriveStringsA( sizeof( szDrives ) - 1, szDrives ) )
BUTTONACT( ui.audioCDRadioButton, updateButtons() );
BUTTONACT( ui.dvdsimple, updateButtons() );
BUTTONACT( ui.browseDiscButton, browseDevice() );
- BUTTONACT( ui.ejectButton, eject() );
+ BUTTON_SET_ACT_I( ui.ejectButton, "", eject, qtr( "Eject the disc" ),
+ eject() );
CONNECT( ui.deviceCombo, editTextChanged( QString ), this, updateMRL());
CONNECT( ui.titleSpin, valueChanged( int ), this, updateMRL());
DiscOpenPanel::~DiscOpenPanel()
{
- delete psz_dvddiscpath;
- delete psz_vcddiscpath;
- delete psz_cddadiscpath;
+ free( psz_dvddiscpath );
+ free( psz_vcddiscpath );
+ free( psz_cddadiscpath );
}
void DiscOpenPanel::clear()
void DiscOpenPanel::browseDevice()
{
- QString dir = QFileDialog::getExistingDirectory( 0,
- qtr("Open a device or a VIDEO_TS directory") );
- if (!dir.isEmpty()) {
- ui.deviceCombo->setEditText( dir );
- }
+ QString dir = QFileDialog::getExistingDirectory( this,
+ qtr( I_DEVICE_TOOLTIP ) );
+ if (!dir.isEmpty())
+ ui.deviceCombo->setEditText( toNativeSepNoSlash( dir ) );
+
updateMRL();
}
CaptureOpenPanel::CaptureOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
OpenPanel( _parent, _p_intf )
{
+ isInitialized = false;
+}
+
+void CaptureOpenPanel::initialize()
+{
+ if( isInitialized ) return;
+
+ msg_Dbg( p_intf, "Initialization of Capture device panel" );
+ isInitialized = true;
+
ui.setupUi( this );
BUTTONACT( ui.advancedButton, advancedDialog() );
/*********************
* DirectShow Stuffs *
*********************/
- if( module_Exists( p_intf, "dshow" ) ){
+ if( module_exists( "dshow" ) ){
addModuleAndLayouts( DSHOW_DEVICE, dshow, "DirectShow" );
/* dshow Main */
/**************
* BDA Stuffs *
**************/
- if( module_Exists( p_intf, "bda" ) ){
+ if( module_exists( "bda" ) ){
addModuleAndLayouts( BDA_DEVICE, bda, "DVB DirectShow" );
/* bda Main */
/*******
* V4L2*
*******/
- if( module_Exists( p_intf, "v4l2" ) ){
+ if( module_exists( "v4l2" ) ){
addModuleAndLayouts( V4L2_DEVICE, v4l2, "Video for Linux 2" );
/* V4l Main panel */
/*******
* V4L *
*******/
- if( module_Exists( p_intf, "v4l" ) ){
+ if( module_exists( "v4l" ) ){
addModuleAndLayouts( V4L_DEVICE, v4l, "Video for Linux" );
/* V4l Main panel */
/*******
* JACK *
*******/
- if( module_Exists( p_intf, "jack" ) ){
+ if( module_exists( "jack" ) ){
addModuleAndLayouts( JACK_DEVICE, jack, "JACK Audio Connection Kit" );
/* Jack Main panel */
/************
* PVR *
************/
- if( module_Exists( p_intf, "pvr" ) ){
+ if( module_exists( "pvr" ) ){
addModuleAndLayouts( PVR_DEVICE, pvr, "PVR" );
/* PVR Main panel */
/**************
* DVB Stuffs *
**************/
- if( module_Exists( p_intf, "dvb" ) ){
+ if( module_exists( "dvb" ) ){
addModuleAndLayouts( DVB_DEVICE, dvb, "DVB" );
/* DVB Main */
screenLabel->setWordWrap( true );
screenDevLayout->addWidget( screenLabel, 0, 0 );
+ QLabel *screenFPSLabel = new QLabel(
+ qtr( "Desired frame rate for the capture." ) );
+ screenPropLayout->addWidget( screenFPSLabel, 0, 0 );
+
+ screenFPS = new QSpinBox;
+ screenFPS->setValue( 1 );
+ screenFPS->setAlignment( Qt::AlignRight );
+ screenPropLayout->addWidget( screenFPS, 0, 1 );
+
/* General connects */
CONNECT( ui.deviceCombo, activated( int ) ,
stackedDevLayout, setCurrentIndex( int ) );
#endif
case SCREEN_DEVICE:
mrl = "screen://";
+ mrl += " :screen-fps=" + QString("%1").arg( screenFPS->value() );
updateButtons();
break;
}
break;
#endif
case SCREEN_DEVICE:
- ui.optionsBox->hide();
+ //ui.optionsBox->hide();
ui.advancedButton->hide();
break;
}
/* Get the corresponding module */
module_t *p_module =
- module_Find( VLC_OBJECT(p_intf), psz_devModule[i_devicetype] );
+ module_find( psz_devModule[i_devicetype] );
if( NULL == p_module ) return;
/* Init */
/* Get the confsize */
unsigned int i_confsize;
module_config_t *p_config;
- p_config = module_GetConfig( p_module, &i_confsize );
+ p_config = module_config_get( p_module, &i_confsize );
/* New Adv Prop dialog */
adv = new QDialog( this );
/* A main Layout with a Frame */
QVBoxLayout *mainLayout = new QVBoxLayout( adv );
- QFrame *advFrame = new QFrame;
QScrollArea *scroll = new QScrollArea;
mainLayout->addWidget( scroll );
+ QFrame *advFrame = new QFrame;
/* GridLayout inside the Frame */
QGridLayout *gLayout = new QGridLayout( advFrame );
- gLayout->setSizeConstraint( QLayout::SetFixedSize );
- scroll->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
scroll->setWidgetResizable( true );
scroll->setWidget( advFrame );
msg_Dbg( p_intf, "%s", qtu( advMRL ) );
}
delete adv;
+ module_config_free( p_config );
+ module_release (p_module);
}