[vlc-devel] commit: macosx: display only information on the currently playing item instead of the item selected in the playlist ( Felix Paul Kühne )

git version control git at videolan.org
Sun Jan 4 19:45:53 CET 2009


vlc | branch: 0.9-bugfix | Felix Paul Kühne <fkuehne at videolan.org> | Sun Jan  4 19:39:41 2009 +0100| [2609302d647e32374e7953ace61d7e04305a193b] | committer: Felix Paul Kühne 

macosx: display only information on the currently playing item instead of the item selected in the playlist

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

 NEWS                          |    1 +
 modules/gui/macosx/intf.m     |    7 ++++++-
 modules/gui/macosx/playlist.m |   27 +++++++++++++++++++++++----
 3 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index 7f38549..b42b0ba 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Changes between 0.9.8a and 0.9.9 (not-yet-released):
 ----------------------------------------------------
 
 Mac OS X Interface:
+ * Fixed circumstances, which lead to an empty Information panel
  * Fixed multiple UTF8 issues in the Streaming / Exporting Wizard
 
 New Localizations:
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 03a2851..805b3d2 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -1482,7 +1482,12 @@ static void * ManageThread( void *user_data )
             {
                 b_buffering = YES;
             }
-                 
+
+            /* update our info-panel to reflect the new item */
+            [[[VLCMain sharedInstance] getInfo]
+                updatePanelWithItem: 
+                    playlist_CurrentPlayingItem( p_playlist )->p_input];
+
             /* seekable streams */
             b_seekable = var_GetBool( p_input, "seekable" );
 
diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index 831b64d..28b49b5 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -522,8 +522,27 @@
 
     if( p_item )
     {
-        /* update our info-panel to reflect the new item */
-        [[[VLCMain sharedInstance] getInfo] updatePanelWithItem:p_item->p_input];
+        /* update the state of our Reveal-in-Finder menu items */
+        NSMutableString *o_mrl;
+        char *psz_uri = input_item_GetURI( p_item->p_input );
+        if( psz_uri )
+        {
+            o_mrl = [NSMutableString stringWithUTF8String: psz_uri];
+        
+            /* perform some checks whether it is a file and if it is local at all... */
+            NSRange prefix_range = [o_mrl rangeOfString: @"file:"];
+            if( prefix_range.location != NSNotFound )
+                [o_mrl deleteCharactersInRange: prefix_range];
+            
+            if( [o_mrl characterAtIndex:0] == '/' )
+            {
+                [o_mi_revealInFinder setEnabled: YES];
+                [o_mm_mi_revealInFinder setEnabled: YES];
+                return;
+            }
+        }
+        [o_mi_revealInFinder setEnabled: NO];
+        [o_mm_mi_revealInFinder setEnabled: NO];
     }
 }
 
@@ -1289,10 +1308,10 @@
     return( o_ctx_menu );
 }
 
-- (void)outlineView: (NSTableView*)o_tv
+- (void)outlineView: (NSTableView *)o_tv
                   didClickTableColumn:(NSTableColumn *)o_tc
 {
-    int i_mode = 0, i_type;
+    int i_mode, i_type = 0;
     intf_thread_t *p_intf = VLCIntf;
 
     playlist_t *p_playlist = pl_Yield( p_intf );




More information about the vlc-devel mailing list