]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/playlist.m
* added a button to create an empty node at the top level of the playlist. Thanks...
[vlc] / modules / gui / macosx / playlist.m
index 4c9e6b9517033a0f1c8ea3f2cf4bb23fd26a6d9c..96e8271a04f07e3fb28b5bb6b68e9dc67aab97f1 100644 (file)
@@ -517,6 +517,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     [[o_loop_popup itemAtIndex:0] setTitle: _NS("Standard Play")];
     [[o_loop_popup itemAtIndex:1] setTitle: _NS("Repeat One")];
     [[o_loop_popup itemAtIndex:2] setTitle: _NS("Repeat All")];
+    [o_mi_addNode setTitle: _NS("Add Folder to Playlist")];
 }
 
 - (void)playlistUpdated
@@ -1494,6 +1495,28 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     vlc_object_release( p_playlist );
 }
 
+- (IBAction)addNode:(id)sender
+{
+    /* simply adds a new node to the end of the playlist */
+    playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
+                                          FIND_ANYWHERE );
+    if( !p_playlist )
+    {
+        msg_Err( VLCIntf, "Uh Oh! Unable to find playlist!" );
+        return;
+    }
+
+    playlist_item_t * p_item = playlist_NodeCreate( p_playlist, VIEW_CATEGORY, 
+        _("Empty Folder"), p_playlist->p_general );
+
+    if(! p_item )
+        msg_Warn( VLCIntf, "node creation failed, fix VLC!" );
+    
+    playlist_ViewUpdate( p_playlist, VIEW_CATEGORY );
+    
+    vlc_object_release( p_playlist );
+}
+
 @end
 
 @implementation VLCPlaylist (NSOutlineViewDataSource)