Changeset 5479


Ignore:
Timestamp:
Apr 1, 2008, 3:24:35 PM (14 years ago)
Author:
livings124
Message:

more string fiddling and minor badger changes

Location:
trunk/macosx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/BadgeView.m

    r5390 r5479  
    6565        NSImage * quitBadge = [NSImage imageNamed: @"QuitBadge.png"];
    6666        [self badge: quitBadge string: NSLocalizedString(@"Quitting", "Dock Badger -> quit")
    67                 atHeight:  (rect.size.height - [quitBadge size].height) * 0.5];
     67                atHeight: (rect.size.height - [quitBadge size].height) * 0.5];
    6868        return;
    6969    }
     
    7676        tr_torrentRates(fLib, &downloadRate, &uploadRate);
    7777       
    78         BOOL upload = checkUpload && uploadRate >= 0.1;
     78        BOOL upload = checkUpload && uploadRate >= 0.1,
     79            download = checkDownload && downloadRate >= 0.1;
     80        float bottom = 0.0;
    7981        if (upload)
    80             [self badge: [NSImage imageNamed: @"UploadBadge.png"] string: [NSString stringForSpeedAbbrev: uploadRate] atHeight: 0.0];
    81         if (checkDownload && downloadRate >= 0.1)
    8282        {
    83             //download rate above upload rate
    84             float bottom = upload ? [[NSImage imageNamed: @"UploadBadge.png"] size].height + BETWEEN_PADDING : 0.0;
     83            NSImage * uploadBadge = [NSImage imageNamed: @"UploadBadge.png"];
     84            [self badge: uploadBadge string: [NSString stringForSpeedAbbrev: uploadRate] atHeight: bottom];
     85            if (download)
     86                bottom += [uploadBadge size].height + BETWEEN_PADDING; //download rate above upload rate
     87        }
     88        if (download)
    8589            [self badge: [NSImage imageNamed: @"DownloadBadge.png"] string: [NSString stringForSpeedAbbrev: downloadRate]
    8690                    atHeight: bottom];
    87         }
    8891    }
    8992}
     
    109112    }
    110113   
    111     NSRect badgeRect = NSZeroRect;
     114    NSRect badgeRect;
    112115    badgeRect.size = [badge size];
    113116    badgeRect.origin.y = height;
     
    118121    NSSize stringSize = [string sizeWithAttributes: fAttributes];
    119122   
    120     NSRect stringRect = badgeRect;
     123    NSRect stringRect;
    121124    stringRect.origin.x += (badgeRect.size.width - stringSize.width) * 0.5;
    122125    stringRect.origin.y += (badgeRect.size.height - stringSize.height) * 0.5 + 1.0; //adjust for shadow
  • trunk/macosx/Badger.m

    r4722 r5479  
    4949       
    5050        fCompleted = 0;
    51         fCompletedBadged = 0;
    52         fSpeedBadge = NO;
    5351       
    5452        if ([NSApp isOnLeopardOrBetter])
     
    5957        }
    6058        else
     59        {
    6160            fQuittingTiger = NO;
     61            fSpeedBadge = NO;
     62            fCompletedBadged = 0;
     63        }
    6264       
    6365        //change that just impacts the dock badge
  • trunk/macosx/English.lproj/Localizable.strings

    r5466 r5479  
    454454
    455455/* Torrent -> status string
    456    No Ratio */
     456   No Ratio
     457   Inspector -> Peers tab -> table row tooltip */
    457458"N/A" = "N/A";
    458459
     
    506507"Open Torrent Address" = "Open Torrent Address";
    507508
     509/* Open toolbar item -> palette label */
     510"Open Torrent Files" = "Open Torrent Files";
     511
    508512/* Open toolbar item -> tooltip */
    509513"Open torrent files" = "Open torrent files";
    510514
    511 /* Open toolbar item -> palette label */
    512 "Open Torrent Files" = "Open Torrent Files";
    513 
    514515/* Open address toolbar item -> tooltip */
    515516"Open torrent web address" = "Open torrent web address";
     
    554555"Peers" = "Peers";
    555556
     557/* Inspector -> Peers tab -> table row tooltip */
     558"Port" = "Port";
     559
    556560/* Preferences -> Advanced -> port status */
    557561"Port is closed" = "Port is closed";
     
    562566/* Preferences -> Advanced -> port status */
    563567"Port is stealth" = "Port is stealth";
    564 
    565 /* Inspector -> Peers tab -> table row tooltip */
    566 "Port: %d" = "Port: %d";
    567 
    568 /* Inspector -> Peers tab -> table row tooltip */
    569 "Port: N/A" = "Port: N/A";
    570568
    571569/* file table -> header tool tip
     
    717715
    718716/* Torrent -> status string */
    719 "Stalled, " = "Stalled, ";
     717"Stalled" = "Stalled";
    720718
    721719/* Stats window -> title */
  • trunk/macosx/InfoWindowController.m

    r5464 r5479  
    824824            [components addObject: NSLocalizedString(@"Encrypted Connection", "Inspector -> Peers tab -> table row tooltip")];
    825825       
     826        NSString * portString;
    826827        int port;
    827828        if ((port = [[peer objectForKey: @"Port"] intValue]) > 0)
    828             [components addObject: [NSString stringWithFormat:
    829                                     NSLocalizedString(@"Port: %d", "Inspector -> Peers tab -> table row tooltip"), port]];
     829            portString = [NSString stringWithFormat: @"%d", port];
    830830        else
    831             [components addObject: NSLocalizedString(@"Port: N/A", "Inspector -> Peers tab -> table row tooltip")];
     831            portString = NSLocalizedString(@"N/A", "Inspector -> Peers tab -> table row tooltip");
     832        [components addObject: [NSString stringWithFormat: @"%@: %@", NSLocalizedString(@"Port",
     833            "Inspector -> Peers tab -> table row tooltip"), portString]];
    832834       
    833835        switch ([[peer objectForKey: @"From"] intValue])
  • trunk/macosx/Torrent.m

    r5473 r5479  
    255255}
    256256
     257#warning when queue and seeding options are folded into libt, no need to call this on all torrents - use tr_torrentGetStatus
    257258- (void) update
    258259{
     
    987988        if (![self isComplete]) //only multifile possible
    988989        {
    989            
    990990            if ([fDefaults boolForKey: @"DisplayStatusProgressSelected"])
    991991                downloadString = [NSString stringWithFormat: NSLocalizedString(@"%@ selected", "Torrent -> progress string"),
     
    10811081       
    10821082        if (fStalled)
    1083             string = [NSLocalizedString(@"Stalled, ", "Torrent -> status string") stringByAppendingString: string];
     1083            string = [NSString stringWithFormat: @"%@, %@", NSLocalizedString(@"Stalled", "Torrent -> status string"), string];
    10841084    }
    10851085   
Note: See TracChangeset for help on using the changeset viewer.