From 8d4d653044d09ece7e8f5e0ee08947cd9a7a614d Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 25 Sep 2007 21:11:54 +0000 Subject: [PATCH] for seeding peers overlay a check mark on progress bar --- Transmission.xcodeproj/project.pbxproj | 4 ++++ macosx/AboutWindowController.m | 3 +-- macosx/Images/CompleteCheck.png | Bin 0 -> 382 bytes macosx/PeerProgressIndicatorCell.h | 1 + macosx/PeerProgressIndicatorCell.m | 15 +++++++++++++++ 5 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 macosx/Images/CompleteCheck.png diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index d98114d52..7324f7e6f 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -131,6 +131,7 @@ A2AA579D0ADFCAB400CA59F6 /* PiecesView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2AA579B0ADFCAB400CA59F6 /* PiecesView.m */; }; A2AE68330C628A35008753C9 /* Creator.nib in Resources */ = {isa = PBXBuildFile; fileRef = A2AE68310C628A35008753C9 /* Creator.nib */; }; A2AF1C390A3D0F6200F1575D /* FileOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2AF1C370A3D0F6200F1575D /* FileOutlineView.m */; }; + A2BC19850CA9AF5A00DD302A /* CompleteCheck.png in Resources */ = {isa = PBXBuildFile; fileRef = A2BC19840CA9AF5A00DD302A /* CompleteCheck.png */; }; A2BE9C520C1E4AF5002D16E6 /* makemeta.c in Sources */ = {isa = PBXBuildFile; fileRef = A2BE9C4E0C1E4ADA002D16E6 /* makemeta.c */; }; A2BE9C530C1E4AF7002D16E6 /* makemeta.h in Headers */ = {isa = PBXBuildFile; fileRef = A2BE9C4F0C1E4ADA002D16E6 /* makemeta.h */; }; A2BF07910B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = A2BF078F0B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.m */; }; @@ -478,6 +479,7 @@ A2AE68390C628A66008753C9 /* Greek */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Greek; path = macosx/Greek.lproj/Creator.nib; sourceTree = ""; }; A2AF1C360A3D0F6200F1575D /* FileOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FileOutlineView.h; path = macosx/FileOutlineView.h; sourceTree = ""; }; A2AF1C370A3D0F6200F1575D /* FileOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = FileOutlineView.m; path = macosx/FileOutlineView.m; sourceTree = ""; }; + A2BC19840CA9AF5A00DD302A /* CompleteCheck.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CompleteCheck.png; path = macosx/Images/CompleteCheck.png; sourceTree = ""; }; A2BE9C4E0C1E4ADA002D16E6 /* makemeta.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = makemeta.c; path = libtransmission/makemeta.c; sourceTree = ""; }; A2BE9C4F0C1E4ADA002D16E6 /* makemeta.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = makemeta.h; path = libtransmission/makemeta.h; sourceTree = ""; }; A2BF078E0B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SpeedLimitToTurtleIconTransformer.h; path = macosx/SpeedLimitToTurtleIconTransformer.h; sourceTree = ""; }; @@ -772,6 +774,7 @@ A2D4F0840A915F7200890C32 /* GreenDot.tiff */, A2D4F0820A915F6600890C32 /* RedDot.tiff */, A2EF7DEB0C96297400FA9811 /* PurpleDot.png */, + A2BC19840CA9AF5A00DD302A /* CompleteCheck.png */, A20AB97A0A5C622A004F81FA /* SmallTurtle.png */, A2D0E0480A54A97C003C72CF /* Bandwidth.png */, A21DFF0F0A292B2B007C5F76 /* Transfers.png */, @@ -1346,6 +1349,7 @@ A2041D530C9AC523000ACFFB /* Lock.tiff in Resources */, A24872B60C9B6BB9000F5B92 /* Advanced.png in Resources */, A2A6E3A00CA7E4C900F10FEF /* AboutWindow.nib in Resources */, + A2BC19850CA9AF5A00DD302A /* CompleteCheck.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/macosx/AboutWindowController.m b/macosx/AboutWindowController.m index 220deb19c..18f6080a2 100644 --- a/macosx/AboutWindowController.m +++ b/macosx/AboutWindowController.m @@ -69,10 +69,9 @@ AboutWindowController * fAboutBoxInstance = nil; fAboutBoxInstance = nil; } -#warning localize OK button - (IBAction) showLicense: (id) sender { - [fLicenseView setString: [NSString stringWithContentsOfFile: [[NSBundle mainBundle] pathForResource: @"LICENSE" ofType: nil]]]; + [fLicenseView setString: [NSString stringWithContentsOfFile: [[NSBundle mainBundle] pathForResource: @"LICENSE" ofType: nil]]]; [fLicenseCloseButton setTitle: NSLocalizedString(@"OK", "About window -> license close button")]; [NSApp beginSheet: fLicenseSheet modalForWindow: [self window] modalDelegate: nil didEndSelector: nil contextInfo: nil]; diff --git a/macosx/Images/CompleteCheck.png b/macosx/Images/CompleteCheck.png new file mode 100644 index 0000000000000000000000000000000000000000..f84e1886ab35e761473ffdb6bf26eb6f9265974c GIT binary patch literal 382 zcmV-^0fGLBP)<$p02jZhZ{01bz0+rDC$M7$7`pa2?J3s7}xcdE?5J*s)Q|q0(fa{A)@wD|!3{0zm zLN^$JHi!TfXO=#!ikbI%ff@rAkR+OLt6RQp2~g8?kPX%#ld&ld7Ybmo< c8UO(X0GzsyHw`KuRsaA107*qoM6N<$f>6SrZU6uP literal 0 HcmV?d00001 diff --git a/macosx/PeerProgressIndicatorCell.h b/macosx/PeerProgressIndicatorCell.h index 89a86a95c..14e169623 100644 --- a/macosx/PeerProgressIndicatorCell.h +++ b/macosx/PeerProgressIndicatorCell.h @@ -27,5 +27,6 @@ @interface PeerProgressIndicatorCell : NSLevelIndicatorCell { BOOL fIsHidden; + NSImage * fCheckImage; } @end diff --git a/macosx/PeerProgressIndicatorCell.m b/macosx/PeerProgressIndicatorCell.m index 79046dae5..8e521fd3b 100644 --- a/macosx/PeerProgressIndicatorCell.m +++ b/macosx/PeerProgressIndicatorCell.m @@ -39,7 +39,22 @@ - (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView { if (!fIsHidden) + { [super drawWithFrame: cellFrame inView: controlView]; + if ([self floatValue] >= 1.0) + { + if (!fCheckImage) + { + fCheckImage = [NSImage imageNamed: @"CompleteCheck.png"]; + [fCheckImage setFlipped: YES]; + } + + NSSize imageSize = [fCheckImage size]; + NSRect rect = NSMakeRect(cellFrame.origin.x + (cellFrame.size.width - imageSize.width) * 0.5, + cellFrame.origin.y + (cellFrame.size.height - imageSize.height) * 0.5, imageSize.width, imageSize.height); + [fCheckImage drawInRect: rect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; + } + } } @end