X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fdialogs_provider.hpp;h=279f83bdcdebd0db7282ec79f0eaa86c40a7e204;hb=17f0388b7e0d5bd26b2a159ccf6356ee9b1f288a;hp=be195ce8d5f696dfd0b9510583d5f6be94fac3b8;hpb=b83bd217a9bdb163c50bb60aec1007113e5f11a1;p=vlc diff --git a/modules/gui/qt4/dialogs_provider.hpp b/modules/gui/qt4/dialogs_provider.hpp index be195ce8d5..279f83bdcd 100644 --- a/modules/gui/qt4/dialogs_provider.hpp +++ b/modules/gui/qt4/dialogs_provider.hpp @@ -1,7 +1,7 @@ /***************************************************************************** * dialogs_provider.hpp : Dialogs provider **************************************************************************** - * Copyright (C) 2006-2007 the VideoLAN team + * Copyright (C) 2006-2008 the VideoLAN team * $Id$ * * Authors: Clément Stenac @@ -22,67 +22,63 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#ifndef _DIALOGS_PROVIDER_H_ -#define _DIALOGS_PROVIDER_H_ +#ifndef QVLC_DIALOGS_PROVIDER_H_ +#define QVLC_DIALOGS_PROVIDER_H_ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include -#include -#include -#include "dialogs/interaction.hpp" +#include "qt4.hpp" +#include "dialogs/open.hpp" #include -#include -#include +#include -#define ADD_FILTER_MEDIA( string ) \ - string += qtr("Media Files"); \ - string += " ( "; \ - string += EXTENSIONS_MEDIA; \ +#define ADD_FILTER_MEDIA( string ) \ + string += qtr( "Media Files" ); \ + string += " ( "; \ + string += EXTENSIONS_MEDIA; \ string += ");;"; -#define ADD_FILTER_VIDEO( string ) \ - string += qtr("Video Files"); \ - string += " ( "; \ - string += EXTENSIONS_VIDEO; \ +#define ADD_FILTER_VIDEO( string ) \ + string += qtr( "Video Files" ); \ + string += " ( "; \ + string += EXTENSIONS_VIDEO; \ string += ");;"; -#define ADD_FILTER_AUDIO( string ) \ - string += qtr("Audio Files"); \ - string += " ( "; \ - string += EXTENSIONS_AUDIO; \ +#define ADD_FILTER_AUDIO( string ) \ + string += qtr( "Audio Files" ); \ + string += " ( "; \ + string += EXTENSIONS_AUDIO; \ string += ");;"; -#define ADD_FILTER_PLAYLIST( string )\ - string += qtr("Playlist Files"); \ - string += " ( "; \ - string += EXTENSIONS_PLAYLIST; \ +#define ADD_FILTER_PLAYLIST( string ) \ + string += qtr( "Playlist Files" ); \ + string += " ( "; \ + string += EXTENSIONS_PLAYLIST; \ string += ");;"; -#define ADD_FILTER_SUBTITLE( string )\ - string += qtr("Subtitles Files"); \ - string += " ( "; \ - string += EXTENSIONS_SUBTITLE; \ +#define ADD_FILTER_SUBTITLE( string ) \ + string += qtr( "Subtitles Files" );\ + string += " ( "; \ + string += EXTENSIONS_SUBTITLE; \ string += ");;"; -#define ADD_FILTER_ALL( string ) \ - string += qtr("All Files"); \ - string += " (*.*)"; - -#define EXT_FILTER_MEDIA 0x01 -#define EXT_FILTER_VIDEO 0x02 -#define EXT_FILTER_AUDIO 0x04 -#define EXT_FILTER_PLAYLIST 0x08 -#define EXT_FILTER_SUBTITLE 0x10 +#define ADD_FILTER_ALL( string ) \ + string += qtr( "All Files" ); \ + string += " (*)"; enum { - OPEN_FILE_TAB, - OPEN_DISC_TAB, - OPEN_NETWORK_TAB, - OPEN_CAPTURE_TAB, - OPEN_TAB_MAX + EXT_FILTER_MEDIA = 0x01, + EXT_FILTER_VIDEO = 0x02, + EXT_FILTER_AUDIO = 0x04, + EXT_FILTER_PLAYLIST = 0x08, + EXT_FILTER_SUBTITLE = 0x10, }; enum { - OPEN_AND_PLAY, - OPEN_AND_STREAM, - OPEN_AND_SAVE, - OPEN_AND_ENQUEUE + DialogEvent_Type = QEvent::User + DialogEventType + 1, + //PLUndockEvent_Type = QEvent::User + DialogEventType + 2; + //PLDockEvent_Type = QEvent::User + DialogEventType + 3; + SetVideoOnTopEvent_Type = QEvent::User + DialogEventType + 4, }; class QEvent; @@ -91,7 +87,9 @@ class QVLCMenu; class DialogsProvider : public QObject { - Q_OBJECT; + Q_OBJECT + friend class QVLCMenu; + public: static DialogsProvider *getInstance() { @@ -106,34 +104,40 @@ public: } static void killInstance() { - if( instance ) delete instance; - instance=NULL; + delete instance; + instance = NULL; + } + static bool isAlive() + { + return ( instance != NULL ); } - virtual ~DialogsProvider(); - QTimer *fixed_timer; - QStringList showSimpleOpen( QString help = QString(), + QStringList showSimpleOpen( const QString& help = QString(), int filters = EXT_FILTER_MEDIA | EXT_FILTER_VIDEO | EXT_FILTER_AUDIO | EXT_FILTER_PLAYLIST, - QString path = QString() ); + const QString& path = QString() ); + bool isDying() { return b_isDying; } protected: - friend class QVLCMenu; QSignalMapper *menusMapper; QSignalMapper *menusUpdateMapper; QSignalMapper *SDMapper; void customEvent( QEvent *); + private: DialogsProvider( intf_thread_t *); - intf_thread_t *p_intf; + virtual ~DialogsProvider(); static DialogsProvider *instance; + + intf_thread_t *p_intf; + QWidget* root; + bool b_isDying; + + void openDialog( int ); void addFromSimple( bool, bool ); public slots: - void doInteraction( intf_dialog_args_t * ); - void menuAction( QObject *); - void menuUpdateAction( QObject *); - void SDMenuAction( QString ); + void playMRL( const QString & ); void playlistDialog(); void bookmarksDialog(); @@ -141,40 +145,76 @@ public slots: void mediaCodecDialog(); void prefsDialog(); void extendedDialog(); + void synchroDialog(); void messagesDialog(); +#ifdef ENABLE_VLM void vlmDialog(); +#endif void helpDialog(); +#ifdef UPDATE_CHECK void updateDialog(); +#endif void aboutDialog(); void gotoTimeDialog(); + void podcastConfigureDialog(); + void toolbarDialog(); + void pluginDialog(); + void epgDialog(); + + void openFileGenericDialog( intf_dialog_args_t * ); void simpleOpenDialog(); void simplePLAppendDialog(); void simpleMLAppendDialog(); void openDialog(); - void openDialog( int ); void openDiscDialog(); void openFileDialog(); + void openUrlDialog(); void openNetDialog(); void openCaptureDialog(); - void PLAppendDialog(); - void MLAppendDialog(); + void PLAppendDialog( int tab = OPEN_FILE_TAB ); + void MLAppendDialog( int tab = OPEN_FILE_TAB ); + + void PLOpenDir(); void PLAppendDir(); void MLAppendDir(); - void streamingDialog( QString mrl = "", bool b_stream = true ); - void openThenStreamingDialogs(); - void openThenTranscodingDialogs(); + void streamingDialog( QWidget *parent, const QString& mrl, bool b_stream = true, + QStringList options = QStringList("") ); + void openAndStreamingDialogs(); + void openAndTranscodingDialogs(); - void openPlaylist(); - void savePlaylist(); + void openAPlaylist(); + void saveAPlaylist(); - void podcastConfigureDialog(); + void loadSubtitlesFile(); - void switchToSkins(); void quit(); +private slots: + void menuAction( QObject *); + void menuUpdateAction( QObject * ); + void SDMenuAction( const QString& ); +signals: + void toolBarConfUpdated(); }; +class DialogEvent : public QEvent +{ +public: + DialogEvent( int _i_dialog, int _i_arg, intf_dialog_args_t *_p_arg ) : + QEvent( (QEvent::Type)(DialogEvent_Type) ) + { + i_dialog = _i_dialog; + i_arg = _i_arg; + p_arg = _p_arg; + } + virtual ~DialogEvent() { } + + int i_arg, i_dialog; + intf_dialog_args_t *p_arg; +}; + + #endif