[vlc-devel] commit: macosx: changed the data appearance in the info panel to the following behaviour: if playlist is collapsed, we show data about the currently playing item. if the playlist is shown, we show data about the current selection in the list, regardless of the current item. ( Felix Paul Kühne )

git version control git at videolan.org
Fri Jan 16 20:30:31 CET 2009


vlc | branch: 0.9-bugfix | Felix Paul Kühne <fkuehne at videolan.org> | Fri Jan 16 20:29:58 2009 +0100| [b5d249d719bf71d402bbc11277e8c3bdc8b7ab55] | committer: Felix Paul Kühne 

macosx: changed the data appearance in the info panel to the following behaviour: if playlist is collapsed, we show data about the currently playing item. if the playlist is shown, we show data about the current selection in the list, regardless of the current item.

Empty selections in the playlist are still not allowed, as this would lead to some trouble I don't want to solve for this old panel (to be fixed once the dudiak branch is merged)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b5d249d719bf71d402bbc11277e8c3bdc8b7ab55
---

 modules/gui/macosx/intf.m     |   18 +++++++++++-------
 modules/gui/macosx/playlist.m |   15 ++++++++++++++-
 2 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index d073565..b9fea37 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -1271,6 +1271,11 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
     return nil;
 }
 
+- (BOOL)isPlaylistCollapsed
+{
+    return ![o_btn_playlist state];
+}
+
 - (id)getInfo
 {
     if( o_info )
@@ -1483,9 +1488,10 @@ static void * ManageThread( void *user_data )
                 b_buffering = YES;
             }
 
-            /* update our info-panel to reflect the new item */
-            [[[VLCMain sharedInstance] getInfo]
-                updatePanelWithItem: p_playlist->status.p_item->p_input];
+            /* update our info-panel to reflect the new item, if we don't show
+             * the playlist or the selection is empty */
+            if( [self isPlaylistCollapsed] == YES )
+                [[self getInfo] updatePanelWithItem: p_playlist->status.p_item->p_input];
 
             /* seekable streams */
             b_seekable = var_GetBool( p_input, "seekable" );
@@ -2469,13 +2475,11 @@ end:
 - (void)updateTogglePlaylistState
 {
     if( [o_window contentRectForFrameRect:[o_window frame]].size.height <= 169. )
-    {
         [o_btn_playlist setState: NO];
-    }
     else
-    {
         [o_btn_playlist setState: YES];
-    }
+
+    [[self getPlaylist] outlineViewSelectionDidChange: NULL];
 }
 
 - (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)proposedFrameSize
diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index ccfc815..69e0fa2 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -495,6 +495,8 @@
     }
     PL_UNLOCK;
     vlc_object_release( p_playlist );
+
+    [self outlineViewSelectionDidChange: nil];
 }
 
 - (void)playModeUpdated
@@ -515,6 +517,18 @@
     vlc_object_release( p_playlist );
 }
 
+- (void)outlineViewSelectionDidChange:(NSNotification *)notification
+{
+    // FIXME: unsafe
+    playlist_item_t * p_item = [[o_outline_view itemAtRow:[o_outline_view selectedRow]] pointerValue];
+
+    if( p_item && [[VLCMain sharedInstance] isPlaylistCollapsed] == NO )
+    {
+        /* update our info-panel to reflect the new item, if we aren't collapsed */
+        [[[VLCMain sharedInstance] getInfo] updatePanelWithItem:p_item->p_input];
+    }
+}
+
 - (BOOL)isSelectionEmpty
 {
     return [o_outline_view selectedRow] == -1;
@@ -557,7 +571,6 @@
     }
 
     vlc_object_release( p_playlist );
-
 }
 
 /* Check if p_item is a child of p_node recursively. We need to check the item




More information about the vlc-devel mailing list