From: Felix Paul Kühne Date: Thu, 16 Feb 2006 20:05:18 +0000 (+0000) Subject: * added a button to create an empty node at the top level of the playlist. Thanks... X-Git-Tag: 0.9.0-test0~12316 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=2927b6247501a12e5ce08101c4820951429e8639;p=vlc * 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) --- diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib index 5e0e4ca8f7..c32c5aaff1 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib @@ -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; diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib index 4a01efcdae..f42644ee8d 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 134 289 496 270 0 0 1024 746 + 520 277 496 270 0 0 1440 878 IBEditorPositions 1617 @@ -11,20 +11,21 @@ 2197 422 532 596 143 0 0 1440 878 29 - 294 89 438 44 0 0 1024 746 + 393 311 438 44 0 0 1440 878 915 678 573 187 249 0 0 1280 1002 IBFramework Version - 439.0 + 443.0 IBLockedObjects IBOpenObjects 29 21 + 2197 IBSystem Version - 8F46 + 8G32 diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib index a848081ced..8317dac044 100644 Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/modules/gui/macosx/playlist.h b/modules/gui/macosx/playlist.h index 76ecd9323e..565722ca6b 100644 --- a/modules/gui/macosx/playlist.h +++ b/modules/gui/macosx/playlist.h @@ -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; diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m index 4c9e6b9517..96e8271a04 100644 --- a/modules/gui/macosx/playlist.m +++ b/modules/gui/macosx/playlist.m @@ -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)