X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fdialogs_provider.hpp;h=4327fcda77e104d2a42132be1061b14756d177cc;hb=09fc199d67ba98f7138dcaf7f0e02c56e9accfb7;hp=a71ed4915893cddff44736f43663ef29a321ad8b;hpb=97be5f6138a267ec66915a18450470ccc52229d5;p=vlc diff --git a/modules/gui/qt4/dialogs_provider.hpp b/modules/gui/qt4/dialogs_provider.hpp index a71ed49158..4327fcda77 100644 --- a/modules/gui/qt4/dialogs_provider.hpp +++ b/modules/gui/qt4/dialogs_provider.hpp @@ -1,10 +1,11 @@ /***************************************************************************** * dialogs_provider.hpp : Dialogs provider **************************************************************************** - * Copyright (C) 2006 the VideoLAN team + * Copyright (C) 2006-2008 the VideoLAN team * $Id$ * * Authors: Clément Stenac + * Jean-Baptiste Kempf * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,28 +19,53 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ + * 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 "qt4.hpp" + +#include "dialogs/open.hpp" #include -#include -#include +#include -#include "dialogs/interaction.hpp" +#define TITLE_EXTENSIONS_MEDIA qtr( "Media Files" ) +#define TITLE_EXTENSIONS_VIDEO qtr( "Video Files" ) +#define TITLE_EXTENSIONS_AUDIO qtr( "Audio Files" ) +#define TITLE_EXTENSIONS_PLAYLIST qtr( "Playlist Files" ) +#define TITLE_EXTENSIONS_SUBTITLE qtr( "Subtitle Files" ) +#define TITLE_EXTENSIONS_ALL qtr( "All Files" ) +#define EXTENSIONS_ALL "*" +#define ADD_EXT_FILTER( string, type ) \ + string = string + QString("%1 ( %2 );;") \ + .arg( TITLE_##type ) \ + .arg( QString( type ) ); -#include -#include -#include +enum { + EXT_FILTER_MEDIA = 0x01, + EXT_FILTER_VIDEO = 0x02, + EXT_FILTER_AUDIO = 0x04, + EXT_FILTER_PLAYLIST = 0x08, + EXT_FILTER_SUBTITLE = 0x10, +}; class QEvent; class QSignalMapper; -class QVLCMenu; +class VLCMenuBar; class DialogsProvider : public QObject { - Q_OBJECT; + Q_OBJECT + friend class VLCMenuBar; + public: static DialogsProvider *getInstance() { @@ -54,59 +80,121 @@ public: } static void killInstance() { - if( instance ) delete instance; - instance=NULL; + delete instance; + instance = NULL; } - virtual ~DialogsProvider(); - QTimer *fixed_timer; - QStringList showSimpleOpen( QString help = QString(), bool all = true, - bool video = true, bool audio = true, - bool subs = true, bool pls = true ); + QStringList showSimpleOpen( const QString& help = QString(), + int filters = EXT_FILTER_MEDIA | + EXT_FILTER_VIDEO | EXT_FILTER_AUDIO | + EXT_FILTER_PLAYLIST, + const QString& path = QString() ); + bool isDying() { return b_isDying; } + static QString getDirectoryDialog( intf_thread_t *p_intf); + 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; + + QMenu* popupMenu; + QMenu* videoPopupMenu; + QMenu* audioPopupMenu; + QMenu* miscPopupMenu; + + QWidget* root; + bool b_isDying; + + void openDialog( int ); void addFromSimple( bool, bool ); + void saveAPlaylist(playlist_t *p_playlist, playlist_item_t *p_node); public slots: void playlistDialog(); void bookmarksDialog(); void mediaInfoDialog(); + void mediaCodecDialog(); void prefsDialog(); void extendedDialog(); + void synchroDialog(); void messagesDialog(); - void simplePLAppendDialog(); - void simpleMLAppendDialog(); + void sendKey( int key ); +#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 setPopupMenu(); + void destroyPopupMenu(); + + void openFileGenericDialog( intf_dialog_args_t * ); + void simpleOpenDialog(); + void openDialog(); - void openDialog(int ); + void openDiscDialog(); void openFileDialog(); + void openUrlDialog(); void openNetDialog(); void openCaptureDialog(); - void openDiscDialog(); - void PLAppendDialog(); - void MLAppendDialog(); - void popupMenu( int ); - void doInteraction( intf_dialog_args_t * ); - void menuAction( QObject *); - void menuUpdateAction( QObject *); - void SDMenuAction( QString ); - void streamingDialog(); - void openPlaylist(); - void savePlaylist(); + + void PLAppendDialog( int tab = OPEN_FILE_TAB ); + void MLAppendDialog( int tab = OPEN_FILE_TAB ); + + void PLOpenDir(); void PLAppendDir(); - void MLAppendDir(); + + void streamingDialog( QWidget *parent, const QString& mrl, bool b_stream = true, + QStringList options = QStringList("") ); + void openAndStreamingDialogs(); + void openAndTranscodingDialogs(); + + void openAPlaylist(); + void savePlayingToPlaylist(); + void saveRecentsToPlaylist(); + + void loadSubtitlesFile(); + void quit(); - void switchToSkins(); - void helpDialog(); - void aboutDialog(); +private slots: + void menuAction( QObject *); + void menuUpdateAction( QObject * ); + void SDMenuAction( const QString& ); +signals: + void toolBarConfUpdated(); }; +class DialogEvent : public QEvent +{ +public: + static const QEvent::Type DialogEvent_Type; + DialogEvent( int _i_dialog, int _i_arg, intf_dialog_args_t *_p_arg ) : + QEvent( DialogEvent_Type ) + { + i_dialog = _i_dialog; + i_arg = _i_arg; + p_arg = _p_arg; + } + + int i_arg, i_dialog; + intf_dialog_args_t *p_arg; +}; + + #endif