/*****************************************************************************
* open.hpp : Panels for the open dialogs
****************************************************************************
- * Copyright (C) 2006-2007 the VideoLAN team
+ * Copyright (C) 2006-2009 the VideoLAN team
* Copyright (C) 2007 Société des arts technologiques
* Copyright (C) 2007 Savoir-faire Linux
* $Id$
# include "config.h"
#endif
-#include <vlc_common.h>
-
-#include <QFileDialog>
+#include "components/preferences_widgets.hpp"
#include "ui/open_file.h"
#include "ui/open_disk.h"
#include "ui/open_net.h"
#include "ui/open_capture.h"
-#include "components/preferences_widgets.hpp"
+#include <QFileDialog>
#include <limits.h>
#define setSpinBoxFreq( spinbox ){ spinbox->setRange ( 0, INT_MAX ); \
spinbox->setAccelerated( true ); }
-enum
-{
- NO_PROTO,
- HTTP_PROTO,
- HTTPS_PROTO,
- MMS_PROTO,
- FTP_PROTO,
- RTSP_PROTO,
- RTP_PROTO,
- UDP_PROTO,
- RTMP_PROTO
-};
-
-
enum
{
V4L_DEVICE,
JACK_DEVICE
};
-static const char *psz_devModule[] = { "v4l", "v4l2", "pvr", "dvb", "bda",
- "dshow", "screen", "jack" };
-
-
class QWidget;
class QLineEdit;
class QString;
class QStringListModel;
+class QEvent;
class OpenPanel: public QWidget
{
- Q_OBJECT;
+ Q_OBJECT
public:
OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
{
public slots:
virtual void updateMRL() = 0;
signals:
- void mrlUpdated( QString );
- void methodChanged( QString method );
+ void mrlUpdated( const QStringList&, const QString& );
+ void methodChanged( const QString& method );
};
class FileOpenBox: public QFileDialog
{
- Q_OBJECT;
+ Q_OBJECT
public:
FileOpenBox( QWidget *parent, const QString &caption,
- const QString &directory, const QString &filter ):
- QFileDialog( parent, caption, directory, filter ) {}
+ const QString &directory, const QString &filter ):
+ QFileDialog( parent, caption, directory, filter ) {}
public slots:
- void accept();
- void reject();
+ void accept(){}
+ void reject(){}
};
+
class FileOpenPanel: public OpenPanel
{
- Q_OBJECT;
+ Q_OBJECT
public:
FileOpenPanel( QWidget *, intf_thread_t * );
virtual ~FileOpenPanel();
virtual void clear() ;
virtual void accept() ;
+protected:
+ bool eventFilter(QObject *obj, QEvent *event)
+ {
+ if( event->type() == QEvent::Hide ||
+ event->type() == QEvent::HideToParent )
+ {
+ event->accept();
+ return true;
+ }
+ return false;
+ }
+ virtual void dropEvent( QDropEvent *);
+ virtual void dragEnterEvent( QDragEnterEvent * );
+ virtual void dragMoveEvent( QDragMoveEvent * );
+ virtual void dragLeaveEvent( QDragLeaveEvent * );
private:
Ui::OpenFile ui;
- QStringList browse( QString );
FileOpenBox *dialogBox;
- QLineEdit *lineFileEdit;
- QStringList fileCompleteList ;
+ void BuildOldPanel();
public slots:
virtual void updateMRL();
private slots:
void browseFileSub();
- void toggleSubtitleFrame();
+ void browseFile();
+ void removeFile();
+ void updateButtons();
+ void toggleSubtitleFrame( bool );
};
class NetOpenPanel: public OpenPanel
{
- Q_OBJECT;
+ Q_OBJECT
public:
NetOpenPanel( QWidget *, intf_thread_t * );
virtual ~NetOpenPanel();
public slots:
virtual void updateMRL();
private slots:
- void updateProtocol( int );
- void updateCompleter();
+ void updateModel();
+};
+
+class UrlValidator : public QValidator
+{
+ Q_OBJECT
+public:
+ UrlValidator( QObject *parent ) : QValidator( parent ) { }
+ void fixup( QString& ) const;
+ QValidator::State validate( QString&, int& ) const;
};
class DiscOpenPanel: public OpenPanel
{
- Q_OBJECT;
+ Q_OBJECT
+ enum DiscType
+ {
+ None,
+ Dvd,
+ Vcd,
+ Cdda
+ };
public:
DiscOpenPanel( QWidget *, intf_thread_t * );
virtual ~DiscOpenPanel();
private:
Ui::OpenDisk ui;
char *psz_dvddiscpath, *psz_vcddiscpath, *psz_cddadiscpath;
- bool b_firstdvd, b_firstvcd, b_firstcdda;
+ DiscType m_discType;
public slots:
virtual void updateMRL() ;
private slots:
class CaptureOpenPanel: public OpenPanel
{
- Q_OBJECT;
+ Q_OBJECT
public:
CaptureOpenPanel( QWidget *, intf_thread_t * );
virtual ~CaptureOpenPanel();
QString advMRL;
QDialog *adv;
#ifdef WIN32
- QRadioButton *bdas, *bdat, *bdac, *bdaa;
+ QRadioButton *bdas, *bdat, *bdac, *bdaa, *bdaq;
QSpinBox *bdaCard, *bdaFreq, *bdaSrate;
QLabel *bdaSrateLabel, *bdaBandLabel;
QComboBox *bdaBandBox;
QLineEdit *dshowVSizeLine;
#else
QRadioButton *dvbs, *dvbt, *dvbc;
+ QLabel *dvbBandLabel, *dvbSrateLabel;
QSpinBox *v4lFreq, *pvrFreq, *pvrBitr;
QLineEdit *v4lVideoDevice, *v4lAudioDevice;
QLineEdit *v4l2VideoDevice, *v4l2AudioDevice;
QLineEdit *pvrDevice, *pvrRadioDevice;
- QComboBox *v4lNormBox, *v4l2StdBox, *pvrNormBox;
+ QComboBox *v4lNormBox, *v4l2StdBox, *pvrNormBox, *dvbBandBox;
QSpinBox *dvbCard, *dvbFreq, *dvbSrate;
QSpinBox *jackChannels, *jackCaching;
QCheckBox *jackPace, *jackConnect;
QLineEdit *jackPortsSelected;
#endif
- QSpinBox *screenFPS;
+ QDoubleSpinBox *screenFPS;
public slots:
virtual void updateMRL();