Changeset 9958 for trunk/macosx/Controller.m
- Timestamp:
- Jan 17, 2010, 5:57:54 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r9945 r9958 1442 1442 - (void) copyTorrentFileForTorrents: (NSMutableArray *) torrents 1443 1443 { 1444 if ([torrents count] <= 0)1444 if ([torrents count] == 0) 1445 1445 { 1446 1446 [torrents release]; … … 1450 1450 Torrent * torrent = [torrents objectAtIndex: 0]; 1451 1451 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]]) 1471 1453 { 1472 1454 NSSavePanel * panel = [NSSavePanel savePanel]; … … 1476 1458 [panel beginSheetForDirectory: nil file: [torrent name] modalForWindow: fWindow modalDelegate: self 1477 1459 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]; 1478 1480 } 1479 1481 } … … 3909 3911 //enable copy torrent file item 3910 3912 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 } 3912 3922 3913 3923 //enable copy torrent file item
Note: See TracChangeset
for help on using the changeset viewer.