Changeset 424


Ignore:
Timestamp:
Jun 21, 2006, 11:46:41 PM (16 years ago)
Author:
livings124
Message:

Make method names less generic to avoid conflicts.
Use methods in the Torrent class whenever possible.

Location:
trunk/macosx
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Badger.m

    r374 r424  
    4545       
    4646        NSShadow * stringShadow = [[NSShadow alloc] init];
    47         [stringShadow setShadowOffset: NSMakeSize(2, -2)];
    48         [stringShadow setShadowBlurRadius: 4];
     47        [stringShadow setShadowOffset: NSMakeSize(2.0, -2.0)];
     48        [stringShadow setShadowBlurRadius: 4.0];
    4949       
    5050        fAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
    5151            [NSColor whiteColor], NSForegroundColorAttributeName,
    52             [NSFont fontWithName: @"Helvetica-Bold" size: 28], NSFontAttributeName,
     52            [NSFont fontWithName: @"Helvetica-Bold" size: 28.0], NSFontAttributeName,
    5353            stringShadow, NSShadowAttributeName, nil];
    5454       
     
    6666    [fDockIcon release];
    6767    [fBadgedDockIcon release];
    68 
    6968    [fAttributes release];
    7069
     
    8382    {
    8483        fCompleted = completed;
    85        
    8684        dockIcon = [fDockIcon copy];
    8785       
     
    126124    if (speedShown)
    127125    {
    128         NSRect badgeRect, stringRect;
     126        NSRect badgeRect;
    129127        badgeRect.size = [fUploadBadge size];
    130128        badgeRect.origin = NSZeroPoint;
    131129       
    132130        //ignore shadow of badge when placing string
     131        NSRect stringRect = badgeRect;
    133132        float badgeBottomExtra = 2.0;
    134         stringRect = badgeRect;
    135133        stringRect.size.height -= badgeBottomExtra;
    136134        stringRect.origin.y += badgeBottomExtra;
     
    178176           
    179177        [NSApp setApplicationIconImage: dockIcon];
    180        
    181178        [dockIcon release];
    182179    }
  • trunk/macosx/Controller.m

    r421 r424  
    320320        [torrent setDownloadFolder: [[openPanel filenames] objectAtIndex: 0]];
    321321        if ([fDefaults boolForKey: @"AutoStartDownload"])
    322             [torrent start];
     322            [torrent startTransfer];
    323323        [fTorrents addObject: torrent];
    324324       
     
    372372            [torrent setDownloadFolder: folder];
    373373            if (autoStart)
    374                 [torrent start];
     374                [torrent startTransfer];
    375375            [fTorrents addObject: torrent];
    376376        }
     
    462462- (void) resumeTorrentWithIndex: (NSIndexSet *) indexSet
    463463{
    464     Torrent * torrent;
    465464    unsigned int i;
    466465    for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
    467         [[fTorrents objectAtIndex: i] start];
     466        [[fTorrents objectAtIndex: i] startTransfer];
    468467   
    469468    [self updateUI: nil];
     
    485484{
    486485    unsigned int i;
    487     Torrent * torrent;
    488486    for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
    489     {
    490         torrent = [fTorrents objectAtIndex: i];
    491         [torrent stop];
    492     }
     487        [[fTorrents objectAtIndex: i] stopTransfer];
    493488   
    494489    [self updateUI: nil];
     
    540535        }
    541536
    542         NSBeginAlertSheet(title,
    543             @"Remove", @"Cancel", nil, fWindow, self,
     537        NSBeginAlertSheet(title, @"Remove", @"Cancel", nil, fWindow, self,
    544538            @selector(removeSheetDidEnd:returnCode:contextInfo:), nil, dict, message);
    545539    }
     
    571565    while ((torrent = [enumerator nextObject]))
    572566    {
    573         [torrent stop];
     567        [torrent stopTransfer];
    574568
    575569        if (deleteData)
     
    670664- (void) revealFile: (id) sender
    671665{
    672     Torrent * torrent;
    673666    NSIndexSet * indexSet = [fTableView selectedRowIndexes];
    674667    unsigned int i;
    675668   
    676669    for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
    677     {
    678         torrent = [fTorrents objectAtIndex: i];
    679         [torrent reveal];
    680     }
     670        [[fTorrents objectAtIndex: i] revealData];
    681671}
    682672
  • trunk/macosx/StringAdditions.m

    r423 r424  
    6565    }
    6666
    67     NSString * value;
     67    NSString * sizeString;
    6868    //attempt to have values with 3 digits
    6969    if (convertedSize < 10.0)
    70         value = [NSString stringWithFormat: @"%.2f", convertedSize];
     70        sizeString = [NSString stringWithFormat: @"%.2f", convertedSize];
    7171    else if (convertedSize < 100.0)
    72         value = [NSString stringWithFormat: @"%.1f", convertedSize];
     72        sizeString = [NSString stringWithFormat: @"%.1f", convertedSize];
    7373    else
    74         value = [NSString stringWithFormat: @"%.0f", convertedSize];
     74        sizeString = [NSString stringWithFormat: @"%.0f", convertedSize];
    7575
    76     return [value stringByAppendingString: unit];
     76    return [sizeString stringByAppendingString: unit];
    7777}
    7878
  • trunk/macosx/Torrent.h

    r421 r424  
    6363
    6464- (void)        update;
    65 - (void)        start;
    66 - (void)        stop;
     65- (void)        startTransfer;
     66- (void)        stopTransfer;
    6767- (void)        removeForever;
    6868- (void)        sleep;
     
    7575- (void)        setRatioLimit: (float) limit;
    7676
    77 - (void)    reveal;
     77- (void)    revealData;
    7878- (void)    trashData;
    7979- (void)    trashTorrent;
  • trunk/macosx/Torrent.m

    r421 r424  
    7272        NSString * paused;
    7373        if (!(paused = [history objectForKey: @"Paused"]) || [paused isEqualToString: @"NO"])
    74             [self start];
     74            [self startTransfer];
    7575    }
    7676    return self;
     
    138138            && [self ratio] >= [fDefaults floatForKey: @"RatioLimit"])))
    139139    {
    140         [self stop];
     140        [self stopTransfer];
    141141        [self setStopRatioSetting: RATIO_NO_CHECK];
    142142        fFinishedSeeding = YES;
     
    217217}
    218218
    219 - (void) start
     219- (void) startTransfer
    220220{
    221221    if (![self isActive])
     
    226226}
    227227
    228 - (void) stop
     228- (void) stopTransfer
    229229{
    230230    if ([self isActive])
     
    234234- (void) removeForever
    235235{
    236     if (fInfo->flags & TR_FSAVEPRIVATE)
     236    if (fPrivateTorrent)
    237237        tr_torrentRemoveSaved(fHandle);
    238238}
     
    241241{
    242242    if ((fResumeOnWake = [self isActive]))
    243         [self stop];
     243        [self stopTransfer];
    244244}
    245245
     
    247247{
    248248    if (fResumeOnWake)
    249         [self start];
     249        [self startTransfer];
    250250}
    251251
     
    277277}
    278278
    279 - (void) reveal
     279- (void) revealData
    280280{
    281281    [[NSWorkspace sharedWorkspace] selectFile: [self dataLocation] inFileViewerRootedAtPath: nil];
  • trunk/macosx/TorrentTableView.m

    r421 r424  
    5555        fRevealOnIcon = [NSImage imageNamed: @"RevealOn.png"];
    5656        fRevealOffIcon = [NSImage imageNamed: @"RevealOff.png"];
     57       
     58        fClickPoint = NSZeroPoint;
    5759    }
    5860   
     
    104106    }
    105107    else if (sameRow && [self pointInRevealRect: point] && [self pointInRevealRect: fClickPoint])
    106         [[fTorrents objectAtIndex: row] reveal];
     108        [[fTorrents objectAtIndex: row] revealData];
    107109        else if ([event clickCount] == 2)
    108110    {
    109111        if ([self pointInIconRect: point])
    110             [[fTorrents objectAtIndex: row] reveal];
     112            [[fTorrents objectAtIndex: row] revealData];
    111113        else
    112114            [fController showInfo: nil];
Note: See TracChangeset for help on using the changeset viewer.