Changeset 813


Ignore:
Timestamp:
Aug 22, 2006, 1:08:44 AM (15 years ago)
Author:
livings124
Message:

Empty (and display) buffer right away when changing message level, and update the log a little more often.

Location:
trunk/macosx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/English.lproj/MessageWindow.nib/classes.nib

    r807 r813  
    66            CLASS = MessageWindowController;
    77            LANGUAGE = ObjC;
    8             OUTLETS = {fLevelButton = NSPopUpButton; fTextView = NSTextView; };
     8            OUTLETS = {
     9                fLevelButton = NSPopUpButton;
     10                fScrollView = NSScrollView;
     11                fTextView = NSTextView;
     12            };
    913            SUPERCLASS = NSWindowController;
    1014        }
  • trunk/macosx/MessageWindowController.h

    r811 r813  
    2828{
    2929    IBOutlet NSTextView * fTextView;
     30    IBOutlet NSScrollView * fScrollView;
     31   
    3032    IBOutlet NSPopUpButton * fLevelButton;
    3133   
  • trunk/macosx/MessageWindowController.m

    r812 r813  
    3030#define LEVEL_DEBUG 2
    3131
    32 #define UPDATE_SECONDS 0.5
     32#define UPDATE_SECONDS 0.35
    3333
    3434@interface MessageWindowController (Private)
     
    124124        return;
    125125   
     126    //keep scrolled to bottom if already at bottom or there is no scroll bar yet
     127    BOOL shouldScroll = NO;
     128    NSScroller * scroller = [fScrollView verticalScroller];
     129    if ([scroller floatValue] == 1.0 || [scroller isHidden] || [scroller knobProportion] == 1.0)
     130        shouldScroll = YES;
     131   
    126132    [fLock lock];
    127133   
     
    130136    while ((messageString = [enumerator nextObject]))
    131137        [[fTextView textStorage] appendAttributedString: messageString];
    132    
    133138    [fBufferArray removeAllObjects];
    134139   
    135140    [fLock unlock];
     141   
     142    if (shouldScroll)
     143        [fTextView scrollRangeToVisible: NSMakeRange([[fTextView string] length], 0)];
    136144}
    137145
     
    145153    else
    146154        level = TR_MSG_ERR;
     155   
     156    [self updateLog: nil];
    147157   
    148158    tr_setMessageLevel(level);
Note: See TracChangeset for help on using the changeset viewer.