]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/playlist.m
Cancel
[vlc] / modules / gui / macosx / playlist.m
index 3777360168bf6af19fe2423edca546db84e4aef4..31dfb8aa2f673bf72d2c291df25ad3ccce99e39f 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.m: MacOS X interface module
  *****************************************************************************
  * Copyright (C) 2002-2004 VideoLAN
- * $Id: playlist.m,v 1.59 2004/03/03 11:34:19 bigben Exp $
+ * $Id$
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Derk-Jan Hartman <hartman at videolan dot org>
     [o_table_view setIntercellSpacing: NSMakeSize (0.0, 1.0)];
     [o_window setExcludedFromWindowsMenu: TRUE];
 
+//    [o_tbv_info setDataSource: [VLCInfoDataSource init]];
+
 /* We need to check whether _defaultTableHeaderSortImage exists, since it 
 belongs to an Apple hidden private API, and then can "disapear" at any time*/
 
@@ -169,6 +171,8 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     [o_mi_play setTitle: _NS("Play")];
     [o_mi_delete setTitle: _NS("Delete")];
     [o_mi_selectall setTitle: _NS("Select All")];
+    [o_mi_info setTitle: _NS("Properties")];
+
     [[o_tc_name headerCell] setStringValue:_NS("Name")];
     [[o_tc_author headerCell] setStringValue:_NS("Author")];
     [[o_tc_duration headerCell] setStringValue:_NS("Duration")];
@@ -197,7 +201,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     }
 
     if( o_tc_sortColumn == o_tc )
-    { 
+    {
         b_isSortDescending = !b_isSortDescending;
     }
     else if( o_tc == o_tc_name || o_tc == o_tc_author || 
@@ -269,6 +273,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     [o_mi_play setEnabled: b_item_sel];
     [o_mi_delete setEnabled: b_item_sel];
     [o_mi_selectall setEnabled: b_rows];
+    [o_mi_info setEnabled: b_item_sel];
 
     return( o_ctx_menu );
 }
@@ -399,7 +404,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
 
         vlc_mutex_lock( &p_playlist->object_lock );
         o_current_name = [NSString stringWithUTF8String: 
-            p_playlist->pp_items[i_current]->psz_name];
+            p_playlist->pp_items[i_current]->input.psz_name];
         o_current_author = [NSString stringWithUTF8String: 
             playlist_GetInfo(p_playlist, i_current ,_("General"),_("Author") )];
         vlc_mutex_unlock( &p_playlist->object_lock );
@@ -611,6 +616,10 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     [o_table_view scrollRowToVisible: i_row];
 }
 
+- (int)selectedPlaylistItem
+{
+    return [o_table_view selectedRow];
+}
 
 @end
 
@@ -656,7 +665,10 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     {
         vlc_mutex_lock( &p_playlist->object_lock );
         o_value = [NSString stringWithUTF8String: 
-            p_playlist->pp_items[i_row]->psz_name];
+            p_playlist->pp_items[i_row]->input.psz_name];
+        if( o_value == NULL )
+            o_value = [NSString stringWithCString: 
+                p_playlist->pp_items[i_row]->input.psz_name];
         vlc_mutex_unlock( &p_playlist->object_lock );
     }
     else if( [[o_tc identifier] isEqualToString:@"2"] )
@@ -664,6 +676,9 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
         vlc_mutex_lock( &p_playlist->object_lock );
         o_value = [NSString stringWithUTF8String: 
             playlist_GetInfo(p_playlist, i_row ,_("General"),_("Author") )];
+        if( o_value == NULL )
+            o_value = [NSString stringWithCString: 
+                playlist_GetInfo(p_playlist, i_row ,_("General"),_("Author") )];
         vlc_mutex_unlock( &p_playlist->object_lock );
     }
     else if( [[o_tc identifier] isEqualToString:@"3"] )
@@ -844,3 +859,4 @@ vlc_object_release( p_playlist );
 
 @end
 
+