diff --git a/Tools/xcodecapp-cocoa/AppController.h b/Tools/xcodecapp-cocoa/AppController.h index 9d604d25a..498d36d1d 100644 --- a/Tools/xcodecapp-cocoa/AppController.h +++ b/Tools/xcodecapp-cocoa/AppController.h @@ -34,8 +34,12 @@ IBOutlet NSMenuItem *menuItemStop; IBOutlet NSMenuItem *menuItemOpenXCode; + IBOutlet NSPanel *errorsPanel; + IBOutlet NSTableView *errorsTable; + NSFileManager *fm; NSMutableArray *modifiedXIBs; + NSMutableArray *errorList; NSMutableDictionary *pathModificationDates; NSDate *appStartedTimestamp; NSNumber *lastEventId; @@ -74,5 +78,12 @@ - (IBAction)openXCode:(id)aSender; - (BOOL)validateMenuItem:(NSMenuItem*)menuItem; +- (void)updateErrorTable; +- (IBAction)clearErrors:(id)sender; +- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView; +- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView; +- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row; +- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(int)aRow; + @end diff --git a/Tools/xcodecapp-cocoa/AppController.m b/Tools/xcodecapp-cocoa/AppController.m index e95f66874..da8e71f29 100644 --- a/Tools/xcodecapp-cocoa/AppController.m +++ b/Tools/xcodecapp-cocoa/AppController.m @@ -44,6 +44,8 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, void *userData, size_t n if (self) { + errorList = [NSMutableArray arrayWithCapacity:10]; + if (!growlDelegateRef) growlDelegateRef = [[[PRHEmptyGrowlDelegate alloc] init] autorelease]; @@ -260,6 +262,12 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, void *userData, size_t n isSticky:NO clickContext:nil]; NSLog(@"Error in conversion: return message is %@", response); + + //if (![GrowlApplicationBridge isGrowlRunning]) + { + [errorList addObject:response]; + [self updateErrorTable]; + } } } } @@ -274,7 +282,8 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, void *userData, size_t n - (BOOL)isXIBFile:(NSString *)path { - return [[[path pathExtension] uppercaseString] isEqual:@"XIB"]; + path = [[path pathExtension] uppercaseString]; + return [path isEqual:@"XIB"] || [path isEqual:@"NIB"]; } - (BOOL)prepareXCodeSupportProject @@ -492,6 +501,18 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, void *userData, size_t n } +- (void)updateErrorTable +{ + [errorsTable reloadData]; + [errorsPanel orderFront:self]; + NSLog(@"update?"); +} + +- (IBAction)clearErrors:(id)sender +{ + [errorList removeAllObjects]; + [errorsTable reloadData]; +} #pragma mark - #pragma mark Delegates @@ -502,7 +523,7 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, void *userData, size_t n return YES; } -- (BOOL)validateMenuItem:(NSMenuItem*)aMenuItem +- (BOOL)validateMenuItem:(NSMenuItem *)aMenuItem { if (aMenuItem == menuItemStart) return !currentProjectURL; @@ -512,4 +533,37 @@ void fsevents_callback(ConstFSEventStreamRef streamRef, void *userData, size_t n return YES; } + +- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView +{ + return [errorList count]; +} +- (id)tableView:(NSTableView*)aTableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row +{ + return [errorList objectAtIndex:row]; +} + +- (void)tableViewColumnDidResize:(NSNotification *)tableView +{ + [errorsTable noteHeightOfRowsWithIndexesChanged: + [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [errorList count])]]; +} + +- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(int)aRow +{ + // Get column you want - first in this case: + NSTableColumn *tabCol = [[tableView tableColumns] objectAtIndex:0]; + float width = [tabCol width]; + NSRect r = NSMakeRect(0,0,width,1000.0); + NSCell *cell = [tabCol dataCellForRow:aRow]; + NSString *content = [errorList objectAtIndex:aRow]; + [cell setObjectValue:content]; + float height = [cell cellSizeForBounds:r].height; + + if (height <= 0) + height = 16.0; // Ensure miniumum height is 16.0 + + return height; + +} @end diff --git a/Tools/xcodecapp-cocoa/English.lproj/MainMenu.nib/designable.nib b/Tools/xcodecapp-cocoa/English.lproj/MainMenu.nib/designable.nib index 458775033..9867bb675 100644 --- a/Tools/xcodecapp-cocoa/English.lproj/MainMenu.nib/designable.nib +++ b/Tools/xcodecapp-cocoa/English.lproj/MainMenu.nib/designable.nib @@ -2,26 +2,31 @@ 0 - 10J4138 - 1306 - 1038.35 + 10K540 + 1305 + 1038.36 461.00 com.apple.InterfaceBuilder.CocoaPlugin - 1306 + 1305 YES - NSTextField - NSView - NSWindowTemplate - NSMenu + NSScroller + NSTableHeaderView NSMenuItem + NSMenu NSTextFieldCell - NSProgressIndicator + NSScrollView NSButtonCell NSButton + NSProgressIndicator + NSTableView NSCustomObject + NSView + NSWindowTemplate + NSTextField + NSTableColumn YES @@ -807,7 +812,7 @@ 6 System controlColor - + 3 MC42NjY2NjY2NjY3AA @@ -816,7 +821,7 @@ 6 System controlTextColor - + 3 MAA @@ -951,7 +956,7 @@ -2080244224 134217728 - + LucidaGrande 13 1044 @@ -984,7 +989,7 @@ - {{0, 0}, {1680, 1028}} + {{0, 0}, {1440, 878}} {402, 400} {402, 400} @@ -1002,7 +1007,7 @@ {348, 62} {348, 62} - + 256 YES @@ -1011,6 +1016,7 @@ 274 {{17, -86}, {314, 128}} + YES 67239424 @@ -1023,7 +1029,7 @@ - + 3 MQA @@ -1031,9 +1037,10 @@ {{7, 11}, {348, 62}} + - {{0, 0}, {1680, 1028}} + {{0, 0}, {1440, 878}} {348, 81} {348, 81} @@ -1116,6 +1123,205 @@ + + 31 + 2 + {{196, 240}, {427, 233}} + 611844096 + Warnings and Errors + NSPanel + + + + 256 + + YES + + + 274 + + YES + + + 2304 + + YES + + + 256 + {427, 181} + + + YES + + + 256 + {427, 17} + + + + + + + -2147483392 + {{413, 0}, {16, 17}} + + + + + YES + + error + 424 + 40 + 1000 + + 75628096 + 2048 + Error + + LucidaGrande + 11 + 3100 + + + 3 + MC4zMzMzMzI5ODU2AA + + + 6 + System + headerTextColor + + + + + 337772032 + 0 + Text Cell + + + + 6 + System + controlBackgroundColor + + + + + 3 + YES + + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + -692060160 + + + 2 + 4 + 15 + 0 + YES + 0 + + + {{1, 17}, {427, 181}} + + + + + 4 + + + + -2147483392 + {{413, 17}, {15, 166}} + + + + _doScroller: + 0.91712707182320441 + + + + -2147483392 + {{1, 183}, {427, 15}} + + + 1 + + _doScroller: + 0.99302325581395345 + + + + 2304 + + YES + + + {{1, 0}, {427, 17}} + + + + + 4 + + + + {{-1, 35}, {429, 199}} + + + 562 + + + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 293 + {{136, 8}, {154, 19}} + + + YES + + -2080244224 + 134217728 + Clear Errors + + + -2038152961 + 164 + + + 400 + 75 + + + + {{7, 11}, {427, 233}} + + + + {{0, 0}, {1440, 878}} + {1e+13, 1e+13} + @@ -1608,6 +1814,46 @@ 463 + + + errorsPanel + + + + 475 + + + + errorsTable + + + + 476 + + + + dataSource + + + + 477 + + + + delegate + + + + 478 + + + + clearErrors: + + + + 482 + @@ -2428,6 +2674,89 @@ + + 464 + + + YES + + + + + + 465 + + + YES + + + + + + + 466 + + + YES + + + + + + + + + 467 + + + + + 468 + + + + + 469 + + + + + 470 + + + YES + + + + + + 472 + + + YES + + + + + + 473 + + + + + 479 + + + YES + + + + + + 480 + + + @@ -2607,10 +2936,21 @@ 447.IBPluginDependency 448.IBPluginDependency 449.IBPluginDependency + 450.IBPluginDependency 451.IBPluginDependency 452.IBPluginDependency 456.IBPluginDependency 459.IBPluginDependency + 464.IBPluginDependency + 464.NSWindowTemplate.visibleAtLaunch + 465.IBPluginDependency + 466.IBPluginDependency + 467.IBPluginDependency + 468.IBPluginDependency + 469.IBPluginDependency + 470.IBPluginDependency + 479.IBPluginDependency + 480.IBPluginDependency 5.IBPluginDependency 5.ImportedFromIB2 56.IBPluginDependency @@ -2839,6 +3179,17 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2887,7 +3238,7 @@ - 463 + 484 0 diff --git a/Tools/xcodecapp-cocoa/English.lproj/MainMenu.nib/keyedobjects.nib b/Tools/xcodecapp-cocoa/English.lproj/MainMenu.nib/keyedobjects.nib index eb51213f8..b874a7fb8 100644 Binary files a/Tools/xcodecapp-cocoa/English.lproj/MainMenu.nib/keyedobjects.nib and b/Tools/xcodecapp-cocoa/English.lproj/MainMenu.nib/keyedobjects.nib differ