Changeset 3669


Ignore:
Timestamp:
Nov 1, 2007, 3:20:29 AM (14 years ago)
Author:
livings124
Message:

use a view to draw the badge on Leopard

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEWS

    r3667 r3669  
    330.92 (2007/xx/yy)
    44- OS X:
    5    + Leopard: Time Machine will ignore incomplete files
     5   + Leopard: Time Machine will ignore incomplete downloads
    66   + Leopard: Fix bug with typing values in Inspector->Options
    77   + Leopard: Fix bug with toggling Minimal View
  • trunk/Transmission.xcodeproj/project.pbxproj

    r3653 r3669  
    127127                A2A306600AAD24A80049E2AC /* UKKQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306580AAD24A80049E2AC /* UKKQueue.m */; };
    128128                A2A306620AAD24A80049E2AC /* UKMainThreadProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A3065A0AAD24A80049E2AC /* UKMainThreadProxy.m */; };
     129                A2A6321B0CD9751700E3DA60 /* BadgeView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A6321A0CD9751700E3DA60 /* BadgeView.m */; };
    129130                A2A6E3A00CA7E4C900F10FEF /* AboutWindow.nib in Resources */ = {isa = PBXBuildFile; fileRef = A2A6E39F0CA7E4C900F10FEF /* AboutWindow.nib */; };
    130131                A2AA579D0ADFCAB400CA59F6 /* PiecesView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2AA579B0ADFCAB400CA59F6 /* PiecesView.m */; };
     
    470471                A2A306590AAD24A80049E2AC /* UKMainThreadProxy.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = UKMainThreadProxy.h; path = macosx/UKKQueue/UKMainThreadProxy.h; sourceTree = "<group>"; };
    471472                A2A3065A0AAD24A80049E2AC /* UKMainThreadProxy.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = UKMainThreadProxy.m; path = macosx/UKKQueue/UKMainThreadProxy.m; sourceTree = "<group>"; };
     473                A2A632190CD9751700E3DA60 /* BadgeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BadgeView.h; path = macosx/BadgeView.h; sourceTree = "<group>"; };
     474                A2A6321A0CD9751700E3DA60 /* BadgeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BadgeView.m; path = macosx/BadgeView.m; sourceTree = "<group>"; };
    472475                A2A6E39F0CA7E4C900F10FEF /* AboutWindow.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = AboutWindow.nib; path = macosx/AboutWindow.nib; sourceTree = "<group>"; };
    473476                A2AA579A0ADFCAB400CA59F6 /* PiecesView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PiecesView.h; path = macosx/PiecesView.h; sourceTree = "<group>"; };
     
    716719                                4DE5CCA50980735700BE280E /* Badger.h */,
    717720                                4DE5CCA60980735700BE280E /* Badger.m */,
     721                                A2A632190CD9751700E3DA60 /* BadgeView.h */,
     722                                A2A6321A0CD9751700E3DA60 /* BadgeView.m */,
    718723                                A256588A0A9A695400E8A03B /* MessageWindowController.h */,
    719724                                A256588B0A9A695400E8A03B /* MessageWindowController.m */,
     
    15301535                                A2E23AC60CB5E1930002BB25 /* InfoTabButtonCell.m in Sources */,
    15311536                                A2399CCD0CD3852300225B2B /* NSApplicationAdditions.m in Sources */,
     1537                                A2A6321B0CD9751700E3DA60 /* BadgeView.m in Sources */,
    15321538                        );
    15331539                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/macosx/Badger.m

    r3634 r3669  
    2424
    2525#import "Badger.h"
     26#import "BadgeView.h"
    2627#import "NSApplicationAdditions.h"
    2728#import "NSStringAdditions.h"
     
    4849        fCompletedBadged = 0;
    4950        fSpeedBadge = NO;
     51       
     52        if ([NSApp isOnLeopardOrBetter])
     53        {
     54            BadgeView * view = [[BadgeView alloc] initWithFrame: [[[NSApp dockTile] contentView] frame] lib: fLib];
     55            [[NSApp dockTile] setContentView: view];
     56            [view release];
     57        }
    5058    }
    5159   
     
    6371- (void) updateBadge
    6472{
     73    if ([NSApp isOnLeopardOrBetter])
     74    {
     75        [[NSApp dockTile] display];
     76        return;
     77    }
     78   
    6579    //set completed badge to top right
    66     BOOL completedChange = ![NSApp isOnLeopardOrBetter] && fCompleted != fCompletedBadged;
     80    BOOL completedChange = fCompleted != fCompletedBadged;
    6781    if (completedChange)
    6882    {
     
    204218}
    205219
     220//for quitting
    206221- (void) clearBadge
    207222{
    208     fCompleted = 0;
    209     fCompletedBadged = 0;
    210     fSpeedBadge = NO;
    211     [NSApp setApplicationIconImage: [NSImage imageNamed: @"NSApplicationIcon"]];
    212     if ([NSApp isOnLeopardOrBetter])
    213         [[NSApp dockTile] setBadgeLabel: @""];
     223    if (![NSApp isOnLeopardOrBetter])
     224    {
     225        fSpeedBadge = NO;
     226        fCompleted = 0;
     227        fCompletedBadged = 0;
     228        [NSApp setApplicationIconImage: nil];
     229    }
    214230}
    215231
Note: See TracChangeset for help on using the changeset viewer.