Commit 19011712 authored by Benjamin Pracht's avatar Benjamin Pracht

* Add an option to recusively expand the current node in the playlist context menue.

* Seems to be some issues sometimes, likely related to the fact we do not empty o_outline_dict on playlist refresh 
parent 9b344d57
...@@ -249,6 +249,7 @@ ...@@ -249,6 +249,7 @@
deleteItem = id; deleteItem = id;
handlePopUp = id; handlePopUp = id;
playItem = id; playItem = id;
recursiveExpandNode = id;
savePlaylist = id; savePlaylist = id;
searchItem = id; searchItem = id;
selectAll = id; selectAll = id;
...@@ -264,6 +265,7 @@ ...@@ -264,6 +265,7 @@
"o_mi_delete" = id; "o_mi_delete" = id;
"o_mi_info" = id; "o_mi_info" = id;
"o_mi_play" = id; "o_mi_play" = id;
"o_mi_recursive_expand" = id;
"o_mi_save_playlist" = id; "o_mi_save_playlist" = id;
"o_mi_selectall" = id; "o_mi_selectall" = id;
"o_mi_services" = id; "o_mi_services" = id;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>91 42 496 270 0 0 800 578 </string> <string>43 309 496 270 0 0 1024 746 </string>
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>1617</key> <key>1617</key>
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<key>2197</key> <key>2197</key>
<string>214 442 596 144 0 0 1024 746 </string> <string>214 442 596 144 0 0 1024 746 </string>
<key>29</key> <key>29</key>
<string>205 505 419 44 0 0 800 578 </string> <string>326 664 419 44 0 0 1024 746 </string>
<key>915</key> <key>915</key>
<string>730 416 178 211 0 0 1024 746 </string> <string>756 516 178 230 0 0 1024 746 </string>
</dict> </dict>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>364.0</string> <string>364.0</string>
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
<array/> <array/>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>29</integer>
<integer>2029</integer>
<integer>21</integer> <integer>21</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
IBOutlet id o_mi_selectall; IBOutlet id o_mi_selectall;
IBOutlet id o_mi_sort_name; IBOutlet id o_mi_sort_name;
IBOutlet id o_mi_sort_author; IBOutlet id o_mi_sort_author;
IBOutlet id o_mi_recursive_expand;
/* "services discovery" menu in the playlist menu */ /* "services discovery" menu in the playlist menu */
IBOutlet id o_mi_services; IBOutlet id o_mi_services;
...@@ -97,6 +98,7 @@ ...@@ -97,6 +98,7 @@
- (IBAction)selectAll:(id)sender; - (IBAction)selectAll:(id)sender;
- (IBAction)sortNodeByName:(id)sender; - (IBAction)sortNodeByName:(id)sender;
- (IBAction)sortNodeByAuthor:(id)sender; - (IBAction)sortNodeByAuthor:(id)sender;
- (IBAction)recursiveExpandNode:(id)sender;
- (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue; - (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; - (void)appendNodeArray:(NSArray*)o_array inNode:(playlist_item_t *)p_node atPos:(int)i_position inView:(int)i_view enqueue:(BOOL)b_enqueue;
......
...@@ -228,6 +228,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -228,6 +228,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
[o_mi_save_playlist setTitle: _NS("Save Playlist...")]; [o_mi_save_playlist setTitle: _NS("Save Playlist...")];
[o_mi_play setTitle: _NS("Play")]; [o_mi_play setTitle: _NS("Play")];
[o_mi_delete setTitle: _NS("Delete")]; [o_mi_delete setTitle: _NS("Delete")];
[o_mi_recursive_expand setTitle: _NS("Expand Node")];
[o_mi_selectall setTitle: _NS("Select All")]; [o_mi_selectall setTitle: _NS("Select All")];
[o_mi_info setTitle: _NS("Properties")]; [o_mi_info setTitle: _NS("Properties")];
[o_mi_sort_name setTitle: _NS("Sort Node by Name")]; [o_mi_sort_name setTitle: _NS("Sort Node by Name")];
...@@ -558,10 +559,9 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -558,10 +559,9 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
numberOfChildrenOfItem: o_item] > 0 ) numberOfChildrenOfItem: o_item] > 0 )
//is a node and not an item //is a node and not an item
{ {
id o_playing_item = [o_outline_dict objectForKey:
[NSString stringWithFormat: @"%p", p_playlist->status.p_item]];
if( p_playlist->status.i_status != PLAYLIST_STOPPED && if( p_playlist->status.i_status != PLAYLIST_STOPPED &&
[self isValueItem: o_playing_item inNode: o_item] == YES ) [self isItem: p_playlist->status.p_item inNode:
((playlist_item_t *)[o_item pointerValue])] == YES )
{ {
// if current item is in selected node and is playing then stop playlist // if current item is in selected node and is playing then stop playlist
playlist_Stop( p_playlist ); playlist_Stop( p_playlist );
...@@ -979,6 +979,32 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -979,6 +979,32 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
- (IBAction)recursiveExpandNode:(id)sender
{
int i;
id o_item = [o_outline_view itemAtRow: [o_outline_view selectedRow]];
playlist_item_t *p_item = (playlist_item_t *)[o_item pointerValue];
if( ![[o_outline_view dataSource] outlineView: o_outline_view
isItemExpandable: o_item] )
{
for( i = 0 ; i < p_item->i_parents ; i++ )
{
if( p_item->pp_parents[i]->i_view == i_current_view )
{
o_item = [o_outline_dict objectForKey: [NSString
stringWithFormat: @"%p", p_item->pp_parents[i]->p_parent]];
break;
}
}
}
/* We need to collapse the node first, since OSX refuses to recursively
expand an already expanded node, even if children nodes are collapsed. */
[o_outline_view collapseItem: o_item collapseChildren: YES];
[o_outline_view expandItem: o_item expandChildren: YES];
}
- (NSMenu *)menuForEvent:(NSEvent *)o_event - (NSMenu *)menuForEvent:(NSEvent *)o_event
{ {
NSPoint pt; NSPoint pt;
...@@ -995,6 +1021,9 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -995,6 +1021,9 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
[o_mi_delete setEnabled: b_item_sel]; [o_mi_delete setEnabled: b_item_sel];
[o_mi_selectall setEnabled: b_rows]; [o_mi_selectall setEnabled: b_rows];
[o_mi_info setEnabled: b_item_sel]; [o_mi_info setEnabled: b_item_sel];
[o_mi_recursive_expand setEnabled: b_item_sel];
[o_mi_sort_name setEnabled: b_item_sel];
[o_mi_sort_author setEnabled: b_item_sel];
return( o_ctx_menu ); return( o_ctx_menu );
} }
......
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