don't save the torrent file for magnetized transfers
This commit is contained in:
parent
4ea2557fed
commit
590e4d0d9e
|
@ -1441,7 +1441,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
|||
|
||||
- (void) copyTorrentFileForTorrents: (NSMutableArray *) torrents
|
||||
{
|
||||
if ([torrents count] <= 0)
|
||||
if ([torrents count] == 0)
|
||||
{
|
||||
[torrents release];
|
||||
return;
|
||||
|
@ -1449,8 +1449,18 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
|||
|
||||
Torrent * torrent = [torrents objectAtIndex: 0];
|
||||
|
||||
//warn user if torrent file can't be found
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath: [torrent torrentLocation]])
|
||||
if (![torrent isMagnet] && [[NSFileManager defaultManager] fileExistsAtPath: [torrent torrentLocation]])
|
||||
{
|
||||
NSSavePanel * panel = [NSSavePanel savePanel];
|
||||
[panel setAllowedFileTypes: [NSArray arrayWithObjects: @"org.bittorrent.torrent", @"torrent", nil]];
|
||||
[panel setCanSelectHiddenExtension: YES];
|
||||
|
||||
[panel beginSheetForDirectory: nil file: [torrent name] modalForWindow: fWindow modalDelegate: self
|
||||
didEndSelector: @selector(saveTorrentCopySheetClosed:returnCode:contextInfo:) contextInfo: torrents];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (![torrent isMagnet])
|
||||
{
|
||||
NSAlert * alert = [[NSAlert alloc] init];
|
||||
[alert addButtonWithTitle: NSLocalizedString(@"OK", "Torrent file copy alert -> button")];
|
||||
|
@ -1463,19 +1473,11 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
|||
|
||||
[alert runModal];
|
||||
[alert release];
|
||||
}
|
||||
|
||||
[torrents removeObjectAtIndex: 0];
|
||||
[self copyTorrentFileForTorrents: torrents];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSSavePanel * panel = [NSSavePanel savePanel];
|
||||
[panel setAllowedFileTypes: [NSArray arrayWithObjects: @"org.bittorrent.torrent", @"torrent", nil]];
|
||||
[panel setCanSelectHiddenExtension: YES];
|
||||
|
||||
[panel beginSheetForDirectory: nil file: [torrent name] modalForWindow: fWindow modalDelegate: self
|
||||
didEndSelector: @selector(saveTorrentCopySheetClosed:returnCode:contextInfo:) contextInfo: torrents];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) saveTorrentCopySheetClosed: (NSSavePanel *) panel returnCode: (NSInteger) code contextInfo: (NSMutableArray *) torrents
|
||||
|
@ -3908,7 +3910,15 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
|||
|
||||
//enable copy torrent file item
|
||||
if (action == @selector(copyTorrentFiles:))
|
||||
return canUseTable && [fTableView numberOfSelectedRows] > 0;
|
||||
{
|
||||
if (!canUseTable)
|
||||
return NO;
|
||||
|
||||
for (Torrent * torrent in [fTableView selectedTorrents])
|
||||
if (![torrent isMagnet])
|
||||
return YES;
|
||||
return NO;
|
||||
}
|
||||
|
||||
//enable copy torrent file item
|
||||
if (action == @selector(copyMagnetLinks:))
|
||||
|
|
Loading…
Reference in New Issue