- Timestamp:
- Aug 2, 2006, 12:04:04 AM (16 years ago)
- Location:
- trunk/macosx
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.h
r714 r716 54 54 NSToolbar * fToolbar; 55 55 56 IBOutlet NSMenuItem * fOpenIgnoreDownloadFolder; 57 56 58 IBOutlet NSMenuItem * fAdvancedBarItem, * fSmallViewItem, 57 59 * fSpeedLimitItem, * fSpeedLimitDockItem; … … 92 94 } 93 95 94 - (void) openShowSheet: (id) sender; 95 - (void) openSheetClosed: (NSOpenPanel *) s returnCode: (int) code contextInfo: (void *) info; 96 - (void) openFiles: (NSArray *) filenames; 97 - (void) openFiles: (NSArray *) filenames ignoreDownloadFolder: (BOOL) ignore; 98 - (void) openShowSheet: (id) sender; 96 99 97 100 - (void) quitSheetDidEnd: (NSWindow *) sheet returnCode: (int) returnCode contextInfo: (void *) contextInfo; -
trunk/macosx/Controller.m
r715 r716 431 431 } 432 432 433 - (NSArray *) torrentsAtIndexes: (NSIndexSet *) indexSet 434 { 435 if ([fFilteredTorrents respondsToSelector: @selector(objectsAtIndexes:)]) 436 return [fFilteredTorrents objectsAtIndexes: indexSet]; 437 else 438 { 439 NSMutableArray * torrents = [NSMutableArray arrayWithCapacity: [indexSet count]]; 440 unsigned int i; 441 for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i]) 442 [torrents addObject: [fFilteredTorrents objectAtIndex: i]]; 443 444 return torrents; 445 } 446 } 447 433 448 - (void) folderChoiceClosed: (NSOpenPanel *) openPanel returnCode: (int) code 434 449 contextInfo: (Torrent *) torrent … … 447 462 448 463 - (void) application: (NSApplication *) sender openFiles: (NSArray *) filenames 464 { 465 [self openFiles: filenames ignoreDownloadFolder: NO]; 466 } 467 468 - (void) openFiles: (NSArray *) filenames ignoreDownloadFolder: (BOOL) ignore 449 469 { 450 470 NSString * downloadChoice = [fDefaults stringForKey: @"DownloadChoice"], * torrentPath; … … 460 480 noteNewRecentDocumentURL: [NSURL fileURLWithPath: torrentPath]]; 461 481 462 if ( [downloadChoice isEqualToString: @"Ask"])482 if (ignore || [downloadChoice isEqualToString: @"Ask"]) 463 483 { 464 484 NSOpenPanel * panel = [NSOpenPanel openPanel]; … … 499 519 } 500 520 501 - (NSArray *) torrentsAtIndexes: (NSIndexSet *) indexSet502 {503 if ([fFilteredTorrents respondsToSelector: @selector(objectsAtIndexes:)])504 return [fFilteredTorrents objectsAtIndexes: indexSet];505 else506 {507 NSMutableArray * torrents = [NSMutableArray arrayWithCapacity: [indexSet count]];508 unsigned int i;509 for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])510 [torrents addObject: [fFilteredTorrents objectAtIndex: i]];511 512 return torrents;513 }514 }515 516 521 //called on by applescript 517 522 - (void) open: (NSArray *) files 518 523 { 519 [self performSelectorOnMainThread: @selector(openFromSheet:) withObject: files waitUntilDone: NO]; 524 [self performSelectorOnMainThread: @selector(openFiles:) withObject: files waitUntilDone: NO]; 525 } 526 527 - (void) openFiles: (NSArray *) filenames 528 { 529 [self openFiles: filenames ignoreDownloadFolder: NO]; 520 530 } 521 531 … … 530 540 [panel beginSheetForDirectory: nil file: nil types: [NSArray arrayWithObject: @"torrent"] 531 541 modalForWindow: fWindow modalDelegate: self didEndSelector: 532 @selector(openSheetClosed:returnCode:contextInfo:) contextInfo: nil]; 533 } 534 535 - (void) openSheetClosed: (NSOpenPanel *) panel returnCode: (int) code contextInfo: (void *) info 542 @selector(openSheetClosed:returnCode:contextInfo:) 543 contextInfo: [NSNumber numberWithBool: sender == fOpenIgnoreDownloadFolder]]; 544 } 545 546 - (void) openSheetClosed: (NSOpenPanel *) panel returnCode: (int) code contextInfo: (NSNumber *) ignore 536 547 { 537 548 if (code == NSOKButton) 538 [self performSelectorOnMainThread: @selector(openFromSheet:) withObject: [panel filenames] waitUntilDone: NO]; 539 } 540 541 - (void) openFromSheet: (NSArray *) filenames 542 { 543 [self application: NSApp openFiles: filenames]; 549 { 550 NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: 551 [panel filenames], @"Files", ignore, @"Ignore", nil]; 552 [self performSelectorOnMainThread: @selector(openFromSheet:) withObject: dictionary waitUntilDone: NO]; 553 } 554 } 555 556 - (void) openFromSheet: (NSDictionary *) dictionary 557 { 558 [self openFiles: [dictionary objectForKey: @"Files"] 559 ignoreDownloadFolder: [[dictionary objectForKey: @"Ignore"] boolValue]]; 560 561 [dictionary release]; 544 562 } 545 563 … … 1431 1449 { 1432 1450 oldCount = [fTorrents count]; 1433 [self openF romSheet: [NSArray arrayWithObject: [path stringByAppendingPathComponent: file]]];1451 [self openFiles: [NSArray arrayWithObject: [path stringByAppendingPathComponent: file]]]; 1434 1452 1435 1453 //import only actually happened if the torrent array is larger -
trunk/macosx/English.lproj/MainMenu.nib/classes.nib
r714 r716 52 52 fNextInfoTabItem = NSMenuItem; 53 53 fNoFilterButton = BarButton; 54 fOpenIgnoreDownloadFolder = NSMenuItem; 54 55 fOrderSortActionItem = NSMenuItem; 55 56 fOrderSortItem = NSMenuItem; -
trunk/macosx/English.lproj/MainMenu.nib/info.nib
r714 r716 14 14 <string>337 545 477 67 0 0 1152 842 </string> 15 15 <key>29</key> 16 <string>2 07 725 451 44 0 0 1152 842 </string>16 <string>227 675 451 44 0 0 1152 842 </string> 17 17 <key>456</key> 18 18 <string>396 374 216 206 0 0 1152 842 </string>
Note: See TracChangeset
for help on using the changeset viewer.