Changeset 3886
- Timestamp:
- Nov 19, 2007, 6:13:41 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Transmission.xcodeproj/project.pbxproj
r3858 r3886 99 99 A256588D0A9A695400E8A03B /* MessageWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A256588B0A9A695400E8A03B /* MessageWindowController.m */; }; 100 100 A257C1820CAD3003004E121C /* PeerTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A257C1800CAD3003004E121C /* PeerTableView.m */; }; 101 A25892640CF1F7E800CCCDDF /* StatsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A25892630CF1F7E800CCCDDF /* StatsWindowController.m */; }; 102 A25892770CF1FCE800CCCDDF /* StatsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A25892750CF1FCE800CCCDDF /* StatsWindow.xib */; }; 101 103 A259317E0A73B2CC002F4FE7 /* TransmissionHelp in Resources */ = {isa = PBXBuildFile; fileRef = A259316A0A73B2CC002F4FE7 /* TransmissionHelp */; }; 102 104 A25E74650AF5097C006F11AE /* ExpandedPathToPathTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = A25E74440AF5089E006F11AE /* ExpandedPathToPathTransformer.m */; }; … … 443 445 A257C17F0CAD3003004E121C /* PeerTableView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PeerTableView.h; path = macosx/PeerTableView.h; sourceTree = "<group>"; }; 444 446 A257C1800CAD3003004E121C /* PeerTableView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PeerTableView.m; path = macosx/PeerTableView.m; sourceTree = "<group>"; }; 447 A25892620CF1F7E800CCCDDF /* StatsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StatsWindowController.h; path = macosx/StatsWindowController.h; sourceTree = "<group>"; }; 448 A25892630CF1F7E800CCCDDF /* StatsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StatsWindowController.m; path = macosx/StatsWindowController.m; sourceTree = "<group>"; }; 449 A25892760CF1FCE800CCCDDF /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = macosx/English.lproj/StatsWindow.xib; sourceTree = "<group>"; }; 445 450 A259316A0A73B2CC002F4FE7 /* TransmissionHelp */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TransmissionHelp; path = macosx/TransmissionHelp; sourceTree = "<group>"; }; 446 451 A25E74440AF5089E006F11AE /* ExpandedPathToPathTransformer.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ExpandedPathToPathTransformer.m; path = macosx/ExpandedPathToPathTransformer.m; sourceTree = "<group>"; }; … … 750 755 A2DF37040C220D03006523C1 /* CreatorWindowController.h */, 751 756 A2DF37050C220D03006523C1 /* CreatorWindowController.m */, 757 A25892620CF1F7E800CCCDDF /* StatsWindowController.h */, 758 A25892630CF1F7E800CCCDDF /* StatsWindowController.m */, 752 759 A2085DD90C53BC74000BC3B7 /* AboutWindowController.h */, 753 760 A2085DDA0C53BC74000BC3B7 /* AboutWindowController.m */, … … 815 822 A2912C520A2956E80097A0CA /* PrefsWindow.nib */, 816 823 A2AE68310C628A35008753C9 /* Creator.nib */, 824 A25892750CF1FCE800CCCDDF /* StatsWindow.xib */, 817 825 A2A6E39F0CA7E4C900F10FEF /* AboutWindow.nib */, 818 826 A20B6FA40C4D97840034AB1D /* PriorityNone.png */, … … 1477 1485 A2F151250CD438DE001F3B0E /* InfoTabBack.png in Resources */, 1478 1486 A2F151260CD438DE001F3B0E /* InfoTabBackBlue.png in Resources */, 1487 A25892770CF1FCE800CCCDDF /* StatsWindow.xib in Resources */, 1479 1488 ); 1480 1489 runOnlyForDeploymentPostprocessing = 0; … … 1608 1617 A2A6321B0CD9751700E3DA60 /* BadgeView.m in Sources */, 1609 1618 A2ED7D8F0CEF431B00970975 /* FilterButton.m in Sources */, 1619 A25892640CF1F7E800CCCDDF /* StatsWindowController.m in Sources */, 1610 1620 ); 1611 1621 runOnlyForDeploymentPostprocessing = 0; … … 1787 1797 sourceTree = "<group>"; 1788 1798 }; 1799 A25892750CF1FCE800CCCDDF /* StatsWindow.xib */ = { 1800 isa = PBXVariantGroup; 1801 children = ( 1802 A25892760CF1FCE800CCCDDF /* English */, 1803 ); 1804 name = StatsWindow.xib; 1805 sourceTree = "<group>"; 1806 }; 1789 1807 A2912C520A2956E80097A0CA /* PrefsWindow.nib */ = { 1790 1808 isa = PBXVariantGroup; -
trunk/macosx/Controller.h
r3852 r3886 158 158 159 159 - (void) showMessageWindow: (id) sender; 160 - (void) showStatsWindow: (id) sender; 160 161 161 162 - (void) updateControlTint: (NSNotification *) notification; -
trunk/macosx/Controller.m
r3868 r3886 30 30 #import "TorrentTableView.h" 31 31 #import "CreatorWindowController.h" 32 #import "StatsWindowController.h" 32 33 #import "AboutWindowController.h" 33 34 #import "NSApplicationAdditions.h" … … 1368 1369 } 1369 1370 1371 - (void) showStatsWindow: (id) sender 1372 { 1373 [[StatsWindowController statsWindow: fLib] showWindow: nil]; 1374 } 1375 1370 1376 - (void) updateUI 1371 1377 { -
trunk/macosx/English.lproj/MainMenu.nib/classes.nib
r3869 r3886 120 120 <string>id</string> 121 121 <key>showPreferenceWindow</key> 122 <string>id</string> 123 <key>showStatsWindow</key> 122 124 <string>id</string> 123 125 <key>stopAllTorrents</key> -
trunk/macosx/English.lproj/MainMenu.nib/info.nib
r3869 r3886 11 11 <key>IBOpenObjects</key> 12 12 <array> 13 <integer>1 400</integer>13 <integer>1684</integer> 14 14 </array> 15 15 <key>IBSystem Version</key> -
trunk/macosx/NSStringAdditions.h
r3250 r3886 31 31 32 32 + (NSString *) stringForFileSize: (uint64_t) size; 33 + (NSString *) stringForLargeFileSizeGigs: (uint64_t) gigs bytes: (uint64_t) bytes; 34 33 35 + (NSString *) stringForSpeed: (float) speed; 34 36 + (NSString *) stringForSpeedAbbrev: (float) speed; -
trunk/macosx/NSStringAdditions.m
r3358 r3886 40 40 + (NSString *) stringForFileSize: (uint64_t) size 41 41 { 42 if (size < 1024)43 return [NSString stringWithFormat: NSLocalizedString(@"%lld bytes", "File size"), size]; 42 [self stringForLargeFileSizeGigs: size / 1073741824 bytes: size % 1073741824]; 43 } 44 44 45 + (NSString *) stringForLargeFileSizeGigs: (uint64_t) gigs bytes: (uint64_t) bytes 46 { 45 47 float convertedSize; 46 48 NSString * unit; 47 if ( size < 1048576)49 if (gigs == 0) 48 50 { 49 convertedSize = size / 1024.0;50 unit = NSLocalizedString(@"KB", "File size");51 }52 else if (size < 1073741824)53 {54 convertedSize = size / 1048576.0;55 unit = NSLocalizedString(@"MB", "File size");56 }57 else if (size < 1099511627776.0)58 {59 convertedSize = size / 1073741824.0;60 unit = NSLocalizedString(@"GB", "File size");51 if (bytes < 1024) 52 return [NSString stringWithFormat: NSLocalizedString(@"%lld bytes", "File size"), bytes]; 53 else if (bytes < 1048576) 54 { 55 convertedSize = bytes / 1024.0; 56 unit = NSLocalizedString(@"KB", "File size"); 57 } 58 else 59 { 60 convertedSize = bytes / 1048576.0; 61 unit = NSLocalizedString(@"MB", "File size"); 62 } 61 63 } 62 64 else 63 65 { 64 convertedSize = size / 1099511627776.0; 65 unit = NSLocalizedString(@"TB", "File size"); 66 if (gigs < 1024) 67 { 68 convertedSize = (float)gigs + bytes / 1073741824.0; 69 unit = NSLocalizedString(@"GB", "File size"); 70 } 71 else 72 { 73 convertedSize = gigs / 1024.0; 74 unit = NSLocalizedString(@"TB", "File size"); 75 } 66 76 } 67 77
Note: See TracChangeset
for help on using the changeset viewer.