Changeset 9958


Ignore:
Timestamp:
Jan 17, 2010, 5:57:54 PM (12 years ago)
Author:
livings124
Message:

don't save the torrent file for magnetized transfers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r9945 r9958  
    14421442- (void) copyTorrentFileForTorrents: (NSMutableArray *) torrents
    14431443{
    1444     if ([torrents count] <= 0)
     1444    if ([torrents count] == 0)
    14451445    {
    14461446        [torrents release];
     
    14501450    Torrent * torrent = [torrents objectAtIndex: 0];
    14511451   
    1452     //warn user if torrent file can't be found
    1453     if (![[NSFileManager defaultManager] fileExistsAtPath: [torrent torrentLocation]])
    1454     {
    1455         NSAlert * alert = [[NSAlert alloc] init];
    1456         [alert addButtonWithTitle: NSLocalizedString(@"OK", "Torrent file copy alert -> button")];
    1457         [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Copy of \"%@\" Cannot Be Created",
    1458                                 "Torrent file copy alert -> title"), [torrent name]]];
    1459         [alert setInformativeText: [NSString stringWithFormat:
    1460                 NSLocalizedString(@"The torrent file (%@) cannot be found.", "Torrent file copy alert -> message"),
    1461                                     [torrent torrentLocation]]];
    1462         [alert setAlertStyle: NSWarningAlertStyle];
    1463        
    1464         [alert runModal];
    1465         [alert release];
    1466        
    1467         [torrents removeObjectAtIndex: 0];
    1468         [self copyTorrentFileForTorrents: torrents];
    1469     }
    1470     else
     1452    if (![torrent isMagnet] && [[NSFileManager defaultManager] fileExistsAtPath: [torrent torrentLocation]])
    14711453    {
    14721454        NSSavePanel * panel = [NSSavePanel savePanel];
     
    14761458        [panel beginSheetForDirectory: nil file: [torrent name] modalForWindow: fWindow modalDelegate: self
    14771459            didEndSelector: @selector(saveTorrentCopySheetClosed:returnCode:contextInfo:) contextInfo: torrents];
     1460    }
     1461    else
     1462    {
     1463        if (![torrent isMagnet])
     1464        {
     1465            NSAlert * alert = [[NSAlert alloc] init];
     1466            [alert addButtonWithTitle: NSLocalizedString(@"OK", "Torrent file copy alert -> button")];
     1467            [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Copy of \"%@\" Cannot Be Created",
     1468                                    "Torrent file copy alert -> title"), [torrent name]]];
     1469            [alert setInformativeText: [NSString stringWithFormat:
     1470                    NSLocalizedString(@"The torrent file (%@) cannot be found.", "Torrent file copy alert -> message"),
     1471                                        [torrent torrentLocation]]];
     1472            [alert setAlertStyle: NSWarningAlertStyle];
     1473           
     1474            [alert runModal];
     1475            [alert release];
     1476        }
     1477       
     1478        [torrents removeObjectAtIndex: 0];
     1479        [self copyTorrentFileForTorrents: torrents];
    14781480    }
    14791481}
     
    39093911    //enable copy torrent file item
    39103912    if (action == @selector(copyTorrentFiles:))
    3911         return canUseTable && [fTableView numberOfSelectedRows] > 0;
     3913    {
     3914        if (!canUseTable)
     3915            return NO;
     3916       
     3917        for (Torrent * torrent in [fTableView selectedTorrents])
     3918            if (![torrent isMagnet])
     3919                return YES;
     3920        return NO;
     3921    }
    39123922   
    39133923    //enable copy torrent file item
Note: See TracChangeset for help on using the changeset viewer.