Ignore:
Timestamp:
Sep 3, 2006, 5:06:43 PM (15 years ago)
Author:
livings124
Message:

Display a warning when in debug mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.m

    r841 r842  
    3030#define LEVEL_DEBUG 2
    3131
    32 #define UPDATE_SECONDS  0.35
     32#define UPDATE_SECONDS  0.4
    3333#define MAX_LINES       1000
     34
     35@interface MessageWindowController (Private)
     36
     37- (void) setDebugWarningHidden: (BOOL) hide;
     38
     39@end
    3440
    3541@implementation MessageWindowController
     
    8086        [[NSUserDefaults standardUserDefaults] setInteger: level forKey: @"MessageLevel"];
    8187    }
     88   
     89    [self setDebugWarningHidden: level != TR_MSG_DBG];
    8290   
    8391    tr_setMessageLevel(level);
     
    116124        if (fLines == MAX_LINES)
    117125        {
    118             NSString * text = [fTextView string];
    119             unsigned int loc = [text rangeOfString: @"\n"].location;
     126            unsigned int loc = [[fTextView string] rangeOfString: @"\n"].location;
    120127            if (loc != NSNotFound)
    121128                [[fTextView textStorage] deleteCharactersInRange: NSMakeRange(0, loc + 1)];
     
    145152    else
    146153        level = TR_MSG_ERR;
     154   
     155    [self setDebugWarningHidden: level != TR_MSG_DBG];
    147156   
    148157    tr_setMessageLevel(level);
     
    188197}
    189198
     199- (void) setDebugWarningHidden: (BOOL) hide
     200{
     201    [fDebugWarningField setHidden: hide];
     202    [fDebugWarningIcon setHidden: hide];
     203}
     204
    190205@end
Note: See TracChangeset for help on using the changeset viewer.