Changeset 272 for trunk/macosx/Badger.m


Ignore:
Timestamp:
Jun 6, 2006, 6:05:57 PM (15 years ago)
Author:
livings124
Message:

First commit on my own 8-)

Sorting by progress, sorting no longer causes crashes.
New look for the table.
Info is now inspector: can set individual and multiple ratio limits, shows listing of files, more info in general, resizes when changing tabs, can change tabs with cmd-left and cmd-right.
Menu items moved to "Transfers" menu.
Sliding status bar in its own view.
Prefs moved into their own nib.
Toolbar items for pause and resume selected (many wanted this, but it needs better icons)
New icons for Transfers and General.
A lot of tweaking of main window to fix alignment etc.
Sparkle used for updated (still needs to be added to website to work).

And a lot more tweaking and changes that I'm too lazy to list.

...now let's hope I commit this right

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Badger.m

    r261 r272  
    2525#import "Badger.h"
    2626#import "StringAdditions.h"
    27 #import "Utils.h"
    2827
    2928@interface Badger (Private)
     
    7574
    7675- (void) updateBadgeWithCompleted: (int) completed
    77                     uploadRate: (NSString *) uploadRate
    78                     downloadRate: (NSString *) downloadRate
     76                    uploadRate: (int) uploadRate
     77                    downloadRate: (int) downloadRate
    7978{
    8079    NSImage * dockIcon = nil;
     
    119118
    120119    //set upload and download rate badges
    121     BOOL speedShown = uploadRate || downloadRate;
     120    NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
     121    NSString * uploadRateString = uploadRate >= 0.1 && [defaults boolForKey: @"BadgeUploadRate"]
     122                                    ? [NSString stringForSpeedAbbrev: uploadRate] : nil,
     123            * downloadRateString = downloadRate >= 0.1 && [defaults boolForKey: @"BadgeDownloadRate"]
     124                                    ? [NSString stringForSpeedAbbrev: downloadRate] : nil;
     125   
     126    BOOL speedShown = uploadRateString || downloadRateString;
    122127    if (speedShown)
    123128    {
     
    137142        [dockIcon lockFocus];
    138143       
    139         if (uploadRate)
     144        if (uploadRateString)
    140145        {
    141146            //place badge
     
    144149           
    145150            //place badge text
    146             [self badgeString: uploadRate forRect: stringRect];
     151            [self badgeString: uploadRateString forRect: stringRect];
    147152        }
    148153       
    149         if (downloadRate)
     154        if (downloadRateString)
    150155        {
    151156            //download rate above upload rate
    152             if (uploadRate)
     157            if (uploadRateString)
    153158            {
    154159                float spaceBetween = badgeRect.size.height + 2.0;
     
    162167           
    163168            //place badge text
    164             [self badgeString: downloadRate forRect: stringRect];
     169            [self badgeString: downloadRateString forRect: stringRect];
    165170        }
    166171       
Note: See TracChangeset for help on using the changeset viewer.