Changeset 4871
- Timestamp:
- 08/22/07 14:33:02 (11 months ago)
- Files:
-
- Footagehead/trunk/English.lproj/Localizable.strings (modified) (4 diffs)
- Footagehead/trunk/FHBrowserController.h (modified) (1 diff)
- Footagehead/trunk/FHBrowserController.m (modified) (8 diffs)
- Footagehead/trunk/FHImageLoader.m (modified) (1 diff)
- Footagehead/trunk/Japanese.lproj/Localizable.strings (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Footagehead/trunk/English.lproj/Localizable.strings
r4870 r4871 26 26 "Actual Size" = "Actual Size"; 27 27 28 /* Move to trash dialog button title */ 28 /* Move to trash dialog button title 29 File exists dialog button title */ 29 30 "Cancel" = "Cancel"; 30 31 31 32 /* Move to trash dialog message */ 32 "Could not move to trash" = "Could not move to trash";33 "Could Not Move To Trash" = "Could Not Move To Trash"; 33 34 34 35 /* Move to trash dialog button title */ … … 37 38 /* Move to trash dialog description */ 38 39 "Do you want to delete \"%@\" immediately?" = "Do you want to delete “%@” immediately?"; 40 41 /* File exists dialog title */ 42 "File Exists" = "File Exists"; 39 43 40 44 /* Menu item title */ … … 55 59 /* Move to trash toolbar item */ 56 60 "Move To Trash" = "Move To Trash"; 61 62 /* File exists dialog button title */ 63 "Overwrite" = "Overwrite"; 64 65 /* File exists dialog button title */ 66 "Overwrite All" = "Overwrite All"; 57 67 58 68 /* Parent toolbar item */ … … 89 99 "Stretch To Fit" = "Stretch To Fit"; 90 100 101 /* File exists dialog description */ 102 "The file \"%@\" already exists. Overwrite?" = "The file “%@” already exists. Overwrite?"; 103 91 104 /* Zoom to fit toolbar item */ 92 105 "Zoom To Fit" = "Zoom To Fit"; Footagehead/trunk/FHBrowserController.h
r4868 r4871 73 73 BOOL _switchingURL; 74 74 NSInteger _previousRow; 75 76 NSString *_savedPath; 75 77 NSUInteger _savedFiles; 78 BOOL _overwriteAllExisting; 76 79 } 77 80 Footagehead/trunk/FHBrowserController.m
r4868 r4871 447 447 [[_imageLoader notificationCenter] 448 448 addObserver:self 449 selector:@selector(imageLoaderDidLoadFile:) 450 name:FHImageLoaderDidLoadFile]; 451 452 [[_imageLoader notificationCenter] 453 addObserver:self 449 454 selector:@selector(imageLoaderDidLoadAllFiles:) 450 455 name:FHImageLoaderDidLoadAllFiles]; … … 463 468 464 469 [_imageLoader stopLoadingImagesAndThumbnails]; 470 [_imageLoader stopLoadingData]; 465 471 466 472 [_toolbarItems release]; 473 474 [_savedPath release]; 467 475 468 476 [super dealloc]; … … 647 655 - (void)imageLoaderDidLoadThumbnail:(NSNotification *)notification { 648 656 [_tableView reloadData]; 657 } 658 659 660 661 - (void)imageLoaderDidLoadFile:(NSNotification *)notification { 662 NSAlert *alert; 663 NSString *path; 664 FHFile *file; 665 int result; 666 BOOL write = YES; 667 668 file = [notification object]; 669 path = [_savedPath stringByAppendingPathComponent:[[file path] lastPathComponent]]; 670 671 if(!_overwriteAllExisting && [[NSFileManager defaultManager] fileExistsAtPath:path]) { 672 alert = [NSAlert alertWithMessageText:NSLS(@"File Exists", @"File exists dialog title") 673 defaultButton:NSLS(@"Cancel", @"File exists dialog button title") 674 alternateButton:NSLS(@"Overwrite All", @"File exists dialog button title") 675 otherButton:NSLS(@"Overwrite", @"File exists dialog button title") 676 informativeTextWithFormat:NSLS(@"The file \"%@\" already exists. Overwrite?", @"File exists dialog description"), [file name]]; 677 678 result = [alert runModal]; 679 680 if(result == NSAlertDefaultReturn) 681 write = NO; 682 else if(result == NSAlertAlternateReturn) 683 _overwriteAllExisting = YES; 684 } 685 686 if(write) 687 [[file data] writeToFile:path atomically:YES]; 688 689 [file setData:NULL]; 649 690 } 650 691 … … 970 1011 [_saveProgressTextField setStringValue:@""]; 971 1012 1013 [_savedPath release]; 1014 _savedPath = [path retain]; 1015 972 1016 _savedFiles = 0; 1017 _overwriteAllExisting = NO; 973 1018 974 1019 [NSApp beginSheet:_saveProgressPanel … … 976 1021 modalDelegate:self 977 1022 didEndSelector:@selector(saveProgressPanelDidEnd:returnCode:contextInfo:) 978 contextInfo: [path retain]];1023 contextInfo:NULL]; 979 1024 } 980 1025 } … … 983 1028 984 1029 - (void)saveProgressPanelDidEnd:(NSOpenPanel *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo { 985 NSArray *files;986 NSString *path = contextInfo;987 FHFile *file;988 NSUInteger i, count;989 990 1030 [_saveProgressPanel close]; 991 1031 992 if(returnCode == NSAlertDefaultReturn) { 993 files = [[self imageLoader] files]; 994 count = [files count]; 995 996 for(i = 0; i < count; i++) { 997 file = [files objectAtIndex:i]; 998 999 if([file data]) { 1000 [[file data] writeToFile:[path stringByAppendingPathComponent:[[file path] lastPathComponent]] 1001 atomically:YES]; 1002 1003 [file setData:NULL]; 1004 } 1005 } 1006 } else { 1032 NSLog(@"returnCode = %d", returnCode); 1033 1034 if(returnCode != NSAlertDefaultReturn) { 1007 1035 [_imageLoader stopLoadingData]; 1008 1036 } … … 1010 1038 [_imageLoader startLoadingImages]; 1011 1039 [_imageLoader startLoadingThumbnails]; 1012 1013 [path release];1014 1040 } 1015 1041 … … 1050 1076 1051 1077 if(!result) { 1052 alert = [NSAlert alertWithMessageText:NSLS(@"Could not move to trash", @"Move to trash dialog message")1078 alert = [NSAlert alertWithMessageText:NSLS(@"Could Not Move To Trash", @"Move to trash dialog message") 1053 1079 defaultButton:NSLS(@"Delete", @"Move to trash dialog button title") 1054 1080 alternateButton:NSLS(@"Cancel", @"Move to trash dialog button title") Footagehead/trunk/FHImageLoader.m
r4868 r4871 95 95 } 96 96 97 [_notificationCenter mainThreadPostNotificationName:FHImageLoaderDidLoadFile object:file ];97 [_notificationCenter mainThreadPostNotificationName:FHImageLoaderDidLoadFile object:file waitUntilDone:YES]; 98 98 } 99 99 Footagehead/trunk/Japanese.lproj/Localizable.strings
r4857 r4871 27 27 28 28 /* Move to trash dialog message */ 29 "Could not move to trash" = "ゴミ箱に移動することはできませんでした";29 "Could Not Move To Trash" = "ゴミ箱に移動することはできませんでした"; 30 30 31 31 /* Move to trash dialog button title */
