Qt: add a right-click action to save the playlist
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 8 Jan 2014 13:37:39 +0000 (14:37 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 8 Jan 2014 13:37:39 +0000 (14:37 +0100)
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/vlc_model.hpp

index 92530ad..8deaa98 100644 (file)
@@ -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;
     }
index 9642722..faac01b 100644 (file)
@@ -221,6 +221,10 @@ bool StandardPLPanel::popup( const QPoint &point )
     ADD_MENU_ENTRY( QIcon(), qtr(I_PL_ADDPL),
                     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 );
     }
index fb7571d..2c76df8 100644 (file)
@@ -94,7 +94,8 @@ public:
         ACTION_CLEAR,
         ACTION_ENQUEUEFILE,
         ACTION_ENQUEUEDIR,
-        ACTION_ENQUEUEGENERIC
+        ACTION_ENQUEUEGENERIC,
+        ACTION_SAVETOPLAYLIST
     };
     struct actionsContainerType
     {