From 9d5affb0b7db65a1d142fd374122fc5c4591cffe Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 17 Jun 2008 17:17:15 +0000 Subject: [PATCH] some cleaning --- macosx/English.lproj/PrefsWindow.xib | 28 ++++++++++++++++++++++++-- macosx/PiecesView.m | 30 ++++++++++++++-------------- macosx/PrefsController.m | 1 - macosx/Torrent.m | 5 +++-- macosx/TorrentTableView.m | 3 +-- 5 files changed, 45 insertions(+), 22 deletions(-) diff --git a/macosx/English.lproj/PrefsWindow.xib b/macosx/English.lproj/PrefsWindow.xib index 21e1d3079..0636d3615 100644 --- a/macosx/English.lproj/PrefsWindow.xib +++ b/macosx/English.lproj/PrefsWindow.xib @@ -8,8 +8,8 @@ 352.00 YES - + YES @@ -3544,6 +3544,10 @@ AAABAAAAAQ NSResponder + + YES + Proxy + YES @@ -5921,6 +5925,26 @@ AAABAAAAAQ 1674 + + + textColor: values + + + + + + textColor: values + textColor + values + + NSValueTransformerName + ControlTextTransformer + + 2 + + + 1680 + @@ -8974,7 +8998,7 @@ AAABAAAAAQ - 1674 + 1685 diff --git a/macosx/PiecesView.m b/macosx/PiecesView.m index 4d6c9995e..ae9f505b5 100644 --- a/macosx/PiecesView.m +++ b/macosx/PiecesView.m @@ -41,21 +41,21 @@ - (void) awakeFromNib { - //back image - fBack = [[NSImage alloc] initWithSize: [self bounds].size]; - - [fBack lockFocus]; - CTGradient * gradient = [CTGradient gradientWithBeginningColor: [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.4] - endingColor: [NSColor colorWithCalibratedWhite: 0.2 alpha: 0.4]]; - [gradient fillRect: [self bounds] angle: 90.0]; - [fBack unlockFocus]; - - //store box colors - fGreenAvailabilityColor = [[NSColor colorWithCalibratedRed: 0.0 green: 1.0 blue: 0.4 alpha: 1.0] retain]; - fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0] retain]; - - //actually draw the box - [self setTorrent: nil]; + //back image + fBack = [[NSImage alloc] initWithSize: [self bounds].size]; + + [fBack lockFocus]; + CTGradient * gradient = [CTGradient gradientWithBeginningColor: [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.4] + endingColor: [NSColor colorWithCalibratedWhite: 0.2 alpha: 0.4]]; + [gradient fillRect: [self bounds] angle: 90.0]; + [fBack unlockFocus]; + + //store box colors + fGreenAvailabilityColor = [[NSColor colorWithCalibratedRed: 0.0 green: 1.0 blue: 0.4 alpha: 1.0] retain]; + fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0] retain]; + + //actually draw the box + [self setTorrent: nil]; } - (void) dealloc diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m index cea0c8014..bad52b686 100644 --- a/macosx/PrefsController.m +++ b/macosx/PrefsController.m @@ -688,7 +688,6 @@ - (void) setProxyEnabled: (id) sender { - BOOL enable = [fDefaults boolForKey: @"Proxy"]; tr_sessionSetProxyEnabled(fHandle, [fDefaults boolForKey: @"Proxy"]); } diff --git a/macosx/Torrent.m b/macosx/Torrent.m index cc8af6da0..d0652170c 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -415,8 +415,9 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void * - (void) setMaxPeerConnect: (uint16_t) count { - if (count > 0) - tr_torrentSetPeerLimit(fHandle, count); + NSAssert(count > 0, @"max peer count must be greater than 0"); + + tr_torrentSetPeerLimit(fHandle, count); } - (uint16_t) maxPeerConnect diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index acad3c076..026bc9a47 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -529,8 +529,7 @@ { unichar firstChar = [[event charactersIgnoringModifiers] characterAtIndex: 0]; - if (firstChar == 'f' && [event modifierFlags] & NSAlternateKeyMask - && [event modifierFlags] & NSCommandKeyMask) + if (firstChar == 'f' && [event modifierFlags] & NSAlternateKeyMask && [event modifierFlags] & NSCommandKeyMask) [fController focusFilterField]; else { -- 2.40.0