X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fcomponents%2Fopen_panels.hpp;h=bef2c8c6a3ea7259bf138fb5a3a5acd9e0d528ea;hb=2a100fcd186304e600d6d896325855836fa899e6;hp=32bc6acaab771a3031b6e6bbb9c713bdb9be9baf;hpb=84eac14c642a217aa677e83b2f12ffee6d100367;p=vlc diff --git a/modules/gui/qt4/components/open_panels.hpp b/modules/gui/qt4/components/open_panels.hpp index 32bc6acaab..bef2c8c6a3 100644 --- a/modules/gui/qt4/components/open_panels.hpp +++ b/modules/gui/qt4/components/open_panels.hpp @@ -1,7 +1,7 @@ /***************************************************************************** * 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$ @@ -28,18 +28,20 @@ #ifndef _OPENPANELS_H_ #define _OPENPANELS_H_ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif -#include +#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" -#ifdef HAVE_LIMITS_H -# include -#endif +#include + +#include #define setSpinBoxFreq( spinbox ){ spinbox->setRange ( 0, INT_MAX ); \ spinbox->setAccelerated( true ); } @@ -59,10 +61,12 @@ enum 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 ) { @@ -75,60 +79,95 @@ protected: 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 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(); virtual void clear() ; private: Ui::OpenNetwork ui; + QStringListModel *mrlList; public slots: virtual void updateMRL(); private slots: - void updateProtocol( int ); + 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(); @@ -137,43 +176,57 @@ public: 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: void browseDevice(); void updateButtons() ; + void eject(); }; class CaptureOpenPanel: public OpenPanel { - Q_OBJECT; + Q_OBJECT public: CaptureOpenPanel( QWidget *, intf_thread_t * ); virtual ~CaptureOpenPanel(); virtual void clear() ; private: Ui::OpenCapture ui; + bool isInitialized; + + QString advMRL; + QDialog *adv; +#ifdef WIN32 + QRadioButton *bdas, *bdat, *bdac, *bdaa, *bdaq; + QSpinBox *bdaCard, *bdaFreq, *bdaSrate; + QLabel *bdaSrateLabel, *bdaBandLabel; + QComboBox *bdaBandBox; + StringListConfigControl *vdevDshowW, *adevDshowW; + QLineEdit *dshowVSizeLine; +#else QRadioButton *dvbs, *dvbt, *dvbc; - QRadioButton *bdas, *bdat, *bdac; + QLabel *dvbBandLabel, *dvbSrateLabel; QSpinBox *v4lFreq, *pvrFreq, *pvrBitr; QLineEdit *v4lVideoDevice, *v4lAudioDevice; QLineEdit *v4l2VideoDevice, *v4l2AudioDevice; QLineEdit *pvrDevice, *pvrRadioDevice; - QComboBox *v4lNormBox, *v4l2StdBox, *pvrNormBox, *bdaBandBox; + QComboBox *v4lNormBox, *v4l2StdBox, *pvrNormBox, *dvbBandBox; QSpinBox *dvbCard, *dvbFreq, *dvbSrate; - QSpinBox *bdaCard, *bdaFreq, *bdaSrate; QSpinBox *jackChannels, *jackCaching; QCheckBox *jackPace, *jackConnect; QLineEdit *jackPortsSelected; - - QLabel *bdaSrateLabel, *bdaBandLabel; +#endif + QDoubleSpinBox *screenFPS; public slots: virtual void updateMRL(); + void initialize(); private slots: void updateButtons(); + void advancedDialog(); }; #endif