Changeset 3633


Ignore:
Timestamp:
Oct 29, 2007, 4:31:44 AM (15 years ago)
Author:
livings124
Message:

if on Leopard use the built in badging for the number of completed downloads

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Badger.h

    r3386 r3633  
    2929{
    3030    tr_handle       * fLib;
    31 
     31   
    3232    NSImage         * fDockIcon, * fBadge, * fUploadBadge, * fDownloadBadge;
     33   
    3334    NSDictionary    * fAttributes;
    3435    int             fCompleted, fCompletedBadged;
  • trunk/macosx/Badger.m

    r3452 r3633  
    2424
    2525#import "Badger.h"
     26#import "NSApplicationAdditions.h"
    2627#import "NSStringAdditions.h"
    2728
     
    6364{
    6465    //set completed badge to top right
    65     BOOL completedChange = fCompleted != fCompletedBadged;
     66    BOOL completedChange = [NSApp isOnLeopardOrBetter] && fCompleted != fCompletedBadged;
    6667    if (completedChange)
    6768    {
     
    184185{
    185186    fCompleted++;
    186     [self updateBadge];
     187   
     188    if ([NSApp isOnLeopardOrBetter])
     189        [[NSApp dockTile] setBadgeLabel: [NSString stringWithFormat: @"%d", fCompleted]];
     190    else
     191        [self updateBadge];
    187192}
    188193
     
    192197    {
    193198        fCompleted = 0;
    194         [self updateBadge];
     199        if ([NSApp isOnLeopardOrBetter])
     200            [[NSApp dockTile] setBadgeLabel: @""];
     201        else
     202            [self updateBadge];
    195203    }
    196204}
     
    202210    fSpeedBadge = NO;
    203211    [NSApp setApplicationIconImage: [NSImage imageNamed: @"NSApplicationIcon"]];
     212    if ([NSApp isOnLeopardOrBetter])
     213        [[NSApp dockTile] setBadgeLabel: @""];
    204214}
    205215
Note: See TracChangeset for help on using the changeset viewer.