Commit d3d496a7 authored by Benjamin Pracht's avatar Benjamin Pracht

*all :

- Add "Add group" and "delete group" buttons in the playlistinfo window
- When several items of the playlist are selected, and we change the group, change it for all selected items...
parent 791c8192
...@@ -373,6 +373,8 @@ ...@@ -373,6 +373,8 @@
}, },
{ {
ACTIONS = { ACTIONS = {
createOutlineGroup = id;
deleteOutlineGroup = id;
handleGroup = id; handleGroup = id;
infoCancel = id; infoCancel = id;
infoOk = id; infoOk = id;
...@@ -383,7 +385,9 @@ ...@@ -383,7 +385,9 @@
OUTLETS = { OUTLETS = {
"o_author_lbl" = id; "o_author_lbl" = id;
"o_author_txt" = id; "o_author_txt" = id;
"o_btn_add_group" = id;
"o_btn_cancel" = id; "o_btn_cancel" = id;
"o_btn_delete_group" = id;
"o_btn_ok" = id; "o_btn_ok" = id;
"o_group_cbx" = id; "o_group_cbx" = id;
"o_group_color" = id; "o_group_color" = id;
......
...@@ -106,6 +106,8 @@ ...@@ -106,6 +106,8 @@
/*For playlist info window*/ /*For playlist info window*/
- (int)selectedPlaylistItem; - (int)selectedPlaylistItem;
- (void)deleteGroup:(int)i_id;
- (NSMutableArray *)selectedPlaylistItemsList;
- (NSColor *)getColor:(int)i_group; - (NSColor *)getColor:(int)i_group;
@end @end
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
int i, c, i_row; int i, c, i_row;
NSMutableArray *o_to_delete; NSMutableArray *o_to_delete;
NSNumber *o_number; NSNumber *o_number;
playlist_t * p_playlist; playlist_t * p_playlist;
intf_thread_t * p_intf = [NSApp getIntf]; intf_thread_t * p_intf = [NSApp getIntf];
...@@ -65,12 +65,12 @@ ...@@ -65,12 +65,12 @@
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
if ( p_playlist == NULL ) if ( p_playlist == NULL )
{ {
return; return;
} }
switch( key ) switch( key )
{ {
case NSDeleteCharacter: case NSDeleteCharacter:
...@@ -79,11 +79,11 @@ ...@@ -79,11 +79,11 @@
case NSBackspaceCharacter: case NSBackspaceCharacter:
o_to_delete = [NSMutableArray arrayWithArray:[[self selectedRowEnumerator] allObjects]]; o_to_delete = [NSMutableArray arrayWithArray:[[self selectedRowEnumerator] allObjects]];
c = [o_to_delete count]; c = [o_to_delete count];
for( i = 0; i < c; i++ ) { for( i = 0; i < c; i++ ) {
o_number = [o_to_delete lastObject]; o_number = [o_to_delete lastObject];
i_row = [o_number intValue]; i_row = [o_number intValue];
if( p_playlist->i_index == i_row && p_playlist->i_status ) if( p_playlist->i_index == i_row && p_playlist->i_status )
{ {
playlist_Stop( p_playlist ); playlist_Stop( p_playlist );
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
} }
[self reloadData]; [self reloadData];
break; break;
default: default:
[super keyDown: o_event]; [super keyDown: o_event];
break; break;
...@@ -221,14 +221,14 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -221,14 +221,14 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
} }
if( o_tc_id == o_tc && !b_isSortDescending ) if( o_tc_id == o_tc && !b_isSortDescending )
{ {
playlist_SortID( p_playlist , ORDER_NORMAL ); playlist_SortID( p_playlist , ORDER_NORMAL );
[o_table_view setIndicatorImage:o_ascendingSortingImage inTableColumn:o_tc]; [o_table_view setIndicatorImage:o_ascendingSortingImage inTableColumn:o_tc];
} }
else if( o_tc_name == o_tc && !b_isSortDescending ) else if( o_tc_name == o_tc && !b_isSortDescending )
{ {
playlist_SortTitle( p_playlist , ORDER_NORMAL ); playlist_SortTitle( p_playlist , ORDER_NORMAL );
[o_table_view setIndicatorImage:o_ascendingSortingImage inTableColumn:o_tc]; [o_table_view setIndicatorImage:o_ascendingSortingImage inTableColumn:o_tc];
} }
else if( o_tc_author == o_tc && !b_isSortDescending ) else if( o_tc_author == o_tc && !b_isSortDescending )
{ {
...@@ -236,12 +236,12 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -236,12 +236,12 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
[o_table_view setIndicatorImage:o_ascendingSortingImage inTableColumn:o_tc]; [o_table_view setIndicatorImage:o_ascendingSortingImage inTableColumn:o_tc];
} }
else if( o_tc_id == o_tc && b_isSortDescending ) else if( o_tc_id == o_tc && b_isSortDescending )
{ {
playlist_SortID( p_playlist , ORDER_REVERSE ); playlist_SortID( p_playlist , ORDER_REVERSE );
[o_table_view setIndicatorImage:o_ascendingSortingImage inTableColumn:o_tc]; [o_table_view setIndicatorImage:o_ascendingSortingImage inTableColumn:o_tc];
} }
else if( o_tc_name == o_tc && b_isSortDescending ) else if( o_tc_name == o_tc && b_isSortDescending )
{ {
playlist_SortTitle( p_playlist , ORDER_REVERSE ); playlist_SortTitle( p_playlist , ORDER_REVERSE );
[o_table_view setIndicatorImage:o_descendingSortingImage inTableColumn:o_tc]; [o_table_view setIndicatorImage:o_descendingSortingImage inTableColumn:o_tc];
} }
...@@ -249,13 +249,13 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -249,13 +249,13 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
{ {
playlist_SortAuthor( p_playlist , ORDER_REVERSE ); playlist_SortAuthor( p_playlist , ORDER_REVERSE );
[o_table_view setIndicatorImage:o_descendingSortingImage inTableColumn:o_tc]; [o_table_view setIndicatorImage:o_descendingSortingImage inTableColumn:o_tc];
} }
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
[self playlistUpdated]; [self playlistUpdated];
} }
- (BOOL)tableView:(NSTableView *)o_tv - (BOOL)tableView:(NSTableView *)o_tv
shouldEditTableColumn:(NSTableColumn *)o_tc shouldEditTableColumn:(NSTableColumn *)o_tc
row:(int)i_row row:(int)i_row
{ {
...@@ -274,7 +274,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -274,7 +274,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
vlc_bool_t b_rows; vlc_bool_t b_rows;
vlc_bool_t b_item_sel; vlc_bool_t b_item_sel;
pt = [o_table_view convertPoint: [o_event locationInWindow] pt = [o_table_view convertPoint: [o_event locationInWindow]
fromView: nil]; fromView: nil];
b_item_sel = ( [o_table_view rowAtPoint: pt] != -1 && b_item_sel = ( [o_table_view rowAtPoint: pt] != -1 &&
[o_table_view selectedRow] != -1 ); [o_table_view selectedRow] != -1 );
...@@ -319,7 +319,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -319,7 +319,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
intf_thread_t * p_intf = [NSApp getIntf]; intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
NSSavePanel *o_save_panel = [NSSavePanel savePanel]; NSSavePanel *o_save_panel = [NSSavePanel savePanel];
NSString * o_name = [NSString stringWithFormat: @"%@.m3u", _NS("Untitled")]; NSString * o_name = [NSString stringWithFormat: @"%@.m3u", _NS("Untitled")];
[o_save_panel setTitle: _NS("Save Playlist")]; [o_save_panel setTitle: _NS("Save Playlist")];
...@@ -360,14 +360,14 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -360,14 +360,14 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
{ {
return; return;
} }
o_to_delete = [NSMutableArray arrayWithArray:[[o_table_view selectedRowEnumerator] allObjects]]; o_to_delete = [NSMutableArray arrayWithArray:[[o_table_view selectedRowEnumerator] allObjects]];
c = (int)[o_to_delete count]; c = (int)[o_to_delete count];
for( i = 0; i < c; i++ ) { for( i = 0; i < c; i++ ) {
o_number = [o_to_delete lastObject]; o_number = [o_to_delete lastObject];
i_row = [o_number intValue]; i_row = [o_number intValue];
if( p_playlist->i_index == i_row && p_playlist->i_status ) if( p_playlist->i_index == i_row && p_playlist->i_status )
{ {
playlist_Stop( p_playlist ); playlist_Stop( p_playlist );
...@@ -380,7 +380,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -380,7 +380,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
/* this is actually duplicity, because the intf.m manage also updates the view /* this is actually duplicity, because the intf.m manage also updates the view
* when the playlist changes. we do this on purpose, because else there is a * when the playlist changes. we do this on purpose, because else there is a
* delay of .5 sec or so when we delete an item */ * delay of .5 sec or so when we delete an item */
[self playlistUpdated]; [self playlistUpdated];
[self updateRowSelection]; [self updateRowSelection];
...@@ -446,7 +446,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -446,7 +446,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
} }
} }
- (IBAction)disableGroup:(id)sender - (IBAction)disableGroup:(id)sender
{ {
intf_thread_t * p_intf = [NSApp getIntf]; intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
...@@ -475,7 +475,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -475,7 +475,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
intf_thread_t * p_intf = [NSApp getIntf]; intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
return; return;
...@@ -491,7 +491,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -491,7 +491,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
} }
else else
{ {
i_current = [o_table_view selectedRow]; i_current = [o_table_view selectedRow];
} }
do do
...@@ -499,9 +499,9 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -499,9 +499,9 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
i_current++; i_current++;
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
o_current_name = [NSString stringWithUTF8String: o_current_name = [NSString stringWithUTF8String:
p_playlist->pp_items[i_current]->input.psz_name]; p_playlist->pp_items[i_current]->input.psz_name];
o_current_author = [NSString stringWithUTF8String: o_current_author = [NSString stringWithUTF8String:
playlist_GetInfo(p_playlist, i_current ,_("General"),_("Author") )]; playlist_GetInfo(p_playlist, i_current ,_("General"),_("Author") )];
vlc_mutex_unlock( &p_playlist->object_lock ); vlc_mutex_unlock( &p_playlist->object_lock );
...@@ -594,16 +594,16 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -594,16 +594,16 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
NSArray *o_options; NSArray *o_options;
NSURL *o_true_file; NSURL *o_true_file;
char **ppsz_options = NULL; char **ppsz_options = NULL;
/* Get the item */ /* Get the item */
o_one_item = [o_array objectAtIndex: i_item]; o_one_item = [o_array objectAtIndex: i_item];
o_uri = (NSString *)[o_one_item objectForKey: @"ITEM_URL"]; o_uri = (NSString *)[o_one_item objectForKey: @"ITEM_URL"];
o_name = (NSString *)[o_one_item objectForKey: @"ITEM_NAME"]; o_name = (NSString *)[o_one_item objectForKey: @"ITEM_NAME"];
o_options = (NSArray *)[o_one_item objectForKey: @"ITEM_OPTIONS"]; o_options = (NSArray *)[o_one_item objectForKey: @"ITEM_OPTIONS"];
/* If no name, then make a guess */ /* If no name, then make a guess */
if( !o_name) o_name = [[NSFileManager defaultManager] displayNameAtPath: o_uri]; if( !o_name) o_name = [[NSFileManager defaultManager] displayNameAtPath: o_uri];
if( [[NSFileManager defaultManager] fileExistsAtPath:o_uri isDirectory:&b_dir] && b_dir && if( [[NSFileManager defaultManager] fileExistsAtPath:o_uri isDirectory:&b_dir] && b_dir &&
[[NSWorkspace sharedWorkspace] getFileSystemInfoForPath: o_uri isRemovable: &b_rem [[NSWorkspace sharedWorkspace] getFileSystemInfoForPath: o_uri isRemovable: &b_rem
isWritable:NULL isUnmountable:NULL description:NULL type:NULL] && b_rem ) isWritable:NULL isUnmountable:NULL description:NULL type:NULL] && b_rem )
...@@ -622,24 +622,24 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -622,24 +622,24 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
{ {
/* Count the input options */ /* Count the input options */
i_total_options = [o_options count]; i_total_options = [o_options count];
/* Allocate ppsz_options */ /* Allocate ppsz_options */
for( j = 0; j < i_total_options; j++ ) for( j = 0; j < i_total_options; j++ )
{ {
if( !ppsz_options ) if( !ppsz_options )
ppsz_options = (char **)malloc( sizeof(char *) * i_total_options ); ppsz_options = (char **)malloc( sizeof(char *) * i_total_options );
ppsz_options[j] = strdup([[o_options objectAtIndex:j] UTF8String]); ppsz_options[j] = strdup([[o_options objectAtIndex:j] UTF8String]);
} }
} }
/* Add the item */ /* Add the item */
i_new_id = playlist_AddExt( p_playlist, [o_uri fileSystemRepresentation], i_new_id = playlist_AddExt( p_playlist, [o_uri fileSystemRepresentation],
[o_name UTF8String], i_mode, [o_name UTF8String], i_mode,
i_position == -1 ? PLAYLIST_END : i_position + i_item, i_position == -1 ? PLAYLIST_END : i_position + i_item,
0, (ppsz_options != NULL ) ? (const char **)ppsz_options : 0, i_total_options ); 0, (ppsz_options != NULL ) ? (const char **)ppsz_options : 0, i_total_options );
/* clean up /* clean up
for( j = 0; j < i_total_options; j++ ) for( j = 0; j < i_total_options; j++ )
free( ppsz_options[j] ); free( ppsz_options[j] );
if( ppsz_options ) free( ppsz_options ); */ if( ppsz_options ) free( ppsz_options ); */
...@@ -647,11 +647,11 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -647,11 +647,11 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
/* Recent documents menu */ /* Recent documents menu */
o_true_file = [NSURL fileURLWithPath: o_uri]; o_true_file = [NSURL fileURLWithPath: o_uri];
if( o_true_file != nil ) if( o_true_file != nil )
{ {
[[NSDocumentController sharedDocumentController] [[NSDocumentController sharedDocumentController]
noteNewRecentDocumentURL: o_true_file]; noteNewRecentDocumentURL: o_true_file];
} }
if( i_item == 0 && !b_enqueue ) if( i_item == 0 && !b_enqueue )
{ {
playlist_Goto( p_playlist, playlist_GetPositionById( p_playlist, i_new_id ) ); playlist_Goto( p_playlist, playlist_GetPositionById( p_playlist, i_new_id ) );
...@@ -717,6 +717,65 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -717,6 +717,65 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
return [o_table_view selectedRow]; return [o_table_view selectedRow];
} }
- (NSMutableArray *)selectedPlaylistItemsList
{
return [NSMutableArray arrayWithArray:[[o_table_view
selectedRowEnumerator] allObjects]];
}
- (void)deleteGroup:(int)i_id
{
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
int i;
int i_newgroup = 0;
if (p_playlist)
{
/*first, change the group of all the items that belong to the group to
delete. Change it to the group with the smallest id.*/
/*search for the group with the smallest id*/
if(p_playlist->i_groups == 1)
{
msg_Warn(p_playlist,"Trying to delete last group, cancelling");
vlc_object_release(p_playlist);
return;
}
for (i = 0 ; i<p_playlist->i_groups ; i++)
{
if((i_newgroup == 0 || i_newgroup > p_playlist->pp_groups[i]->i_id)
&& p_playlist->pp_groups[i]->i_id != i_id)
{
i_newgroup = p_playlist->pp_groups[i]->i_id;
}
}
vlc_mutex_lock( &p_playlist->object_lock );
for (i = 0; i < p_playlist->i_size;i++)
{
if (p_playlist->pp_items[i]->i_group == i_id)
{
vlc_mutex_lock(&p_playlist->pp_items[i]->input.lock);
p_playlist->pp_items[i]->i_group = i_newgroup;
vlc_mutex_unlock(&p_playlist->pp_items[i]->input.lock);
}
}
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_DeleteGroup( p_playlist, i_id );
vlc_object_release(p_playlist);
[self playlistUpdated];
}
}
- (NSColor *)getColor:(int)i_group - (NSColor *)getColor:(int)i_group
{ {
NSColor * o_color = nil; NSColor * o_color = nil;
...@@ -732,10 +791,10 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -732,10 +791,10 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
o_color = [NSColor colorWithDeviceRed:1.0 green:0.76471 blue:0.76471 alpha:1.0]; o_color = [NSColor colorWithDeviceRed:1.0 green:0.76471 blue:0.76471 alpha:1.0];
break; break;
case 3: case 3:
/*dark blue*/ /*dark blue*/
o_color = [NSColor colorWithDeviceRed:0.76471 green:0.76471 blue:1.0 alpha:1.0]; o_color = [NSColor colorWithDeviceRed:0.76471 green:0.76471 blue:1.0 alpha:1.0];
break; break;
case 4: case 4:
/*orange*/ /*orange*/
...@@ -746,11 +805,11 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -746,11 +805,11 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
/*purple*/ /*purple*/
o_color = [NSColor colorWithDeviceRed:1.0 green:0.76471 blue:1.0 alpha:1.0]; o_color = [NSColor colorWithDeviceRed:1.0 green:0.76471 blue:1.0 alpha:1.0];
break; break;
case 6: case 6:
/*green*/ /*green*/
o_color = [NSColor colorWithDeviceRed:0.76471 green:1.0 blue:0.76471 alpha:1.0]; o_color = [NSColor colorWithDeviceRed:0.76471 green:1.0 blue:0.76471 alpha:1.0];
break; break;
case 7: case 7:
/*light blue*/ /*light blue*/
...@@ -761,7 +820,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -761,7 +820,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
/*yellow*/ /*yellow*/
o_color = [NSColor colorWithDeviceRed:1.0 green:1.0 blue:0.76471 alpha:1.0]; o_color = [NSColor colorWithDeviceRed:1.0 green:1.0 blue:0.76471 alpha:1.0];
break; break;
} }
return o_color; return o_color;
} }
...@@ -787,8 +846,8 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -787,8 +846,8 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
return( i_count ); return( i_count );
} }
- (id)tableView:(NSTableView *)o_tv - (id)tableView:(NSTableView *)o_tv
objectValueForTableColumn:(NSTableColumn *)o_tc objectValueForTableColumn:(NSTableColumn *)o_tc
row:(int)i_row row:(int)i_row
{ {
id o_value = nil; id o_value = nil;
...@@ -808,20 +867,20 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -808,20 +867,20 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
else if( [[o_tc identifier] isEqualToString:@"1"] ) else if( [[o_tc identifier] isEqualToString:@"1"] )
{ {
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
o_value = [NSString stringWithUTF8String: o_value = [NSString stringWithUTF8String:
p_playlist->pp_items[i_row]->input.psz_name]; p_playlist->pp_items[i_row]->input.psz_name];
if( o_value == NULL ) if( o_value == NULL )
o_value = [NSString stringWithCString: o_value = [NSString stringWithCString:
p_playlist->pp_items[i_row]->input.psz_name]; p_playlist->pp_items[i_row]->input.psz_name];
vlc_mutex_unlock( &p_playlist->object_lock ); vlc_mutex_unlock( &p_playlist->object_lock );
} }
else if( [[o_tc identifier] isEqualToString:@"2"] ) else if( [[o_tc identifier] isEqualToString:@"2"] )
{ {
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
o_value = [NSString stringWithUTF8String: o_value = [NSString stringWithUTF8String:
playlist_GetInfo(p_playlist, i_row ,_("General"),_("Author") )]; playlist_GetInfo(p_playlist, i_row ,_("General"),_("Author") )];
if( o_value == NULL ) if( o_value == NULL )
o_value = [NSString stringWithCString: o_value = [NSString stringWithCString:
playlist_GetInfo(p_playlist, i_row ,_("General"),_("Author") )]; playlist_GetInfo(p_playlist, i_row ,_("General"),_("Author") )];
vlc_mutex_unlock( &p_playlist->object_lock ); vlc_mutex_unlock( &p_playlist->object_lock );
} }
...@@ -846,9 +905,9 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -846,9 +905,9 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
} }
- (void)tableView:(NSTableView *)o_tv - (void)tableView:(NSTableView *)o_tv
willDisplayCell:(id)o_cell willDisplayCell:(id)o_cell
forTableColumn:(NSTableColumn *)o_tc forTableColumn:(NSTableColumn *)o_tc
row:(int)i_rows row:(int)i_rows
{ {
intf_thread_t * p_intf = [NSApp getIntf]; intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
...@@ -860,7 +919,10 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -860,7 +919,10 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
[o_cell setDrawsBackground: VLC_TRUE]; [o_cell setDrawsBackground: VLC_TRUE];
[o_cell setBackgroundColor: [o_cell setBackgroundColor:
[self getColor:p_playlist->pp_items[i_rows]->i_group]]; [self getColor:p_playlist->pp_items[i_rows]->i_group]];
}
else
{
[o_cell setDrawsBackground: VLC_FALSE];
} }
if (!p_playlist->pp_items[i_rows]->b_enabled) if (!p_playlist->pp_items[i_rows]->b_enabled)
...@@ -877,11 +939,11 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -877,11 +939,11 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
- (BOOL)tableView:(NSTableView *)o_tv - (BOOL)tableView:(NSTableView *)o_tv
writeRows:(NSArray*)o_rows writeRows:(NSArray*)o_rows
toPasteboard:(NSPasteboard*)o_pasteboard toPasteboard:(NSPasteboard*)o_pasteboard
{ {
int i_rows = [o_rows count]; int i_rows = [o_rows count];
NSArray *o_filenames = [NSArray array]; NSArray *o_filenames = [NSArray array];
[o_pasteboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:self]; [o_pasteboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:self];
[o_pasteboard setPropertyList:o_filenames forType:NSFilenamesPboardType]; [o_pasteboard setPropertyList:o_filenames forType:NSFilenamesPboardType];
if ( i_rows == 1 ) if ( i_rows == 1 )
...@@ -895,7 +957,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -895,7 +957,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
- (NSDragOperation)tableView:(NSTableView*)o_tv - (NSDragOperation)tableView:(NSTableView*)o_tv