]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs_provider.hpp
Qt: map Print and Pause keys
[vlc] / modules / gui / qt4 / dialogs_provider.hpp
index d65de886306d775d0cb5543fc7e8090e758e993a..00bd37ce780e2877b4213c7a67a6f64001d6e62c 100644 (file)
 #include <QObject>
 #include <QStringList>
 
-#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;        \
-    string += ");;";
-#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;     \
-    string += ");;";
-#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 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 ) );
 
 enum {
     EXT_FILTER_MEDIA     =  0x01,
@@ -74,21 +57,14 @@ enum {
     EXT_FILTER_SUBTITLE  =  0x10,
 };
 
-enum {
-    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;
 class QSignalMapper;
-class QVLCMenu;
+class VLCMenuBar;
 
 class DialogsProvider : public QObject
 {
-    Q_OBJECT;
-    friend class QVLCMenu;
+    Q_OBJECT
+    friend class VLCMenuBar;
 
 public:
     static DialogsProvider *getInstance()
@@ -112,11 +88,11 @@ public:
         return ( instance != NULL );
     }
 
-    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:
     QSignalMapper *menusMapper;
@@ -130,10 +106,12 @@ private:
     static DialogsProvider *instance;
 
     intf_thread_t *p_intf;
+    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 playMRL( const QString & );
@@ -158,12 +136,11 @@ public slots:
     void podcastConfigureDialog();
     void toolbarDialog();
     void pluginDialog();
+    void epgDialog();
 
     void openFileGenericDialog( intf_dialog_args_t * );
 
     void simpleOpenDialog();
-    void simplePLAppendDialog();
-    void simpleMLAppendDialog();
 
     void openDialog();
     void openDiscDialog();
@@ -172,20 +149,21 @@ public slots:
     void openNetDialog();
     void openCaptureDialog();
 
+    QString getDirectoryDialog();
     void PLAppendDialog( int tab = OPEN_FILE_TAB );
     void MLAppendDialog( int tab = OPEN_FILE_TAB );
 
     void PLOpenDir();
     void PLAppendDir();
-    void MLAppendDir();
 
-    void streamingDialog( QWidget *parent, QString mrl, bool b_stream = true,
+    void streamingDialog( QWidget *parent, const QString& mrl, bool b_stream = true,
                           QStringList options = QStringList("") );
     void openAndStreamingDialogs();
     void openAndTranscodingDialogs();
 
     void openAPlaylist();
-    void saveAPlaylist();
+    void savePlayingToPlaylist();
+    void saveRecentsToPlaylist();
 
     void loadSubtitlesFile();
 
@@ -193,7 +171,7 @@ public slots:
 private slots:
     void menuAction( QObject *);
     void menuUpdateAction( QObject * );
-    void SDMenuAction( QString );
+    void SDMenuAction( const QString& );
 signals:
     void  toolBarConfUpdated();
 };
@@ -201,14 +179,14 @@ signals:
 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( (QEvent::Type)(DialogEvent_Type) )
+                 QEvent( 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;