}
-#if 0
- (NSMenu *)menuForEvent:(NSEvent *)o_event
{
- intf_thread_t * p_intf = VLCIntf;
- playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
-
- bool b_itemstate = FALSE;
-
NSPoint pt;
vlc_bool_t b_rows;
vlc_bool_t b_item_sel;
- pt = [o_table_view convertPoint: [o_event locationInWindow]
+ pt = [o_outline_view convertPoint: [o_event locationInWindow]
fromView: nil];
- b_item_sel = ( [o_table_view rowAtPoint: pt] != -1 &&
- [o_table_view selectedRow] != -1 );
- b_rows = [o_table_view numberOfRows] != 0;
+ b_item_sel = ( [o_outline_view rowAtPoint: pt] != -1 &&
+ [o_outline_view selectedRow] != -1 );
+ b_rows = [o_outline_view numberOfRows] != 0;
[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];
- [o_mi_toggleItemsEnabled setEnabled: b_item_sel];
- [o_mi_enableGroup setEnabled: b_item_sel];
- [o_mi_disableGroup setEnabled: b_item_sel];
-
- if (p_playlist)
- {
- b_itemstate = ([o_table_view selectedRow] > -1) ?
- p_playlist->pp_items[[o_table_view selectedRow]]->b_enabled : FALSE;
- vlc_object_release(p_playlist);
- }
-
- [o_mi_toggleItemsEnabled setState: b_itemstate];
return( o_ctx_menu );
}
-#endif
+
- (void)initDict
{
[o_outline_dict removeAllObjects];
[o_author_lbl setStringValue: _NS("Author")];
[o_btn_ok setTitle: _NS("OK")];
[o_btn_cancel setTitle: _NS("Cancel")];
- [o_btn_delete_group setTitle: _NS("Delete Group")];
- [o_btn_add_group setTitle: _NS("Add Group")];
- [o_group_lbl setStringValue: _NS("Group")];
}
- (IBAction)togglePlaylistInfoPanel:(id)sender
[[VLCInfoTreeItem rootItem] refresh];
[o_outline_view reloadData];
- [self createComboBox];
- [self handleGroup:self];
-
vlc_object_release( p_playlist );
}
[o_info_window makeKeyAndOrderFront: sender];
- (IBAction)infoOk:(id)sender
{
- int i,i_row,c;
+ int c;
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
vlc_value_t val;
- NSNumber * o_number;
-
if (p_playlist)
{
playlist_ItemAddInfo(p_playlist->pp_items[i_item],_("General"),_("Author"), [[o_author_txt stringValue] cString]);
c = (int)[o_selected count];
-#if 0
- if ([[o_group_cbx stringValue] isEqual:
- [o_group_cbx objectValueOfSelectedItem]])
- {
- for (i = 0 ; i < c ; i++)
- {
- o_number = [o_selected lastObject];
- i_row = [o_number intValue];
- p_playlist->pp_items[i_row]->i_group = p_playlist->
- pp_groups[[o_group_cbx indexOfSelectedItem]]->i_id;
- [o_selected removeObject: o_number];
- }
- }
- else
- {
- playlist_group_t * p_group = playlist_CreateGroup( p_playlist,
- strdup([[o_group_cbx stringValue] cString]));
- if (p_group)
- {
- for (i = 0 ; i < c ; i++)
- {
- o_number = [o_selected lastObject];
- i_row = [o_number intValue];
- p_playlist->pp_items[i_row]->i_group = p_group->i_id;
- [o_selected removeObject: o_number];
- }
- }
- }
-
-#endif
vlc_mutex_unlock(&p_playlist->pp_items[i_item]->input.lock);
val.b_bool = VLC_TRUE;
var_Set( p_playlist,"intf-change",val );
[o_info_window orderOut: self];
}
-- (IBAction)handleGroup:(id)sender
-{
-#if 0
- intf_thread_t * p_intf = VLCIntf;
- playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
-
- if (p_playlist)
- {
- if ([[o_group_cbx stringValue] isEqual:
- [o_group_cbx objectValueOfSelectedItem]])
- {
- [o_group_color setBackgroundColor:[[[VLCMain sharedInstance] getPlaylist]
- getColor: p_playlist->pp_groups[
- [o_group_cbx indexOfSelectedItem]]->i_id]];
- }
- else
- {
- [o_group_color setBackgroundColor:[[[VLCMain sharedInstance] getPlaylist]
- getColor:p_playlist->pp_groups[
- [o_group_cbx numberOfItems] - 1]->i_id + 1]];
- }
- vlc_object_release(p_playlist);
- }
-#endif
-}
-
-- (IBAction)deleteOutlineGroup:(id)sender
-{
-#if 0
- intf_thread_t * p_intf = VLCIntf;
- playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
-
- if(p_playlist)
- {
- if ([[o_group_cbx stringValue] isEqual:
- [o_group_cbx objectValueOfSelectedItem]])
- {
- [[[VLCMain sharedInstance] getPlaylist] deleteGroup:p_playlist->pp_groups[
- [o_group_cbx indexOfSelectedItem]]->i_id];
- [self createComboBox];
- [self handleGroup:self];
- [o_group_cbx reloadData];
- }
- else
- {
- msg_Warn(p_playlist,"Group doesn't exist, cannot delete");
- }
- vlc_object_release(p_playlist);
- }
-#endif
-}
-
-- (IBAction)createOutlineGroup:(id)sender;
-{
-#if 0
- intf_thread_t * p_intf = VLCIntf;
- playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
- if(p_playlist)
- {
- playlist_CreateGroup( p_playlist,
- strdup([[o_group_cbx stringValue] cString]));
- [self createComboBox];
- [o_group_cbx reloadData];
- [[[VLCMain sharedInstance] getPlaylist] playlistUpdated];
- vlc_object_release(p_playlist);
- }
-#endif
-}
-
--(void)createComboBox
-{
-#if 0
- intf_thread_t * p_intf = VLCIntf;
- playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
- int i;
-
- [o_group_cbx removeAllItems];
-
- if (p_playlist)
- {
- for (i = 0; i < p_playlist->i_groups ; i++)
- {
- [o_group_cbx addItemWithObjectValue:
- [NSString stringWithUTF8String:
- p_playlist->pp_groups[i]->psz_name]];
- if (p_playlist->pp_items[i_item]->i_group == p_playlist
- ->pp_groups[i]->i_id)
- {
- [o_group_cbx selectItemAtIndex:i];
- }
- }
- vlc_object_release(p_playlist);
- }
-#endif
-}
-
- (int)getItem
{
return i_item;