Changeset 6252
- Timestamp:
- Jun 25, 2008, 5:01:04 AM (14 years ago)
- Location:
- trunk/macosx
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/CTGradient/CTGradientAdditions.m
r6250 r6252 66 66 } 67 67 68 CTGradient * fProgressWhiteGradient = nil; 68 69 + (CTGradient *)progressWhiteGradient 69 70 { 70 return [[self class] progressGradientForRed: 0.95 green: 0.95 blue: 0.95]; 71 if (!fProgressWhiteGradient) 72 fProgressWhiteGradient = [[[self class] progressGradientForRed: 0.95 green: 0.95 blue: 0.95] retain]; 73 return fProgressWhiteGradient; 71 74 } 72 75 76 CTGradient * fProgressGrayGradient = nil; 73 77 + (CTGradient *)progressGrayGradient 74 78 { 75 return [[self class] progressGradientForRed: 0.7 green: 0.7 blue: 0.7]; 79 if (!fProgressGrayGradient) 80 fProgressGrayGradient = [[[self class] progressGradientForRed: 0.7 green: 0.7 blue: 0.7] retain]; 81 return fProgressGrayGradient; 76 82 } 77 83 84 CTGradient * fProgressLightGrayGradient = nil; 78 85 + (CTGradient *)progressLightGrayGradient 79 86 { 80 return [[self class] progressGradientForRed: 0.87 green: 0.87 blue: 0.87]; 87 if (!fProgressLightGrayGradient) 88 fProgressLightGrayGradient = [[[self class] progressGradientForRed: 0.87 green: 0.87 blue: 0.87] retain]; 89 return fProgressLightGrayGradient; 81 90 } 82 91 92 CTGradient * fProgressBlueGradient = nil; 83 93 + (CTGradient *)progressBlueGradient 84 94 { 85 return [[self class] progressGradientForRed: 0.373 green: 0.698 blue: 0.972]; 95 if (!fProgressBlueGradient) 96 fProgressBlueGradient = [[[self class] progressGradientForRed: 0.373 green: 0.698 blue: 0.972] retain]; 97 return fProgressBlueGradient; 86 98 } 87 99 100 CTGradient * fProgressDarkBlueGradient = nil; 88 101 + (CTGradient *)progressDarkBlueGradient 89 102 { 90 return [[self class] progressGradientForRed: 0.616 green: 0.722 blue: 0.776]; 103 if (!fProgressDarkBlueGradient) 104 fProgressDarkBlueGradient = [[[self class] progressGradientForRed: 0.616 green: 0.722 blue: 0.776] retain]; 105 return fProgressDarkBlueGradient; 91 106 } 92 107 108 CTGradient * fProgressGreenGradient = nil; 93 109 + (CTGradient *)progressGreenGradient 94 110 { 95 return [[self class] progressGradientForRed: 0.384 green: 0.847 blue: 0.310]; 111 if (!fProgressGreenGradient) 112 fProgressGreenGradient = [[[self class] progressGradientForRed: 0.384 green: 0.847 blue: 0.310] retain]; 113 return fProgressGreenGradient; 96 114 } 97 115 116 CTGradient * fProgressLightGreenGradient = nil; 98 117 + (CTGradient *)progressLightGreenGradient 99 118 { 100 return [[self class] progressGradientForRed: 0.780 green: 0.894 blue: 0.729]; 119 if (!fProgressLightGreenGradient) 120 fProgressLightGreenGradient = [[[self class] progressGradientForRed: 0.780 green: 0.894 blue: 0.729] retain]; 121 return fProgressLightGreenGradient; 101 122 } 102 123 124 CTGradient * fProgressDarkGreenGradient = nil; 103 125 + (CTGradient *)progressDarkGreenGradient 104 126 { 105 return [[self class] progressGradientForRed: 0.627 green: 0.714 blue: 0.639]; 127 if (!fProgressDarkGreenGradient) 128 fProgressDarkGreenGradient = [[[self class] progressGradientForRed: 0.627 green: 0.714 blue: 0.639] retain]; 129 return fProgressDarkGreenGradient; 106 130 } 107 131 132 CTGradient * fProgressRedGradient = nil; 108 133 + (CTGradient *)progressRedGradient 109 134 { 110 return [[self class] progressGradientForRed: 0.902 green: 0.439 blue: 0.451]; 135 if (!fProgressRedGradient) 136 fProgressRedGradient = [[[self class] progressGradientForRed: 0.902 green: 0.439 blue: 0.451] retain]; 137 return fProgressRedGradient; 111 138 } 112 139 140 CTGradient * fProgressYellowGradient = nil; 113 141 + (CTGradient *)progressYellowGradient 114 142 { 115 return [[self class] progressGradientForRed: 0.933 green: 0.890 blue: 0.243]; 143 if (!fProgressYellowGradient) 144 fProgressYellowGradient = [[[self class] progressGradientForRed: 0.933 green: 0.890 blue: 0.243] retain]; 145 return fProgressYellowGradient; 116 146 } 117 147 -
trunk/macosx/English.lproj/Localizable.strings
r6150 r6252 126 126 /* Folder cannot be used alert -> message */ 127 127 "\"%@\" cannot be used. The transfer will be paused." = "\"%@\" cannot be used. The transfer will be paused."; 128 129 /* Open invalid alert -> title */ 130 "\"%@\" is not a valid torrent file." = "\"%@\" is not a valid torrent file."; 128 131 129 132 /* Prefs -> blocklist -> message */ … … 263 266 "Create a Torrent File" = "Create a Torrent File"; 264 267 265 /* Create toolbar item -> tooltip */266 "Create torrent file" = "Create torrent file";267 268 268 /* Create torrent -> select file 269 269 Create toolbar item -> palette label */ 270 270 "Create Torrent File" = "Create Torrent File"; 271 272 /* Create toolbar item -> tooltip */ 273 "Create torrent file" = "Create torrent file"; 271 274 272 275 /* Create torrent -> failed -> title */ … … 490 493 Create torrent -> no files -> button 491 494 Download not a torrent -> button 495 Open invalid alert -> button 492 496 About window -> license close button 493 497 Blocklist -> button … … 513 517 "Open Torrent Address" = "Open Torrent Address"; 514 518 519 /* Open toolbar item -> tooltip */ 520 "Open torrent files" = "Open torrent files"; 521 515 522 /* Open toolbar item -> palette label */ 516 523 "Open Torrent Files" = "Open Torrent Files"; 517 518 /* Open toolbar item -> tooltip */519 "Open torrent files" = "Open torrent files";520 524 521 525 /* Open address toolbar item -> tooltip */ … … 784 788 "The torrent file (%@) cannot be found." = "The torrent file (%@) cannot be found."; 785 789 790 /* Open invalid alert -> message */ 791 "The torrent file cannot be opened because it contains invalid data." = "The torrent file cannot be opened because it contains invalid data."; 792 786 793 /* Open duplicate alert -> message */ 787 794 "The torrent file cannot be opened because it is a duplicate of an already added transfer." = "The torrent file cannot be opened because it is a duplicate of an already added transfer."; … … 881 888 "Transmission is already running." = "Transmission is already running."; 882 889 883 /* Torrent -> location when deleting original*/890 /* Inspector -> torrent location */ 884 891 "Transmission Support Folder" = "Transmission Support Folder"; 885 892 -
trunk/macosx/InfoWindowController.m
r6246 r6252 1103 1103 { 1104 1104 FileOutlineView * fileOutlineView = [fFileController outlineView]; 1105 Torrent * torrent = [fTorrents objectAtIndex: 0];1106 1105 NSIndexSet * indexes = [fileOutlineView selectedRowIndexes]; 1107 1106 1108 1107 int i; 1109 1108 for (i = [indexes firstIndex]; i != NSNotFound; i = [indexes indexGreaterThanIndex: i]) -
trunk/macosx/NSStringAdditions.h
r5117 r6252 37 37 38 38 + (NSString *) timeString: (uint64_t) seconds showSeconds: (BOOL) showSeconds; 39 + (NSString *) timeString: (NSUInteger) seconds showSeconds: (BOOL) showSeconds max Digits: (NSUInteger) max;39 + (NSString *) timeString: (NSUInteger) seconds showSeconds: (BOOL) showSeconds maxFields: (NSUInteger) max; 40 40 41 41 - (NSComparisonResult) compareIP: (NSString *) string; -
trunk/macosx/NSStringAdditions.m
r5556 r6252 109 109 + (NSString *) timeString: (uint64_t) seconds showSeconds: (BOOL) showSeconds 110 110 { 111 return [NSString timeString: seconds showSeconds: showSeconds max Digits: UINT_MAX];111 return [NSString timeString: seconds showSeconds: showSeconds maxFields: UINT_MAX]; 112 112 } 113 113 114 + (NSString *) timeString: (NSUInteger) seconds showSeconds: (BOOL) showSeconds max Digits: (NSUInteger) max114 + (NSString *) timeString: (NSUInteger) seconds showSeconds: (BOOL) showSeconds maxFields: (NSUInteger) max 115 115 { 116 116 NSMutableArray * timeArray = [NSMutableArray arrayWithCapacity: MIN(max, 4)]; -
trunk/macosx/PortChecker.m
r4423 r6252 41 41 42 42 fTimer = [NSTimer scheduledTimerWithTimeInterval: CHECK_FIRE target: self selector: @selector(startProbe) 43 43 userInfo: nil repeats: NO]; 44 44 } 45 45 … … 125 125 { 126 126 NSString * portStatus = [[[[nodes objectAtIndex: 0] stringValue] stringByTrimmingCharactersInSet: 127 127 [[NSCharacterSet letterCharacterSet] invertedSet]] lowercaseString]; 128 128 129 129 if ([portStatus isEqualToString: @"open"]) … … 141 141 else 142 142 { 143 144 143 NSLog(@"Unable to get port status: invalid response"); 144 [self callBackWithStatus: PORT_STATUS_ERROR]; 145 145 } 146 146 [shieldsUpProbe release]; -
trunk/macosx/Torrent.m
r6247 r6252 1923 1923 default: 1924 1924 return [NSString stringWithFormat: NSLocalizedString(@"%@ remaining", "Torrent -> eta string"), 1925 [NSString timeString: eta showSeconds: YES max Digits: 2]];1925 [NSString timeString: eta showSeconds: YES maxFields: 2]]; 1926 1926 } 1927 1927 } -
trunk/macosx/TorrentCell.h
r6125 r6252 35 35 fHoverControl, fHoverReveal, fHoverAction; 36 36 37 NSColor * fBarBorderColor; 38 CTGradient * fWhiteGradient, * fGrayGradient, * fLightGrayGradient, * fBlueGradient, * fDarkBlueGradient, 39 * fGreenGradient, * fLightGreenGradient, * fDarkGreenGradient, * fYellowGradient, * fRedGradient; 40 41 NSColor * fBluePieceColor; 37 NSColor * fBarBorderColor, * fBluePieceColor; 42 38 } 43 39 -
trunk/macosx/TorrentCell.m
r6248 r6252 105 105 } 106 106 107 - (id) copyWithZone: (NSZone *) zone108 {109 TorrentCell * copy = [super copyWithZone: zone];110 111 copy->fGrayGradient = [fGrayGradient retain];112 copy->fLightGrayGradient = [fLightGrayGradient retain];113 copy->fBlueGradient = [fBlueGradient retain];114 copy->fDarkBlueGradient = [fDarkBlueGradient retain];115 copy->fGreenGradient = [fGreenGradient retain];116 copy->fLightGreenGradient = [fLightGreenGradient retain];117 copy->fDarkGreenGradient = [fDarkGreenGradient retain];118 copy->fYellowGradient = [fYellowGradient retain];119 copy->fRedGradient = [fRedGradient retain];120 121 return copy;122 }123 124 - (void) dealloc125 {126 [fGrayGradient release];127 [fLightGrayGradient release];128 [fBlueGradient release];129 [fDarkBlueGradient release];130 [fGreenGradient release];131 [fLightGreenGradient release];132 [fDarkGreenGradient release];133 [fYellowGradient release];134 [fRedGradient release];135 136 [super dealloc];137 }138 139 107 - (NSRect) iconRectForBounds: (NSRect) bounds 140 108 { … … 621 589 noIncludeRect.size.width = rightNoIncludeWidth; 622 590 623 if (!fLightGrayGradient) 624 fLightGrayGradient = [[CTGradient progressLightGrayGradient] retain]; 625 [fLightGrayGradient fillRect: noIncludeRect angle: 90]; 591 [[CTGradient progressLightGrayGradient] fillRect: noIncludeRect angle: 90]; 626 592 } 627 593 … … 640 606 notAvailableRect.size.width = notAvailableWidth; 641 607 642 if (!fRedGradient) 643 fRedGradient = [[CTGradient progressRedGradient] retain]; 644 [fRedGradient fillRect: notAvailableRect angle: 90]; 608 [[CTGradient progressRedGradient] fillRect: notAvailableRect angle: 90]; 645 609 } 646 610 } … … 652 616 includeRect.size.width = rightWidth; 653 617 654 if (!fWhiteGradient) 655 fWhiteGradient = [[CTGradient progressWhiteGradient] retain]; 656 [fWhiteGradient fillRect: includeRect angle: 90]; 618 [[CTGradient progressWhiteGradient] fillRect: includeRect angle: 90]; 657 619 } 658 620 } … … 667 629 { 668 630 if ([torrent isChecking]) 669 { 670 if (!fYellowGradient) 671 fYellowGradient = [[CTGradient progressYellowGradient] retain]; 672 [fYellowGradient fillRect: completeRect angle: 90]; 673 } 631 [[CTGradient progressYellowGradient] fillRect: completeRect angle: 90]; 674 632 else if ([torrent isSeeding]) 675 633 { … … 683 641 ratioLeftRect.size.width = ratioLeftWidth; 684 642 685 if (!fLightGreenGradient) 686 fLightGreenGradient = [[CTGradient progressLightGreenGradient] retain]; 687 [fLightGreenGradient fillRect: ratioLeftRect angle: 90]; 643 [[CTGradient progressLightGreenGradient] fillRect: ratioLeftRect angle: 90]; 688 644 } 689 645 … … 692 648 completeRect.size.width = leftWidth; 693 649 694 if (!fGreenGradient) 695 fGreenGradient = [[CTGradient progressGreenGradient] retain]; 696 [fGreenGradient fillRect: completeRect angle: 90]; 650 [[CTGradient progressGreenGradient] fillRect: completeRect angle: 90]; 697 651 } 698 652 } 699 653 else 700 { 701 if (!fBlueGradient) 702 fBlueGradient = [[CTGradient progressBlueGradient] retain]; 703 [fBlueGradient fillRect: completeRect angle: 90]; 704 } 654 [[CTGradient progressBlueGradient] fillRect: completeRect angle: 90]; 705 655 } 706 656 else … … 709 659 { 710 660 if ([torrent progressLeft] <= 0.0) 711 { 712 if (!fDarkGreenGradient) 713 fDarkGreenGradient = [[CTGradient progressDarkGreenGradient] retain]; 714 [fDarkGreenGradient fillRect: completeRect angle: 90]; 715 } 661 [[CTGradient progressDarkGreenGradient] fillRect: completeRect angle: 90]; 716 662 else 717 { 718 if (!fDarkBlueGradient) 719 fDarkBlueGradient = [[CTGradient progressDarkBlueGradient] retain]; 720 [fDarkBlueGradient fillRect: completeRect angle: 90]; 721 } 663 [[CTGradient progressDarkBlueGradient] fillRect: completeRect angle: 90]; 722 664 } 723 665 else 724 { 725 if (!fGrayGradient) 726 fGrayGradient = [[CTGradient progressGrayGradient] retain]; 727 [fGrayGradient fillRect: completeRect angle: 90]; 728 } 666 [[CTGradient progressGrayGradient] fillRect: completeRect angle: 90]; 729 667 } 730 668 }
Note: See TracChangeset
for help on using the changeset viewer.