Commit 7cf99d81 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

macosx: Fix the info panel. Remove the use of maybe-freed-ptr. Make it display...

macosx: Fix the info panel. Remove the use of maybe-freed-ptr. Make it display currently selected item.
parent fcc30d46
......@@ -1752,8 +1752,11 @@ end:
[o_bookmarks release];
if( nib_info_loaded )
{
[o_info stop];
[o_info release];
}
if( nib_wizard_loaded )
[o_wizard release];
......
......@@ -123,6 +123,8 @@
- (void)sortNode:(int)i_mode;
- (void)updateRowSelection;
- (BOOL)isSelectionEmpty;
- (IBAction)servicesChange:(id)sender;
- (IBAction)playItem:(id)sender;
- (IBAction)preparseItem:(id)sender;
......
......@@ -497,11 +497,29 @@
vlc_object_release( p_playlist );
}
- (void)outlineViewSelectionDidChange:(NSNotification *)notification
{
// FIXME: unsafe
playlist_item_t * p_item = [[o_outline_view itemAtRow:[o_outline_view selectedRow]] pointerValue];
if( p_item )
{
/* update our info-panel to reflect the new item */
[[[VLCMain sharedInstance] getInfo] updatePanelWithItem:p_item->p_input];
}
}
- (BOOL)isSelectionEmpty
{
return [o_outline_view selectedRow] == -1;
}
- (void)updateRowSelection
{
int i_row;
unsigned int j;
// FIXME: unsafe
playlist_t *p_playlist = pl_Yield( VLCIntf );
playlist_item_t *p_item, *p_temp_item;
NSMutableArray *o_array = [NSMutableArray array];
......@@ -532,10 +550,11 @@
}
/* update our info-panel to reflect the new item */
[[[VLCMain sharedInstance] getInfo] updatePanelWithItem:p_item->p_input];
vlc_object_release( p_playlist );
/* update our info-panel to reflect the new item */
[[[VLCMain sharedInstance] getInfo] updatePanel];
}
/* Check if p_item is a child of p_node recursively. We need to check the item
......
......@@ -26,6 +26,7 @@
* VLCPlaylistInfo interface
*****************************************************************************/
@class VLCInfoTreeItem;
@interface VLCInfo : NSObject
{
......@@ -94,7 +95,9 @@
IBOutlet id o_fps_lbl;
IBOutlet id o_fps_txt;
playlist_item_t * p_item;
VLCInfoTreeItem * rootItem;
input_item_t * p_item;
NSTimer * o_statUpdateTimer;
}
......@@ -102,10 +105,8 @@
- (IBAction)metaFieldChanged:(id)sender;
- (IBAction)saveMetaData:(id)sender;
- (void)initMediaPanelStats;
- (void)updatePanel;
- (playlist_item_t *)getItem;
- (BOOL)isItemInPlaylist:(playlist_item_t *)p_item;
- (void)updatePanelWithItem:(input_item_t *)_p_item;
- (input_item_t *)item;
- (void)setMeta: (char *)meta forLabel: (id)theItem;
- (void)updateStatistics: (NSTimer*)theTimer;
......@@ -117,16 +118,15 @@
NSString *o_name;
NSString *o_value;
int i_object_id;
playlist_item_t * p_item;
input_item_t * p_item;
VLCInfoTreeItem *o_parent;
NSMutableArray *o_children;
}
+ (VLCInfoTreeItem *)rootItem;
- (int)numberOfChildren;
- (VLCInfoTreeItem *)childAtIndex:(int)i_index;
- (NSString *)getName;
- (NSString *)getValue;
- (NSString *)name;
- (NSString *)value;
- (void)refresh;
@end
......
This diff is collapsed.
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