diff --git a/macosx/English.lproj/MessageWindow.nib/info.nib b/macosx/English.lproj/MessageWindow.nib/info.nib index fceb34900..dbd8da9c3 100644 --- a/macosx/English.lproj/MessageWindow.nib/info.nib +++ b/macosx/English.lproj/MessageWindow.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 69 64 356 240 0 0 1152 842 + 25 72 356 240 0 0 1152 842 IBFramework Version 446.1 IBOpenObjects diff --git a/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib b/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib index 9a17fb40b..aeffe3668 100644 Binary files a/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib and b/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib differ diff --git a/macosx/MessageWindowController.m b/macosx/MessageWindowController.m index 461f7db69..066b3b4ae 100644 --- a/macosx/MessageWindowController.m +++ b/macosx/MessageWindowController.m @@ -98,7 +98,7 @@ void addMessage(int level, const char * message) NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSString * levelString; - + if (level == TR_MSG_ERR) levelString = @"ERR"; else if (level == TR_MSG_INF) @@ -109,7 +109,8 @@ void addMessage(int level, const char * message) levelString = @"???"; NSAttributedString * messageString = [[[NSAttributedString alloc] initWithString: - [NSString stringWithFormat: @"%@: %s\n", levelString, message]] autorelease]; + [NSString stringWithFormat: @"(%@ %@) %s\n", [[NSDate date] dateWithCalendarFormat: @"%Y-%m-%d %H:%M:%S.%F" + timeZone: nil], levelString, message]] autorelease]; [fLock lock]; [fBufferArray addObject: messageString]; @@ -123,24 +124,26 @@ void addMessage(int level, const char * message) if ([fBufferArray count] == 0) return; + [fLock lock]; + //keep scrolled to bottom if already at bottom or there is no scroll bar yet BOOL shouldScroll = NO; NSScroller * scroller = [fScrollView verticalScroller]; if ([scroller floatValue] == 1.0 || [scroller isHidden] || [scroller knobProportion] == 1.0) shouldScroll = YES; - [fLock lock]; - NSEnumerator * enumerator = [fBufferArray objectEnumerator]; NSAttributedString * messageString; while ((messageString = [enumerator nextObject])) [[fTextView textStorage] appendAttributedString: messageString]; [fBufferArray removeAllObjects]; - [fLock unlock]; + [fTextView setFont: [NSFont fontWithName: @"Monaco" size: 10]]; //find a way to set this permanently if (shouldScroll) [fTextView scrollRangeToVisible: NSMakeRange([[fTextView string] length], 0)]; + + [fLock unlock]; } - (void) changeLevel: (id) sender