Commit 2927b624 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* added a button to create an empty node at the top level of the playlist....

* added a button to create an empty node at the top level of the playlist. Thanks to zorglub for a hint once again :) (closes #449)
parent 78d20969
......@@ -266,6 +266,7 @@
},
{
ACTIONS = {
addNode = id;
deleteItem = id;
handlePopUp = id;
playItem = id;
......@@ -280,9 +281,11 @@
CLASS = VLCPlaylist;
LANGUAGE = ObjC;
OUTLETS = {
"o_btn_addNode" = id;
"o_controller" = id;
"o_ctx_menu" = id;
"o_loop_popup" = id;
"o_mi_addNode" = id;
"o_mi_delete" = id;
"o_mi_info" = id;
"o_mi_play" = id;
......
......@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>134 289 496 270 0 0 1024 746 </string>
<string>520 277 496 270 0 0 1440 878 </string>
<key>IBEditorPositions</key>
<dict>
<key>1617</key>
......@@ -11,20 +11,21 @@
<key>2197</key>
<string>422 532 596 143 0 0 1440 878 </string>
<key>29</key>
<string>294 89 438 44 0 0 1024 746 </string>
<string>393 311 438 44 0 0 1440 878 </string>
<key>915</key>
<string>678 573 187 249 0 0 1280 1002 </string>
</dict>
<key>IBFramework Version</key>
<string>439.0</string>
<string>443.0</string>
<key>IBLockedObjects</key>
<array/>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>21</integer>
<integer>2197</integer>
</array>
<key>IBSystem Version</key>
<string>8F46</string>
<string>8G32</string>
</dict>
</plist>
......@@ -105,6 +105,10 @@
BOOL b_selected_item_met;
BOOL b_isSortDescending;
id o_tc_sortColumn;
/* "add node" button and menu entry */
IBOutlet id o_mi_addNode;
IBOutlet id o_btn_addNode;
}
- (void)searchfieldChanged:(NSNotification *)o_notification;
......@@ -128,6 +132,8 @@
- (IBAction)sortNodeByAuthor:(id)sender;
- (IBAction)recursiveExpandNode:(id)sender;
- (IBAction)addNode:(id)sender;
- (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue;
- (void)appendNodeArray:(NSArray*)o_array inNode:(playlist_item_t *)p_node atPos:(int)i_position inView:(int)i_view enqueue:(BOOL)b_enqueue;
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment