X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fmacosx%2Fplaylist.m;h=aa51b209eb07f97f4628c379bd831b644d518239;hb=c7b3731f2776848e6d90e4342854a38101d4faf8;hp=4c9e6b9517033a0f1c8ea3f2cf4bb23fd26a6d9c;hpb=2cb472dba008f7d877ffe6bae9c5575253365282;p=vlc diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m index 4c9e6b9517..aa51b209eb 100644 --- a/modules/gui/macosx/playlist.m +++ b/modules/gui/macosx/playlist.m @@ -463,27 +463,6 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ vlc_list_release( p_list ); vlc_object_release( p_playlist ); - /* Change the simple textfield into a searchField if we can... */ -#if 0 - if( MACOS_VERSION >= 10.3 ) - { - NSView *o_parentview = [o_status_field superview]; - NSSearchField *o_better_search_field = [[NSSearchField alloc]initWithFrame:[o_search_field frame]]; - [o_better_search_field setRecentsAutosaveName:@"VLC media player search"]; - [o_better_search_field setDelegate:self]; - [[NSNotificationCenter defaultCenter] addObserver: self - selector: @selector(searchfieldChanged:) - name: NSControlTextDidChangeNotification - object: o_better_search_field]; - - [o_better_search_field setTarget:self]; - [o_better_search_field setAction:@selector(searchItem:)]; - - [o_better_search_field setAutoresizingMask:NSViewMinXMargin]; - [o_parentview addSubview:o_better_search_field]; - [o_search_field setHidden:YES]; - } -#endif //[self playlistUpdated]; } @@ -501,7 +480,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ [o_mi_delete setTitle: _NS("Delete")]; [o_mi_recursive_expand setTitle: _NS("Expand Node")]; [o_mi_selectall setTitle: _NS("Select All")]; - [o_mi_info setTitle: _NS("Properties")]; + [o_mi_info setTitle: _NS("Information")]; [o_mi_preparse setTitle: _NS("Preparse")]; [o_mi_sort_name setTitle: _NS("Sort Node by Name")]; [o_mi_sort_author setTitle: _NS("Sort Node by Author")]; @@ -517,13 +496,14 @@ 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 { unsigned int i; - /* Clear indications of any existing column sorting*/ + /* Clear indications of any existing column sorting */ for( i = 0 ; i < [[o_outline_view tableColumns] count] ; i++ ) { [o_outline_view setIndicatorImage:nil inTableColumn: @@ -1494,6 +1474,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)