Changeset 711


Ignore:
Timestamp:
Jul 30, 2006, 9:49:58 PM (15 years ago)
Author:
livings124
Message:

No delay in updating dock badge when changing setting in prefs.

Location:
trunk/macosx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Badger.h

    r374 r711  
    3939}
    4040
    41 - (void) updateBadgeWithCompleted: (int) completed
    42                     uploadRate: (float) uploadRate
    43                     downloadRate: (float) downloadRate;
     41- (void) updateBadgeWithCompleted: (int) completed uploadRate: (float) uploadRate downloadRate: (float) downloadRate;
    4442- (void) clearBadge;
    4543
  • trunk/macosx/Badger.m

    r709 r711  
    7373}
    7474
    75 - (void) updateBadgeWithCompleted: (int) completed
    76                     uploadRate: (float) uploadRate
    77                     downloadRate: (float) downloadRate
     75- (void) updateBadgeWithCompleted: (int) completed uploadRate: (float) uploadRate downloadRate: (float) downloadRate
    7876{
    7977    NSImage * dockIcon = nil;
     
    187185
    188186    [NSApp setApplicationIconImage: fDockIcon];
     187   
     188    fCompleted = 0;
     189    fSpeedShown = NO;
    189190}
    190191
  • trunk/macosx/Controller.h

    r707 r711  
    177177- (void) toggleAdvancedBar: (id) sender;
    178178
     179- (void) resetDockBadge: (NSNotification *) notification;
     180
    179181- (void) setWindowSizeToFit;
    180182- (NSRect) sizedWindowFrame;
  • trunk/macosx/Controller.m

    r710 r711  
    327327    [nc addObserver: self selector: @selector(reloadInspectorSettings:)
    328328                    name: @"TorrentSettingChange" object: nil];
     329   
     330    //change that just impacts the dock badge
     331    [nc addObserver: self selector: @selector(resetDockBadge:)
     332                    name: @"DockBadgeChange" object: nil];
    329333
    330334    //timer to update the interface every second
     
    20972101}
    20982102
     2103- (void) resetDockBadge: (NSNotification *) notification
     2104{
     2105    float downloadRate, uploadRate;
     2106    tr_torrentRates(fLib, & downloadRate, & uploadRate);
     2107   
     2108    [fBadger updateBadgeWithCompleted: fCompleted uploadRate: uploadRate downloadRate: downloadRate];
     2109}
     2110
    20992111- (NSRect) windowWillUseStandardFrame: (NSWindow *) window defaultFrame: (NSRect) defaultFrame
    21002112{
     
    21502162    {
    21512163        fCompleted = 0;
    2152         [self updateUI: nil];
     2164        [self resetDockBadge: nil];
    21532165    }
    21542166   
  • trunk/macosx/PrefsController.m

    r700 r711  
    498498        [fDefaults setBool: [sender state] forKey: @"BadgeUploadRate"];
    499499    else;
     500   
     501    [[NSNotificationCenter defaultCenter] postNotificationName: @"DockBadgeChange" object: self];
    500502}
    501503
Note: See TracChangeset for help on using the changeset viewer.