Changeset 5950


Ignore:
Timestamp:
May 27, 2008, 7:05:48 PM (14 years ago)
Author:
livings124
Message:

handle removing with rpc

Location:
trunk/macosx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r5938 r5950  
    152152- (void) removeSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode
    153153                        contextInfo: (NSDictionary *) dict;
    154 - (void) confirmRemoveTorrents: (NSArray *) torrents
    155         deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent;
     154- (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent
     155        fromRPC: (BOOL) rpc;
    156156- (void) removeNoDelete:                (id) sender;
    157157- (void) removeDeleteData:              (id) sender;
  • trunk/macosx/Controller.m

    r5939 r5950  
    11771177    }
    11781178   
    1179     [self confirmRemoveTorrents: torrents deleteData: deleteData deleteTorrent: deleteTorrent];
     1179    [self confirmRemoveTorrents: torrents deleteData: deleteData deleteTorrent: deleteTorrent fromRPC: NO];
    11801180}
    11811181
     
    11851185    if (returnCode == NSAlertDefaultReturn)
    11861186        [self confirmRemoveTorrents: torrents deleteData: [[dict objectForKey: @"DeleteData"] boolValue]
    1187                                                 deleteTorrent: [[dict objectForKey: @"DeleteTorrent"] boolValue]];
     1187                deleteTorrent: [[dict objectForKey: @"DeleteTorrent"] boolValue] fromRPC: NO];
    11881188    else
    11891189        [torrents release];
     
    11931193
    11941194- (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent
     1195        fromRPC: (BOOL) rpc
    11951196{
    11961197    //don't want any of these starting then stopping
     
    12161217        lowestOrderValue = MIN(lowestOrderValue, [torrent orderValue]);
    12171218       
    1218         [torrent closeRemoveTorrent];
     1219        if (rpc)
     1220            [torrent closeRemoveTorrentInterface];
     1221        else
     1222            [torrent closeRemoveTorrent];
    12191223    }
    12201224   
     
    41524156   
    41534157    //get the torrent
     4158    Torrent * torrent;
    41544159    if (torrentStruct != NULL && (type != TR_RPC_TORRENT_ADDED && type != TR_RPC_SESSION_CHANGED))
    41554160    {
    41564161        NSEnumerator * enumerator = [fTorrents objectEnumerator];
    4157         Torrent * torrent;
    41584162        while ((torrent = [enumerator nextObject]))
    41594163            if (torrentStruct == [torrent torrentStruct])
     
    41654169            return;
    41664170        }
     4171       
     4172        [torrent retain];
    41674173    }
    41684174   
     
    41784184            break;
    41794185        case TR_RPC_TORRENT_REMOVING:
     4186            [self performSelectorOnMainThread: @selector(rpcRemoveTorrent:) withObject: torrent waitUntilDone: NO];
    41804187            break;
    41814188        case TR_RPC_TORRENT_CHANGED:
     
    42084215}
    42094216
     4217- (void) rpcRemoveTorrent: (Torrent *) torrent
     4218{
     4219    [self confirmRemoveTorrents: [[NSArray arrayWithObject: torrent] retain] deleteData: NO deleteTorrent: NO fromRPC: YES];
     4220    [torrent release];
     4221}
     4222
    42104223@end
  • trunk/macosx/Torrent.h

    r5937 r5950  
    7878- (NSDictionary *) history;
    7979
     80- (void) closeRemoveTorrentInterface;
    8081- (void) closeRemoveTorrent;
    8182
  • trunk/macosx/Torrent.m

    r5938 r5950  
    201201}
    202202
    203 - (void) closeRemoveTorrent
     203- (void) closeRemoveTorrentInterface
    204204{
    205205    //allow the file to be index by Time Machine
    206206    [self setTimeMachineExclude: NO forPath: [[self downloadFolder] stringByAppendingPathComponent: [self name]]];
     207}
     208
     209- (void) closeRemoveTorrent
     210{
     211    [self closeRemoveTorrentInterface];
    207212   
    208213    tr_torrentRemove(fHandle);
  • trunk/macosx/TorrentCell.m

    r5946 r5950  
    440440        NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: groupRect radius: radius];
    441441        [darkGroupColor set];
    442         [bp setLineWidth: 1.5];
     442        [bp setLineWidth: 2.0];
    443443        [bp stroke];
    444444       
Note: See TracChangeset for help on using the changeset viewer.