Commit 48ad6e8d authored by Benjamin Pracht's avatar Benjamin Pracht

* get rid of useless code (group doesn't exist anymore)

* delete everything related to groups from the item info panel
* some preparation work to reimplement the conextual menu
parent 9a8838d7
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
<string>364.0</string> <string>364.0</string>
<key>IBLockedObjects</key> <key>IBLockedObjects</key>
<array> <array>
<integer>1789</integer>
<integer>2203</integer> <integer>2203</integer>
<integer>2208</integer> <integer>2208</integer>
<integer>2206</integer> <integer>2206</integer>
...@@ -27,9 +26,10 @@ ...@@ -27,9 +26,10 @@
</array> </array>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>21</integer>
<integer>29</integer>
<integer>2197</integer> <integer>2197</integer>
<integer>29</integer>
<integer>1789</integer>
<integer>21</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>7R28</string> <string>7R28</string>
......
...@@ -46,6 +46,12 @@ ...@@ -46,6 +46,12 @@
IBOutlet id o_random_ckb; IBOutlet id o_random_ckb;
IBOutlet id o_loop_popup; IBOutlet id o_loop_popup;
IBOutlet id o_mi_save_playlist; IBOutlet id o_mi_save_playlist;
IBOutlet id o_ctx_menu;
IBOutlet id o_mi_play;
IBOutlet id o_mi_delete;
IBOutlet id o_mi_info;
IBOutlet id o_mi_selectall;
NSImage *o_descendingSortingImage; NSImage *o_descendingSortingImage;
NSImage *o_ascendingSortingImage; NSImage *o_ascendingSortingImage;
......
...@@ -577,45 +577,26 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -577,45 +577,26 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
} }
#if 0
- (NSMenu *)menuForEvent:(NSEvent *)o_event - (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; NSPoint pt;
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_outline_view convertPoint: [o_event locationInWindow]
fromView: nil]; fromView: nil];
b_item_sel = ( [o_table_view rowAtPoint: pt] != -1 && b_item_sel = ( [o_outline_view rowAtPoint: pt] != -1 &&
[o_table_view selectedRow] != -1 ); [o_outline_view selectedRow] != -1 );
b_rows = [o_table_view numberOfRows] != 0; b_rows = [o_outline_view numberOfRows] != 0;
[o_mi_play setEnabled: b_item_sel]; [o_mi_play setEnabled: b_item_sel];
[o_mi_delete setEnabled: b_item_sel]; [o_mi_delete setEnabled: b_item_sel];
[o_mi_selectall setEnabled: b_rows]; [o_mi_selectall setEnabled: b_rows];
[o_mi_info setEnabled: b_item_sel]; [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 ); return( o_ctx_menu );
} }
#endif
- (void)initDict - (void)initDict
{ {
[o_outline_dict removeAllObjects]; [o_outline_dict removeAllObjects];
......
...@@ -40,9 +40,6 @@ ...@@ -40,9 +40,6 @@
IBOutlet id o_btn_delete_group; IBOutlet id o_btn_delete_group;
IBOutlet id o_btn_add_group; IBOutlet id o_btn_add_group;
IBOutlet id o_outline_view; IBOutlet id o_outline_view;
IBOutlet id o_group_lbl;
IBOutlet id o_group_cbx;
IBOutlet id o_group_color;
int i_item; int i_item;
NSMutableArray * o_selected; NSMutableArray * o_selected;
...@@ -53,10 +50,6 @@ ...@@ -53,10 +50,6 @@
- (void)initPanel:(id)sender; - (void)initPanel:(id)sender;
- (IBAction)infoCancel:(id)sender; - (IBAction)infoCancel:(id)sender;
- (IBAction)infoOk:(id)sender; - (IBAction)infoOk:(id)sender;
- (IBAction)handleGroup:(id)sender;
- (IBAction)deleteOutlineGroup:(id)sender;
- (IBAction)createOutlineGroup:(id)sender;
- (void)createComboBox;
- (int)getItem; - (int)getItem;
@end @end
......
...@@ -63,9 +63,6 @@ ...@@ -63,9 +63,6 @@
[o_author_lbl setStringValue: _NS("Author")]; [o_author_lbl setStringValue: _NS("Author")];
[o_btn_ok setTitle: _NS("OK")]; [o_btn_ok setTitle: _NS("OK")];
[o_btn_cancel setTitle: _NS("Cancel")]; [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 - (IBAction)togglePlaylistInfoPanel:(id)sender
...@@ -144,9 +141,6 @@ ...@@ -144,9 +141,6 @@
[[VLCInfoTreeItem rootItem] refresh]; [[VLCInfoTreeItem rootItem] refresh];
[o_outline_view reloadData]; [o_outline_view reloadData];
[self createComboBox];
[self handleGroup:self];
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
[o_info_window makeKeyAndOrderFront: sender]; [o_info_window makeKeyAndOrderFront: sender];
...@@ -160,13 +154,11 @@ ...@@ -160,13 +154,11 @@
- (IBAction)infoOk:(id)sender - (IBAction)infoOk:(id)sender
{ {
int i,i_row,c; int c;
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
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 );
vlc_value_t val; vlc_value_t val;
NSNumber * o_number;
if (p_playlist) if (p_playlist)
{ {
...@@ -179,36 +171,6 @@ ...@@ -179,36 +171,6 @@
playlist_ItemAddInfo(p_playlist->pp_items[i_item],_("General"),_("Author"), [[o_author_txt stringValue] cString]); playlist_ItemAddInfo(p_playlist->pp_items[i_item],_("General"),_("Author"), [[o_author_txt stringValue] cString]);
c = (int)[o_selected count]; 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); vlc_mutex_unlock(&p_playlist->pp_items[i_item]->input.lock);
val.b_bool = VLC_TRUE; val.b_bool = VLC_TRUE;
var_Set( p_playlist,"intf-change",val ); var_Set( p_playlist,"intf-change",val );
...@@ -217,106 +179,6 @@ ...@@ -217,106 +179,6 @@
[o_info_window orderOut: self]; [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 - (int)getItem
{ {
return i_item; return i_item;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment