]> git.sesse.net Git - vlc/commitdiff
* Add an option to recusively expand the current node in the playlist context menue.
authorBenjamin Pracht <bigben@videolan.org>
Wed, 29 Jun 2005 16:48:38 +0000 (16:48 +0000)
committerBenjamin Pracht <bigben@videolan.org>
Wed, 29 Jun 2005 16:48:38 +0000 (16:48 +0000)
* Seems to be some issues sometimes, likely related to the fact we do not empty o_outline_dict on playlist refresh

extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.m

index 7306954a958c9ea41439c7de41a1de78e0b1f306..a8f21710739f7c67f3e27bfa94b4a015d4882704 100644 (file)
                 deleteItem = id; 
                 handlePopUp = id; 
                 playItem = id; 
+                recursiveExpandNode = id; 
                 savePlaylist = id; 
                 searchItem = id; 
                 selectAll = id; 
                 "o_mi_delete" = id; 
                 "o_mi_info" = id; 
                 "o_mi_play" = id; 
+                "o_mi_recursive_expand" = id; 
                 "o_mi_save_playlist" = id; 
                 "o_mi_selectall" = id; 
                 "o_mi_services" = id; 
index 243de85a48aec574ef25b515d9cffeadd206cc94..4d7f9a1da5301abb57f13c16b03a3e6fa451bfb9 100644 (file)
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
        <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>
        <dict>
                <key>1617</key>
@@ -11,9 +11,9 @@
                <key>2197</key>
                <string>214 442 596 144 0 0 1024 746 </string>
                <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>
-               <string>730 416 178 211 0 0 1024 746 </string>
+               <string>756 516 178 230 0 0 1024 746 </string>
        </dict>
        <key>IBFramework Version</key>
        <string>364.0</string>
@@ -21,8 +21,6 @@
        <array/>
        <key>IBOpenObjects</key>
        <array>
-               <integer>29</integer>
-               <integer>2029</integer>
                <integer>21</integer>
        </array>
        <key>IBSystem Version</key>
index a1545d968e4e2c6851f5bc8f2937c31ec1614148..aef66c8c39dd4059e836fb1146f14caa76595706 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ
index 28ecdc7713d10f0a050443e8ec81f6a06654255e..05bd72fbc5893c3e7a81878e0fd513f93a77d4ee 100644 (file)
@@ -57,6 +57,7 @@
     IBOutlet id o_mi_selectall;
     IBOutlet id o_mi_sort_name;
     IBOutlet id o_mi_sort_author;
+    IBOutlet id o_mi_recursive_expand;
 
     /* "services discovery" menu in the playlist menu */
     IBOutlet id o_mi_services;
@@ -97,6 +98,7 @@
 - (IBAction)selectAll:(id)sender;
 - (IBAction)sortNodeByName:(id)sender;
 - (IBAction)sortNodeByAuthor:(id)sender;
+- (IBAction)recursiveExpandNode:(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;
index cb7b8d6988910392c3572ce696f63bf8154b2a3d..86d87f7168fbe18da51e7e844b4f9452d76e9057 100644 (file)
@@ -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_play setTitle: _NS("Play")];
     [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_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*/
                                         numberOfChildrenOfItem: o_item]  > 0 )
         //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 &&
-                [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
                 playlist_Stop( p_playlist );
@@ -979,6 +979,32 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     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
 {
     NSPoint pt;
@@ -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_selectall setEnabled: b_rows];
     [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 );
 }