Changeset 9254


Ignore:
Timestamp:
Oct 9, 2009, 10:29:34 PM (12 years ago)
Author:
livings124
Message:

fix Mac build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TrackerNode.m

    r9220 r9254  
    7878{
    7979    NSString * dateString;
    80     if (fStat.hasAnnounced && fStat.lastAnnounceTime != 0)
     80    if (fStat.hasAnnounced)
    8181    {
    8282        NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
     
    112112- (NSString *) nextAnnounceStatusString
    113113{
    114     if (fStat.isAnnouncing)
    115         return [NSLocalizedString(@"Announce in progress", "Tracker next announce") stringByAppendingEllipsis];
    116     else if (fStat.willAnnounce)
    117         return [NSString stringWithFormat: NSLocalizedString(@"Next announce in %@", "Tracker next announce"),
    118                 [NSString timeString: fStat.nextAnnounceTime - [[NSDate date] timeIntervalSince1970] showSeconds: YES]];
    119     else if (fStat.isActive)
    120         return NSLocalizedString(@"Announce not scheduled", "Tracker next announce");
    121     else
    122         return NSLocalizedString(@"Tracker will be used as a backup", "Tracker next announce");
     114    switch (fStat.announceState)
     115    {
     116        case TR_TRACKER_ACTIVE:
     117            return [NSLocalizedString(@"Announce in progress", "Tracker next announce") stringByAppendingEllipsis];
     118       
     119        case TR_TRACKER_WAITING:
     120            return [NSString stringWithFormat: NSLocalizedString(@"Next announce in %@", "Tracker next announce"),
     121                    [NSString timeString: fStat.nextAnnounceTime - [[NSDate date] timeIntervalSince1970] showSeconds: YES]];
     122       
     123        case TR_TRACKER_QUEUED:
     124            return [NSLocalizedString(@"Announce is queued", "Tracker next announce") stringByAppendingEllipsis];
     125       
     126        case TR_TRACKER_INACTIVE:
     127            return fStat.isActive ? NSLocalizedString(@"Announce not scheduled", "Tracker next announce")
     128                                    : NSLocalizedString(@"Tracker will be used as a backup", "Tracker next announce");
     129       
     130        default:
     131            NSAssert(NO, @"unknown announce state: %d", fStat.announceState);
     132            return nil;
     133    }
    123134}
    124135
Note: See TracChangeset for help on using the changeset viewer.