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: ...@@ -1752,8 +1752,11 @@ end:
[o_bookmarks release]; [o_bookmarks release];
if( nib_info_loaded ) if( nib_info_loaded )
{
[o_info stop];
[o_info release]; [o_info release];
}
if( nib_wizard_loaded ) if( nib_wizard_loaded )
[o_wizard release]; [o_wizard release];
......
...@@ -123,6 +123,8 @@ ...@@ -123,6 +123,8 @@
- (void)sortNode:(int)i_mode; - (void)sortNode:(int)i_mode;
- (void)updateRowSelection; - (void)updateRowSelection;
- (BOOL)isSelectionEmpty;
- (IBAction)servicesChange:(id)sender; - (IBAction)servicesChange:(id)sender;
- (IBAction)playItem:(id)sender; - (IBAction)playItem:(id)sender;
- (IBAction)preparseItem:(id)sender; - (IBAction)preparseItem:(id)sender;
......
...@@ -497,11 +497,29 @@ ...@@ -497,11 +497,29 @@
vlc_object_release( p_playlist ); 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 - (void)updateRowSelection
{ {
int i_row; int i_row;
unsigned int j; unsigned int j;
// FIXME: unsafe
playlist_t *p_playlist = pl_Yield( VLCIntf ); playlist_t *p_playlist = pl_Yield( VLCIntf );
playlist_item_t *p_item, *p_temp_item; playlist_item_t *p_item, *p_temp_item;
NSMutableArray *o_array = [NSMutableArray array]; NSMutableArray *o_array = [NSMutableArray array];
...@@ -532,10 +550,11 @@ ...@@ -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 ); 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 /* Check if p_item is a child of p_node recursively. We need to check the item
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
* VLCPlaylistInfo interface * VLCPlaylistInfo interface
*****************************************************************************/ *****************************************************************************/
@class VLCInfoTreeItem;
@interface VLCInfo : NSObject @interface VLCInfo : NSObject
{ {
...@@ -94,7 +95,9 @@ ...@@ -94,7 +95,9 @@
IBOutlet id o_fps_lbl; IBOutlet id o_fps_lbl;
IBOutlet id o_fps_txt; IBOutlet id o_fps_txt;
playlist_item_t * p_item; VLCInfoTreeItem * rootItem;
input_item_t * p_item;
NSTimer * o_statUpdateTimer; NSTimer * o_statUpdateTimer;
} }
...@@ -102,10 +105,8 @@ ...@@ -102,10 +105,8 @@
- (IBAction)metaFieldChanged:(id)sender; - (IBAction)metaFieldChanged:(id)sender;
- (IBAction)saveMetaData:(id)sender; - (IBAction)saveMetaData:(id)sender;
- (void)initMediaPanelStats; - (void)initMediaPanelStats;
- (void)updatePanel; - (void)updatePanelWithItem:(input_item_t *)_p_item;
- (playlist_item_t *)getItem; - (input_item_t *)item;
- (BOOL)isItemInPlaylist:(playlist_item_t *)p_item;
- (void)setMeta: (char *)meta forLabel: (id)theItem; - (void)setMeta: (char *)meta forLabel: (id)theItem;
- (void)updateStatistics: (NSTimer*)theTimer; - (void)updateStatistics: (NSTimer*)theTimer;
...@@ -117,16 +118,15 @@ ...@@ -117,16 +118,15 @@
NSString *o_name; NSString *o_name;
NSString *o_value; NSString *o_value;
int i_object_id; int i_object_id;
playlist_item_t * p_item; input_item_t * p_item;
VLCInfoTreeItem *o_parent; VLCInfoTreeItem *o_parent;
NSMutableArray *o_children; NSMutableArray *o_children;
} }
+ (VLCInfoTreeItem *)rootItem;
- (int)numberOfChildren; - (int)numberOfChildren;
- (VLCInfoTreeItem *)childAtIndex:(int)i_index; - (VLCInfoTreeItem *)childAtIndex:(int)i_index;
- (NSString *)getName; - (NSString *)name;
- (NSString *)getValue; - (NSString *)value;
- (void)refresh; - (void)refresh;
@end @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