+ msg_Dbg( p_intf, "dialog acknowledged" );
+}
+
+@end
+
+/*****************************************************************************
+ * VLCErrorInteractionPanel implementation
+ *****************************************************************************/
+@implementation VLCErrorInteractionPanel
+-(id)init
+{
+ [super init];
+
+ /* load the nib */
+ nib_interact_errpanel_loaded = [NSBundle loadNibNamed:@"InteractionErrorPanel" owner:self];
+
+ /* init strings */
+ [o_window setTitle: _NS("Errors and Warnings")];
+ [o_cleanup_button setTitle: _NS("Clean up")];
+ [o_messages_btn setTitle: _NS("Show Details")];
+
+ /* init data sources */
+ o_errors = [[NSMutableArray alloc] init];
+ o_icons = [[NSMutableArray alloc] init];
+
+ /* ugly Carbon stuff following...
+ * regrettably, you can't get the icons through clean Cocoa */
+
+ /* retrieve our error icon */
+ IconRef ourIconRef;
+ int returnValue;
+ returnValue = GetIconRef(kOnSystemDisk, 'macs', 'stop', &ourIconRef);
+ errorIcon = [[NSImage alloc] initWithSize:NSMakeSize(32,32)];
+ [errorIcon lockFocus];
+ CGRect rect = CGRectMake(0,0,32,32);
+ PlotIconRefInContext((CGContextRef)[[NSGraphicsContext currentContext]
+ graphicsPort],
+ &rect,
+ kAlignNone,
+ kTransformNone,
+ NULL /*inLabelColor*/,
+ kPlotIconRefNormalFlags,
+ (IconRef)ourIconRef);
+ [errorIcon unlockFocus];
+ returnValue = ReleaseIconRef(ourIconRef);
+
+ /* retrieve our caution icon */
+ returnValue = GetIconRef(kOnSystemDisk, 'macs', 'caut', &ourIconRef);
+ warnIcon = [[NSImage alloc] initWithSize:NSMakeSize(32,32)];
+ [warnIcon lockFocus];
+ PlotIconRefInContext((CGContextRef)[[NSGraphicsContext currentContext]
+ graphicsPort],
+ &rect,
+ kAlignNone,
+ kTransformNone,
+ NULL /*inLabelColor*/,
+ kPlotIconRefNormalFlags,
+ (IconRef)ourIconRef);
+ [warnIcon unlockFocus];
+ returnValue = ReleaseIconRef(ourIconRef);
+
+ return self;
+}
+
+-(void)dealloc
+{
+ [errorIcon release];
+ [warnIcon release];
+ [o_errors release];
+ [o_icons release];
+ [super dealloc];
+}
+
+-(void)showPanel
+{
+ [o_window makeKeyAndOrderFront: self];
+}
+
+-(void)addError: (NSString *)o_error withMsg:(NSString *)o_msg
+{
+ /* format our string as desired */
+ NSMutableAttributedString * ourError;
+ ourError = [[NSMutableAttributedString alloc] initWithString:
+ [NSString stringWithFormat:@"%@\n%@", o_error, o_msg]
+ attributes:
+ [NSDictionary dictionaryWithObject: [NSFont systemFontOfSize:11] forKey: NSFontAttributeName]];
+ [ourError
+ addAttribute: NSFontAttributeName
+ value: [NSFont boldSystemFontOfSize:11]
+ range: NSMakeRange( 0, [o_error length])];
+ [o_errors addObject: ourError];
+ [ourError release];
+
+ [o_icons addObject: errorIcon];
+
+ [o_error_table reloadData];
+ [self showPanel];
+}
+
+-(void)addWarning: (NSString *)o_warning withMsg:(NSString *)o_msg
+{
+ /* format our string as desired */
+ NSMutableAttributedString * ourWarning;
+ ourWarning = [[NSMutableAttributedString alloc] initWithString:
+ [NSString stringWithFormat:@"%@\n%@", o_warning, o_msg]
+ attributes:
+ [NSDictionary dictionaryWithObject: [NSFont systemFontOfSize:11] forKey: NSFontAttributeName]];
+ [ourWarning
+ addAttribute: NSFontAttributeName
+ value: [NSFont boldSystemFontOfSize:11]
+ range: NSMakeRange( 0, [o_warning length])];
+ [o_errors addObject: ourWarning];
+ [ourWarning release];
+
+ [o_icons addObject: warnIcon];
+
+ [o_error_table reloadData];
+
+ [self showPanel];
+}
+
+-(IBAction)cleanupTable:(id)sender
+{
+ [o_errors removeAllObjects];
+ [o_icons removeAllObjects];
+ [o_error_table reloadData];
+}
+
+-(IBAction)showMessages:(id)sender
+{
+ [[VLCMain sharedInstance] showMessagesPanel: sender];
+}
+
+/*----------------------------------------------------------------------------
+ * data source methods
+ *---------------------------------------------------------------------------*/
+- (int)numberOfRowsInTableView:(NSTableView *)theDataTable
+{
+ return [o_errors count];
+}
+
+- (id)tableView:(NSTableView *)theDataTable objectValueForTableColumn:
+ (NSTableColumn *)theTableColumn row: (int)row
+{
+ if( [[theTableColumn identifier] isEqualToString: @"error_msg"] )
+ return [o_errors objectAtIndex: row];
+
+ if( [[theTableColumn identifier] isEqualToString: @"icon"] )
+ return [o_icons objectAtIndex: row];
+
+ return @"unknown identifier";