]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs_provider.hpp
Qt: update mouse wheel simple preferences (refs #5883)
[vlc] / modules / gui / qt4 / dialogs_provider.hpp
index e6c66b3bba841e0a5ad7279270d7cdfb1d538539..4327fcda77e104d2a42132be1061b14756d177cc 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()
@@ -107,10 +83,6 @@ public:
         delete instance;
         instance = NULL;
     }
-    static bool isAlive()
-    {
-        return ( instance != NULL );
-    }
 
     QStringList showSimpleOpen( const QString& help = QString(),
                                 int filters = EXT_FILTER_MEDIA |
@@ -118,6 +90,8 @@ public:
                                 EXT_FILTER_PLAYLIST,
                                 const QString& path = QString() );
     bool isDying() { return b_isDying; }
+    static QString getDirectoryDialog( intf_thread_t *p_intf);
+
 protected:
     QSignalMapper *menusMapper;
     QSignalMapper *menusUpdateMapper;
@@ -130,14 +104,20 @@ private:
     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 playMRL( const QString & );
-
     void playlistDialog();
     void bookmarksDialog();
     void mediaInfoDialog();
@@ -146,6 +126,7 @@ public slots:
     void extendedDialog();
     void synchroDialog();
     void messagesDialog();
+    void sendKey( int key );
 #ifdef ENABLE_VLM
     void vlmDialog();
 #endif
@@ -158,12 +139,13 @@ public slots:
     void podcastConfigureDialog();
     void toolbarDialog();
     void pluginDialog();
+    void epgDialog();
+    void setPopupMenu();
+    void destroyPopupMenu();
 
     void openFileGenericDialog( intf_dialog_args_t * );
 
     void simpleOpenDialog();
-    void simplePLAppendDialog();
-    void simpleMLAppendDialog();
 
     void openDialog();
     void openDiscDialog();
@@ -177,7 +159,6 @@ public slots:
 
     void PLOpenDir();
     void PLAppendDir();
-    void MLAppendDir();
 
     void streamingDialog( QWidget *parent, const QString& mrl, bool b_stream = true,
                           QStringList options = QStringList("") );
@@ -185,7 +166,8 @@ public slots:
     void openAndTranscodingDialogs();
 
     void openAPlaylist();
-    void saveAPlaylist();
+    void savePlayingToPlaylist();
+    void saveRecentsToPlaylist();
 
     void loadSubtitlesFile();
 
@@ -201,14 +183,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;