Ignore:
Timestamp:
Dec 26, 2006, 9:02:00 PM (16 years ago)
Author:
livings124
Message:

manual announce in mac gui...only useable once per minute for each torrent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r1257 r1283  
    6161#define UPDATE_UI_SECONDS           1.0
    6262#define AUTO_SPEED_LIMIT_SECONDS    5.0
     63
     64#define ANNOUNCE_WAIT_INTERVAL_SECONDS  -60.0
    6365
    6466#define WEBSITE_URL @"http://transmission.m0k.org/"
     
    10651067- (void) revealFile: (id) sender
    10661068{
    1067     NSIndexSet * indexSet = [fTableView selectedRowIndexes];
    1068     unsigned int i;
    1069     for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
    1070         [[fDisplayedTorrents objectAtIndex: i] revealData];
     1069    NSEnumerator * enumerator = [[fDisplayedTorrents objectsAtIndexes: [fTableView selectedRowIndexes]] objectEnumerator];
     1070    Torrent * torrent;
     1071    while ((torrent = [enumerator nextObject]))
     1072        [torrent revealData];
     1073}
     1074
     1075- (void) announceSelectedTorrents: (id) sender
     1076{
     1077    NSEnumerator * enumerator = [[fDisplayedTorrents objectsAtIndexes: [fTableView selectedRowIndexes]] objectEnumerator];
     1078    Torrent * torrent;
     1079    NSDate * date;
     1080    while ((torrent = [enumerator nextObject]))
     1081    {
     1082        //time interval returned will be negative
     1083        if (!(date = [torrent announceDate]) || [date timeIntervalSinceNow] <= ANNOUNCE_WAIT_INTERVAL_SECONDS)
     1084            [torrent announce];
     1085    }
    10711086}
    10721087
     
    24732488    }
    24742489   
     2490    //enable announce item
     2491    if (action == @selector(announceSelectedTorrents:))
     2492    {
     2493        if (!canUseTable)
     2494            return NO;
     2495       
     2496        NSEnumerator * enumerator = [[fDisplayedTorrents objectsAtIndexes: [fTableView selectedRowIndexes]] objectEnumerator];
     2497        Torrent * torrent;
     2498        NSDate * date;
     2499        while ((torrent = [enumerator nextObject]))
     2500        {
     2501            //time interval returned will be negative
     2502            if ([torrent isActive] &&
     2503                    (!(date = [torrent announceDate]) || [date timeIntervalSinceNow] <= ANNOUNCE_WAIT_INTERVAL_SECONDS))
     2504                return YES;
     2505        }
     2506        return NO;
     2507    }
     2508   
    24752509    //enable copy torrent file item
    24762510    if (action == @selector(copyTorrentFile:))
Note: See TracChangeset for help on using the changeset viewer.