Ignore:
Timestamp:
Sep 25, 2006, 6:37:45 PM (15 years ago)
Author:
joshe
Message:

Merge nat-traversal branch to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentTableView.m

    r729 r920  
    5656        fResumeOffIcon = [NSImage imageNamed: @"ResumeOff.png"];
    5757        fPauseOnIcon = [NSImage imageNamed: @"PauseOn.png"];
     58        fResumeNoWaitOnIcon = [NSImage imageNamed: @"ResumeNoWaitOn.png"];
     59        fResumeNoWaitOffIcon = [NSImage imageNamed: @"ResumeNoWaitOff.png"];
    5860        fPauseOffIcon = [NSImage imageNamed: @"PauseOff.png"];
    5961        fRevealOnIcon = [NSImage imageNamed: @"RevealOn.png"];
     
    9597    fClickPoint = [self convertPoint: [event locationInWindow] fromView: nil];
    9698
    97     if ([event modifierFlags] & NSAlternateKeyMask)
    98     {
    99         [fController toggleAdvancedBar: self];
    100         fClickPoint = NSZeroPoint;
    101     }
    102     else if (![self pointInPauseRect: fClickPoint] && ![self pointInRevealRect: fClickPoint])
    103     {
    104         if ([self pointInMinimalStatusRect: fClickPoint])
    105             [(TorrentCell *)[[self tableColumnWithIdentifier: @"Torrent"] dataCell] toggleMinimalStatus];
    106 
    107         [super mouseDown: event];
     99    if (![self pointInPauseRect: fClickPoint] && ![self pointInRevealRect: fClickPoint])
     100    {
     101        if ([event modifierFlags] & NSAlternateKeyMask)
     102        {
     103            [fController toggleAdvancedBar: self];
     104            fClickPoint = NSZeroPoint;
     105        }
     106        else
     107        {
     108            if ([self pointInMinimalStatusRect: fClickPoint])
     109                [(TorrentCell *)[[self tableColumnWithIdentifier: @"Torrent"] dataCell] toggleMinimalStatus];
     110
     111            [super mouseDown: event];
     112        }
    108113    }
    109114    else;
     
    122127        Torrent * torrent = [fTorrents objectAtIndex: row];
    123128
    124                 if ([torrent isPaused])
    125                         [fController resumeTorrents: [NSArray arrayWithObject: torrent]];
    126                 else if ([torrent isActive])
     129        if ([torrent isActive])
    127130            [fController stopTorrents: [NSArray arrayWithObject: torrent]];
    128                 else;
     131        else if ([torrent isPaused])
     132        {
     133            if ([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask)
     134                [fController resumeTorrentsNoWait: [NSArray arrayWithObject: torrent]];
     135            else if ([torrent waitingToStart])
     136                [fController stopTorrents: [NSArray arrayWithObject: torrent]];
     137            else
     138                [fController resumeTorrents: [NSArray arrayWithObject: torrent]];
     139        }
     140        else;
    129141    }
    130142    else if (sameRow && [self pointInRevealRect: point] && [self pointInRevealRect: fClickPoint])
    131143        [[fTorrents objectAtIndex: row] revealData];
    132         else if ([event clickCount] == 2)
     144    else if ([event clickCount] == 2)
    133145    {
    134146        if ([self pointInIconRect: point])
     
    139151    else;
    140152   
    141         [super mouseUp: event];
     153    [super mouseUp: event];
    142154
    143155    fClickPoint = NSZeroPoint;
     
    183195        [super keyDown: event];
    184196    }
     197}
     198
     199- (void) flagsChanged: (NSEvent *) event
     200{
     201    [self display];
     202    [super flagsChanged: event];
    185203}
    186204
     
    224242        rect  = [self pauseRectForRow: i];
    225243
    226         if ([torrent isPaused])
    227             image = NSPointInRect(fClickPoint, rect) ? fResumeOnIcon : fResumeOffIcon;
    228         else if ([torrent isActive])
     244        if ([torrent isActive])
    229245            image = NSPointInRect(fClickPoint, rect) ? fPauseOnIcon : fPauseOffIcon;
     246        else if ([torrent isPaused])
     247        {
     248            if ([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask && [fDefaults boolForKey: @"Queue"])
     249                image = NSPointInRect(fClickPoint, rect) ? fResumeNoWaitOnIcon : fResumeNoWaitOffIcon;
     250            else if ([torrent waitingToStart])
     251                image = NSPointInRect(fClickPoint, rect) ? fPauseOnIcon : fPauseOffIcon;
     252            else
     253                image = NSPointInRect(fClickPoint, rect) ? fResumeOnIcon : fResumeOffIcon;
     254        }
    230255        else
    231256            image = nil;
Note: See TracChangeset for help on using the changeset viewer.