Changeset 842


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

Display a warning when in debug mode.

Location:
trunk/macosx
Files:
7 edited

Legend:

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

    r828 r842  
    77            LANGUAGE = ObjC;
    88            OUTLETS = {
     9                fDebugWarningField = NSTextField;
     10                fDebugWarningIcon = NSImageView;
    911                fLevelButton = NSPopUpButton;
    1012                fScrollView = NSScrollView;
  • trunk/macosx/InfoWindowController.m

    r841 r842  
    6464   
    6565    fTorrents = [[NSArray alloc] init];
    66     fPeers = [[NSMutableArray alloc] initWithCapacity: 6];
     66    fPeers = [[NSMutableArray alloc] initWithCapacity: 30];
    6767    fFiles = [[NSMutableArray alloc] initWithCapacity: 6];
    6868    [fFileTable setDoubleAction: @selector(revealFile:)];
  • trunk/macosx/MessageWindowController.h

    r829 r842  
    3636   
    3737    int fLines;
     38   
     39    IBOutlet NSTextField * fDebugWarningField;
     40    IBOutlet NSImageView * fDebugWarningIcon;
    3841}
    3942
  • 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
  • trunk/macosx/Torrent.m

    r835 r842  
    437437- (NSString *) torrentLocationString
    438438{
    439     return fPrivateTorrent ? @"Transmission Support Folder"
    440             : [fPublicTorrentLocation stringByAbbreviatingWithTildeInPath];
     439    return fPrivateTorrent ? @"Transmission Support Folder" : [fPublicTorrentLocation stringByAbbreviatingWithTildeInPath];
    441440}
    442441
     
    531530    {
    532531        peer = peers[i];
    533        
    534532        [peerDics addObject: [NSDictionary dictionaryWithObjectsAndKeys:
    535533            [NSNumber numberWithBool: peer.isConnected], @"Connected",
     
    641639    {
    642640        file = fInfo->files[i];
    643         [files addObject: [NSDictionary dictionaryWithObjectsAndKeys: [[self downloadFolder]
    644             stringByAppendingPathComponent: [NSString stringWithUTF8String: file.name]], @"Name",
     641        [files addObject: [NSDictionary dictionaryWithObjectsAndKeys:
     642            [[self downloadFolder] stringByAppendingPathComponent: [NSString stringWithUTF8String: file.name]], @"Name",
    645643            [NSNumber numberWithUnsignedLongLong: file.length], @"Size", nil]];
    646644    }
  • trunk/macosx/TorrentCell.m

    r839 r842  
    9191        fProgressEndAdvanced = [NSImage imageNamed: @"ProgressBarEndAdvanced.png"];
    9292       
    93         fErrorImage = [NSImage imageNamed: @"Error.tiff"];
     93        fErrorImage = [[NSImage imageNamed: @"Error.tiff"] copy];
    9494        [fErrorImage setFlipped: YES];
    9595    }
    9696    return self;
     97}
     98
     99- (void) dealloc
     100{
     101    [fErrorImage release];
     102    [super dealloc];
    97103}
    98104
Note: See TracChangeset for help on using the changeset viewer.