NSString * fDestination, * fTorrentFile;
BOOL fLockDestination;
- BOOL fDeleteTorrentInitial, fDeleteEnableInitial;
+ BOOL fDeleteTorrentEnableInitially, fCanToggleDelete;
NSInteger fGroupValue;
NSTimer * fTimer;
- (id) initWithTorrent: (Torrent *) torrent destination: (NSString *) path lockDestination: (BOOL) lockDestination
controller: (Controller *) controller torrentFile: (NSString *) torrentFile
- deleteTorrent: (BOOL) deleteTorrent canToggleDelete: (BOOL) canToggleDelete;
+ deleteTorrentCheckEnableInitially: (BOOL) deleteTorrent canToggleDelete: (BOOL) canToggleDelete; //if canToggleDelete is NO, we will also not delete the file regardless of the delete check's state (this is so it can be disabled and checked for a downloaded torrent, where the file's already deleted)
- (Torrent *) torrent;
- (id) initWithTorrent: (Torrent *) torrent destination: (NSString *) path lockDestination: (BOOL) lockDestination
controller: (Controller *) controller torrentFile: (NSString *) torrentFile
- deleteTorrent: (BOOL) deleteTorrent canToggleDelete: (BOOL) canToggleDelete
+ deleteTorrentCheckEnableInitially: (BOOL) deleteTorrent canToggleDelete: (BOOL) canToggleDelete
{
if ((self = [super initWithWindowNibName: @"AddWindow"]))
{
fTorrentFile = [[torrentFile stringByExpandingTildeInPath] retain];
- fDeleteTorrentInitial = deleteTorrent;
- fDeleteEnableInitial = canToggleDelete;
+ fDeleteTorrentEnableInitially = deleteTorrent;
+ fCanToggleDelete = canToggleDelete;
fGroupValue = [torrent groupValue];
[fStartCheck setState: [[NSUserDefaults standardUserDefaults] boolForKey: @"AutoStartDownload"] ? NSOnState : NSOffState];
- [fDeleteCheck setState: fDeleteTorrentInitial ? NSOnState : NSOffState];
- [fDeleteCheck setEnabled: fDeleteEnableInitial];
+ [fDeleteCheck setState: fDeleteTorrentEnableInitially ? NSOnState : NSOffState];
+ [fDeleteCheck setEnabled: fCanToggleDelete];
if (fDestination)
[self setDestinationPath: fDestination];
fTimer = nil;
[fTorrent setGroupValue: fGroupValue];
- if (fTorrentFile && [fDeleteCheck state] == NSOnState)
+ if (fTorrentFile && fCanToggleDelete && [fDeleteCheck state] == NSOnState)
[Torrent trashFile: fTorrentFile];
if ([fStartCheck state] == NSOnState)
{
AddWindowController * addController = [[AddWindowController alloc] initWithTorrent: torrent destination: location
lockDestination: lockDestination controller: self torrentFile: torrentPath
- deleteTorrent: deleteTorrentFile canToggleDelete: canToggleDelete];
+ deleteTorrentCheckEnableInitially: deleteTorrentFile canToggleDelete: canToggleDelete];
[addController showWindow: self];
if (!fAddWindows)