diff --git a/macosx/English.lproj/MessageWindow.nib/classes.nib b/macosx/English.lproj/MessageWindow.nib/classes.nib index cd2b7772d..b517634be 100644 --- a/macosx/English.lproj/MessageWindow.nib/classes.nib +++ b/macosx/English.lproj/MessageWindow.nib/classes.nib @@ -6,6 +6,8 @@ CLASS = MessageWindowController; LANGUAGE = ObjC; OUTLETS = { + fDebugWarningField = NSTextField; + fDebugWarningIcon = NSImageView; fLevelButton = NSPopUpButton; fScrollView = NSScrollView; fTextView = NSTextView; diff --git a/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib b/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib index a0b5e65cb..1db4bbada 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/InfoWindowController.m b/macosx/InfoWindowController.m index 0cece2f82..f6943e0ae 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -63,7 +63,7 @@ fCheckImage = [NSImage imageNamed: @"NSMenuCheckmark"]; fTorrents = [[NSArray alloc] init]; - fPeers = [[NSMutableArray alloc] initWithCapacity: 6]; + fPeers = [[NSMutableArray alloc] initWithCapacity: 30]; fFiles = [[NSMutableArray alloc] initWithCapacity: 6]; [fFileTable setDoubleAction: @selector(revealFile:)]; diff --git a/macosx/MessageWindowController.h b/macosx/MessageWindowController.h index 465ea1cc4..3fb578ef1 100644 --- a/macosx/MessageWindowController.h +++ b/macosx/MessageWindowController.h @@ -35,6 +35,9 @@ NSDictionary * fAttributes; int fLines; + + IBOutlet NSTextField * fDebugWarningField; + IBOutlet NSImageView * fDebugWarningIcon; } - (void) updateLog: (NSTimer *) timer; diff --git a/macosx/MessageWindowController.m b/macosx/MessageWindowController.m index 898423463..56c0edebd 100644 --- a/macosx/MessageWindowController.m +++ b/macosx/MessageWindowController.m @@ -29,9 +29,15 @@ #define LEVEL_INFO 1 #define LEVEL_DEBUG 2 -#define UPDATE_SECONDS 0.35 +#define UPDATE_SECONDS 0.4 #define MAX_LINES 1000 +@interface MessageWindowController (Private) + +- (void) setDebugWarningHidden: (BOOL) hide; + +@end + @implementation MessageWindowController - (id) initWithWindowNibName: (NSString *) name @@ -80,6 +86,8 @@ [[NSUserDefaults standardUserDefaults] setInteger: level forKey: @"MessageLevel"]; } + [self setDebugWarningHidden: level != TR_MSG_DBG]; + tr_setMessageLevel(level); tr_setMessageQueuing(1); } @@ -115,8 +123,7 @@ //remove the first line if at max number of lines if (fLines == MAX_LINES) { - NSString * text = [fTextView string]; - unsigned int loc = [text rangeOfString: @"\n"].location; + unsigned int loc = [[fTextView string] rangeOfString: @"\n"].location; if (loc != NSNotFound) [[fTextView textStorage] deleteCharactersInRange: NSMakeRange(0, loc + 1)]; } @@ -145,6 +152,8 @@ else level = TR_MSG_ERR; + [self setDebugWarningHidden: level != TR_MSG_DBG]; + tr_setMessageLevel(level); [[NSUserDefaults standardUserDefaults] setInteger: level forKey: @"MessageLevel"]; } @@ -187,4 +196,10 @@ [string release]; } +- (void) setDebugWarningHidden: (BOOL) hide +{ + [fDebugWarningField setHidden: hide]; + [fDebugWarningIcon setHidden: hide]; +} + @end diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 20a9d9af7..208af37e2 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -436,8 +436,7 @@ - (NSString *) torrentLocationString { - return fPrivateTorrent ? @"Transmission Support Folder" - : [fPublicTorrentLocation stringByAbbreviatingWithTildeInPath]; + return fPrivateTorrent ? @"Transmission Support Folder" : [fPublicTorrentLocation stringByAbbreviatingWithTildeInPath]; } - (NSString *) dataLocation @@ -530,7 +529,6 @@ for (i = 0; i < totalPeers; i++) { peer = peers[i]; - [peerDics addObject: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool: peer.isConnected], @"Connected", [NSString stringWithCString: (char *) peer.addr encoding: NSUTF8StringEncoding], @"IP", @@ -640,8 +638,8 @@ for (i = 0; i < count; i++) { file = fInfo->files[i]; - [files addObject: [NSDictionary dictionaryWithObjectsAndKeys: [[self downloadFolder] - stringByAppendingPathComponent: [NSString stringWithUTF8String: file.name]], @"Name", + [files addObject: [NSDictionary dictionaryWithObjectsAndKeys: + [[self downloadFolder] stringByAppendingPathComponent: [NSString stringWithUTF8String: file.name]], @"Name", [NSNumber numberWithUnsignedLongLong: file.length], @"Size", nil]]; } diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index b78171c88..0a82f9809 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -90,12 +90,18 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 fProgressEndGreen = [NSImage imageNamed: @"ProgressBarEndGreen.png"]; fProgressEndAdvanced = [NSImage imageNamed: @"ProgressBarEndAdvanced.png"]; - fErrorImage = [NSImage imageNamed: @"Error.tiff"]; + fErrorImage = [[NSImage imageNamed: @"Error.tiff"] copy]; [fErrorImage setFlipped: YES]; } return self; } +- (void) dealloc +{ + [fErrorImage release]; + [super dealloc]; +} + - (void) setTorrent: (Torrent *) torrent { fTorrent = torrent;