From 60ac9748a147127b4dc19ac056a95a43c15ada6d Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 22 Aug 2006 01:59:46 +0000 Subject: [PATCH] Larger default message window, font matching default Console look, and show date (in same format as Console). --- .../English.lproj/MessageWindow.nib/info.nib | 2 +- .../MessageWindow.nib/keyedobjects.nib | Bin 7465 -> 7465 bytes macosx/MessageWindowController.m | 13 ++++++++----- 3 files changed, 9 insertions(+), 6 deletions(-) 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 9a17fb40bb75923c79997a3c892e9daf23660186..aeffe3668010f577b4b020b6729194f6d340eb72 100644 GIT binary patch delta 505 zcmZ2!wbE)sA)^7~J|+#uO-!v!ZA|S<9Za1}T?`FO-AsK<6PcDW?PS`;w3}%U(_V%& zrhQENnGP^s-Mo1Hp1Y0MmO zoiBv_7&REB8ILpSGwLxOW8!4uVkl;0W(aC9ZHQLDSz)%d7iv+4S1*(q(vzUPD8!j=}F^DncFh#GzFx>!XKDy~lK=ZGN znkhvFs_7hWyVsK~T1lk|O;LXSk@dJYg z&<|V;J`BYSUW|GSo(-Hp*8@#%s0O+b;v;>a3o{yOfiA2B`mPM-&Sgx|>jeavmNTtj zc)_%4@)UT=FmW;zGfFcuGXyanV?55N$Hc{`-;mm1-eB5b(7@FY*$~m-(U8#)JULEO zI{Fw`r2$ZfK2WtZ2m@7sR5Af|1cTWie#0dOI|ebP9H!`1VDp(73^2?G=|MLCil`Y+ zv|q4qYF?>lNoua)WF0XjvB-e@g3tn=%;FLxDWl1LVk%LL$Cx;oxEKt;PV#2dXYgQf z2U>ERp_svoQIElg!4v45RG`zDzz(biI#0iW6KG`w(5aO`Pt`V*!5q4bDSEwtAk%WD z6-+A`UQ9kCCeJ*jL1XeeFd0WJYf0S*B{0d@fq0bT*I%_`!4tej$E QDq`AV7Gh45t7X;!01%~#A^-pY 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