[vlc-commits] Qt: add a right-click action to save the playlist

Jean-Baptiste Kempf git at videolan.org
Wed Jan 8 14:37:57 CET 2014


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Jan  8 14:37:39 2014 +0100| [85149ef4ac4282ead491747e33eb351cec4fe62d] | committer: Jean-Baptiste Kempf

Qt: add a right-click action to save the playlist

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=85149ef4ac4282ead491747e33eb351cec4fe62d
---

 modules/gui/qt4/components/playlist/playlist_model.cpp |    2 ++
 modules/gui/qt4/components/playlist/standardpanel.cpp  |    7 +++++++
 modules/gui/qt4/components/playlist/vlc_model.hpp      |    3 ++-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 92530ad..8deaa98 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -1099,6 +1099,8 @@ bool PLModel::isSupportedAction( actions action, const QModelIndex &index ) cons
     case ACTION_ENQUEUEDIR:
     case ACTION_ENQUEUEGENERIC:
         return canEdit();
+    case ACTION_SAVETOPLAYLIST:
+        return rowCount() > 0;
     default:
         return false;
     }
diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index 9642722..faac01b 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -222,6 +222,10 @@ bool StandardPLPanel::popup( const QPoint &point )
                     VLCModelSubInterface::ACTION_ADDTOPLAYLIST );
 
     menu.addSeparator();
+    ADD_MENU_ENTRY( QIcon(), qtr( I_PL_SAVE ),
+                    VLCModelSubInterface::ACTION_SAVETOPLAYLIST );
+
+    menu.addSeparator();
 
     /* Item removal */
 
@@ -375,6 +379,9 @@ void StandardPLPanel::popupAction( QAction *action )
                 RecentsMRL::getInstance( p_intf )->addRecent( file );
         break;
 
+    case VLCModelSubInterface::ACTION_SAVETOPLAYLIST:
+        THEDP->savePlayingToPlaylist();
+        break;
     default:
         model->action( action, list );
     }
diff --git a/modules/gui/qt4/components/playlist/vlc_model.hpp b/modules/gui/qt4/components/playlist/vlc_model.hpp
index fb7571d..2c76df8 100644
--- a/modules/gui/qt4/components/playlist/vlc_model.hpp
+++ b/modules/gui/qt4/components/playlist/vlc_model.hpp
@@ -94,7 +94,8 @@ public:
         ACTION_CLEAR,
         ACTION_ENQUEUEFILE,
         ACTION_ENQUEUEDIR,
-        ACTION_ENQUEUEGENERIC
+        ACTION_ENQUEUEGENERIC,
+        ACTION_SAVETOPLAYLIST
     };
     struct actionsContainerType
     {



More information about the vlc-commits mailing list