Changeset 3891
- Timestamp:
- Nov 19, 2007, 8:00:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/StatsWindowController.m
r3890 r3891 31 31 32 32 - (void) updateStats; 33 - (NSString *) timeString: (uint64_t) seconds; 33 34 34 35 @end … … 82 83 [fRatioField setStringValue: [NSString stringForRatio: stats.ratio]]; 83 84 85 [fTimeField setStringValue: [self timeString: stats.secondsActive]]; 86 87 [fNumOpenedField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d Times", "stats window -> times opened"), 88 stats.sessionCount]]; 89 } 90 91 - (NSString *) timeString: (uint64_t) seconds 92 { 84 93 NSMutableArray * timeArray = [NSMutableArray arrayWithCapacity: 4]; 85 uint64_t seconds = stats.secondsActive;86 if (s tats.secondsActive>= 86400) //24 * 60 * 6094 95 if (seconds >= 86400) //24 * 60 * 60 87 96 { 88 97 int days = seconds / 86400; … … 94 103 seconds %= 86400; 95 104 } 96 if (s tats.secondsActive>= 3600) //60 * 60105 if (seconds >= 3600) //60 * 60 97 106 { 98 107 [timeArray addObject: [NSString stringWithFormat: NSLocalizedString(@"%d hours", "stats window -> running time"), … … 100 109 seconds %= 3600; 101 110 } 102 if (s tats.secondsActive>= 60)111 if (seconds >= 60) 103 112 { 104 113 [timeArray addObject: [NSString stringWithFormat: NSLocalizedString(@"%d min", "stats window -> running time"), seconds / 60]]; … … 106 115 } 107 116 [timeArray addObject: [NSString stringWithFormat: NSLocalizedString(@"%d sec", "stats window -> running time"), seconds]]; 108 [fTimeField setStringValue: [timeArray componentsJoinedByString: @" "]];109 117 110 [fNumOpenedField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d Times", "stats window -> times opened"), 111 stats.sessionCount]]; 118 return [timeArray componentsJoinedByString: @" "]; 112 119 } 113 120
Note: See TracChangeset
for help on using the changeset viewer.