Changeset 555


Ignore:
Timestamp:
Jul 8, 2006, 9:03:00 PM (16 years ago)
Author:
livings124
Message:

Have remove use actual torrents, too.

Location:
trunk/macosx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r554 r555  
    9797- (void) stopTorrents:              (NSArray *) torrents;
    9898
    99 - (void) removeWithIndex: (NSIndexSet *) indexSet
     99- (void) removeTorrents: (NSArray *) torrents
    100100        deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteData;
    101101- (void) removeSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode
    102102                        contextInfo: (NSDictionary *) dict;
    103 - (void) confirmRemove: (NSArray *) torrents
     103- (void) confirmRemoveTorrents: (NSArray *) torrents
    104104        deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent;
    105105- (void) removeNoDelete:                (id) sender;
    106 - (void) removeDeleteData:       (id) sender;
    107 - (void) removeDeleteTorrent:    (id) sender;
    108 - (void) removeDeleteBoth:       (id) sender;
     106- (void) removeDeleteData:              (id) sender;
     107- (void) removeDeleteTorrent:           (id) sender;
     108- (void) removeDeleteDataAndTorrent:    (id) sender;
    109109
    110110- (void) copyTorrentFile: (id) sender;
  • trunk/macosx/Controller.m

    r554 r555  
    531531}
    532532
    533 - (void) removeWithIndex: (NSIndexSet *) indexSet
     533- (void) removeTorrents: (NSArray *) torrents
    534534        deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent
    535535{
    536     NSArray * torrents = [[self torrentsAtIndexes: indexSet] retain];
     536    [torrents retain];
    537537    int active = 0, downloading = 0;
    538538
     
    587587    }
    588588   
    589     [self confirmRemove: torrents deleteData: deleteData deleteTorrent: deleteTorrent];
     589    [self confirmRemoveTorrents: torrents deleteData: deleteData deleteTorrent: deleteTorrent];
    590590}
    591591
     
    600600   
    601601    if (returnCode == NSAlertDefaultReturn)
    602         [self confirmRemove: torrents deleteData: deleteData deleteTorrent: deleteTorrent];
     602        [self confirmRemoveTorrents: torrents deleteData: deleteData deleteTorrent: deleteTorrent];
    603603    else
    604604        [torrents release];
    605605}
    606606
    607 - (void) confirmRemove: (NSArray *) torrents deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent
     607- (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent
    608608{
    609609    //don't want any of these starting then stopping
     
    613613        [torrent setWaitToStart: NO];
    614614
    615     NSNumber * lowestOrderValue = [NSNumber numberWithInt: [torrents count]], * currentOrederValue;
     615    NSNumber * lowestOrderValue = [NSNumber numberWithInt: [torrents count]], * currentOrderValue;
    616616
    617617    enumerator = [torrents objectEnumerator];
     
    626626       
    627627        //determine lowest order value
    628         currentOrederValue = [torrent orderValue];
    629         if ([lowestOrderValue compare: currentOrederValue] == NSOrderedDescending)
    630             lowestOrderValue = currentOrederValue;
     628        currentOrderValue = [torrent orderValue];
     629        if ([lowestOrderValue compare: currentOrderValue] == NSOrderedDescending)
     630            lowestOrderValue = currentOrderValue;
    631631
    632632        [torrent removeForever];
     
    658658- (void) removeNoDelete: (id) sender
    659659{
    660     [self removeWithIndex: [fTableView selectedRowIndexes] deleteData: NO deleteTorrent: NO];
     660    [self removeTorrents: [self torrentsAtIndexes: [fTableView selectedRowIndexes]]
     661                deleteData: NO deleteTorrent: NO];
    661662}
    662663
    663664- (void) removeDeleteData: (id) sender
    664665{
    665     [self removeWithIndex: [fTableView selectedRowIndexes] deleteData: YES deleteTorrent: NO];
     666    [self removeTorrents: [self torrentsAtIndexes: [fTableView selectedRowIndexes]]
     667                deleteData: YES deleteTorrent: NO];
    666668}
    667669
    668670- (void) removeDeleteTorrent: (id) sender
    669671{
    670     [self removeWithIndex: [fTableView selectedRowIndexes] deleteData: NO deleteTorrent: YES];
    671 }
    672 
    673 - (void) removeDeleteBoth: (id) sender
    674 {
    675     [self removeWithIndex: [fTableView selectedRowIndexes] deleteData: YES deleteTorrent: YES];
     672    [self removeTorrents: [self torrentsAtIndexes: [fTableView selectedRowIndexes]]
     673                deleteData: NO deleteTorrent: YES];
     674}
     675
     676- (void) removeDeleteDataAndTorrent: (id) sender
     677{
     678    [self removeTorrents: [self torrentsAtIndexes: [fTableView selectedRowIndexes]]
     679                deleteData: YES deleteTorrent: YES];
    676680}
    677681
     
    15971601    //enable remove items
    15981602    if (action == @selector(removeNoDelete:) || action == @selector(removeDeleteData:)
    1599         || action == @selector(removeDeleteTorrent:) || action == @selector(removeDeleteBoth:))
     1603        || action == @selector(removeDeleteTorrent:) || action == @selector(removeDeleteDataAndTorrent:))
    16001604    {
    16011605        BOOL warning = NO,
    16021606            onlyDownloading = [fDefaults boolForKey: @"CheckRemoveDownloading"],
    1603             canDelete = action != @selector(removeDeleteTorrent:) && action != @selector(removeDeleteBoth:);
     1607            canDelete = action != @selector(removeDeleteTorrent:) && action != @selector(removeDeleteDataAndTorrent:);
    16041608        Torrent * torrent;
    16051609        NSIndexSet * indexSet = [fTableView selectedRowIndexes];
  • trunk/macosx/English.lproj/MainMenu.nib/classes.nib

    r554 r555  
    88                linkHomepage = id;
    99                openShowSheet = id;
    10                 removeDeleteBoth = id;
    1110                removeDeleteData = id;
     11                removeDeleteDataAndTorrent = id;
    1212                removeDeleteTorrent = id;
    1313                removeNoDelete = id;
  • trunk/macosx/English.lproj/MainMenu.nib/info.nib

    r554 r555  
    3030        <key>IBOpenObjects</key>
    3131        <array>
    32                 <integer>456</integer>
    3332                <integer>29</integer>
    3433        </array>
Note: See TracChangeset for help on using the changeset viewer.