Changeset 2886
- Timestamp:
- 05/21/05 00:28:53 (4 years ago)
- Files:
-
- Footagehead/trunk/English.lproj/Localizable.strings (modified) (1 diff)
- Footagehead/trunk/English.lproj/MainMenu.nib/classes.nib (modified) (2 diffs)
- Footagehead/trunk/English.lproj/MainMenu.nib/info.nib (modified) (2 diffs)
- Footagehead/trunk/English.lproj/MainMenu.nib/keyedobjects.nib (modified) (previous)
- Footagehead/trunk/English.lproj/MainMenu.nib/objects.nib (modified) (previous)
- Footagehead/trunk/English.lproj/ReleaseNotes.rtf (modified) (1 diff)
- Footagehead/trunk/FHController.h (modified) (3 diffs)
- Footagehead/trunk/FHController.m (modified) (12 diffs)
- Footagehead/trunk/FHHandler.h (modified) (6 diffs)
- Footagehead/trunk/FHHandler.m (modified) (5 diffs)
- Footagehead/trunk/FHSpotlightHandler.h (added)
- Footagehead/trunk/FHSpotlightHandler.m (added)
- Footagehead/trunk/Footagehead.xcode/project.pbxproj (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Footagehead/trunk/English.lproj/Localizable.strings
r2846 r2886 7 7 /* No comment provided by engineer. */ 8 8 "%u %@" = "%1$u %2$@"; 9 10 /* Spotlight query (query) */ 11 "\"%@\"" = "“%@”"; 9 12 10 13 /* No comment provided by engineer. */ Footagehead/trunk/English.lproj/MainMenu.nib/classes.nib
r2883 r2886 11 11 openMenu = id; 12 12 openParent = id; 13 openSpotlight = id; 13 14 openURL = id; 14 15 previousImage = id; … … 30 31 "_menu" = NSPopUpButton; 31 32 "_moveToTrashButton" = NSButton; 33 "_openSpotlightPanel" = NSPanel; 34 "_openSpotlightTextView" = NSTextView; 32 35 "_openURLPanel" = NSPanel; 33 36 "_openURLTextView" = NSTextView; Footagehead/trunk/English.lproj/MainMenu.nib/info.nib
r2884 r2886 8 8 <dict> 9 9 <key>29</key> 10 <string> 418 630317 44 0 0 1280 1002 </string>10 <string>262 594 317 44 0 0 1280 1002 </string> 11 11 </dict> 12 12 <key>IBFramework Version</key> … … 18 18 <integer>21</integer> 19 19 <integer>438</integer> 20 <integer>567</integer> 20 21 <integer>29</integer> 21 22 <integer>302</integer> Footagehead/trunk/English.lproj/ReleaseNotes.rtf
r2884 r2886 54 54 - Multithreaded preloading of next few images\ 55 55 - Fast thumbnail generation for JPEG files\ 56 - Spotlight image search support\ 56 57 57 58 \f0\b \cf2 \ Footagehead/trunk/FHController.h
r2883 r2886 31 31 32 32 @interface FHController : ZAWindowController { 33 IBOutlet NSMenuItem *_openSpotlightMenuItem; 34 33 35 IBOutlet ZASplitView *_splitView; 34 36 IBOutlet NSView *_leftView; … … 57 59 IBOutlet NSTextView *_openURLTextView; 58 60 61 IBOutlet NSPanel *_openSpotlightPanel; 62 IBOutlet NSTextView *_openSpotlightTextView; 63 59 64 FHFullscreenWindow *_fullscreenWindow; 60 65 FHHandler *_handler; … … 77 82 - (IBAction) open:(id)sender; 78 83 - (IBAction) openURL:(id)sender; 84 - (IBAction) openSpotlight:(id)sender; 79 85 - (IBAction) openParent:(id)sender; 80 86 - (IBAction) openMenu:(id)sender; Footagehead/trunk/FHController.m
r2883 r2886 128 128 _loadThumbnailsLock = [[NSConditionLock alloc] initWithCondition:0]; 129 129 130 // --- unlink spotlight item if not available 131 if(!NSClassFromString(@"NSMetadataQuery")) 132 [_openSpotlightMenuItem setAction:NULL]; 133 130 134 // --- open last directory by default (unset if started by opening a file) 131 135 _openLast = YES; … … 337 341 338 342 return handled; 339 }340 341 342 343 - (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {344 if(returnCode == NSOKButton)345 [self loadURL:[ZAURL fileURLWithPath:[sheet filename]] withHint:FHHandlerHintNone selectRow:0];346 }347 348 349 350 - (void)openURLPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {351 [_openURLPanel close];352 353 if(returnCode == NSRunStoppedResponse)354 [self loadURL:[ZAURL URLWithString:[_openURLTextView string] scheme:@"http"] withHint:FHHandlerHintNone selectRow:0];355 }356 357 358 359 - (void)screenPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {360 NSScreen *screen;361 NSRect screenRect;362 int screenNumber;363 364 [_screenPanel close];365 366 if(returnCode == NSRunStoppedResponse) {367 // --- save in prefs368 [FHSettings setInt:[_screenPopUpButton indexOfSelectedItem] forKey:FHScreen];369 [FHSettings setBool:[_screenAutoSwitchButton state] forKey:FHAutoSwitch];370 [FHSettings setInt:[_screenAutoSwitchTextField intValue] forKey:FHAutoSwitchTime];371 372 // --- get screen373 screenNumber = [FHSettings intForKey:FHScreen];374 375 if((unsigned int) screenNumber > [[NSScreen screens] count])376 screenNumber = 0;377 378 screen = [[NSScreen screens] objectAtIndex:screenNumber];379 screenRect = [screen frame];380 screenRect.origin.x = screenRect.origin.y = 0;381 382 // --- create fullscreen window383 _fullscreenWindow = [[FHFullscreenWindow alloc]384 initWithContentRect:screenRect385 styleMask:NSBorderlessWindowMask386 backing:NSBackingStoreBuffered387 defer:YES388 screen:screen];389 390 [_fullscreenWindow setLevel:NSScreenSaverWindowLevel];391 [_fullscreenWindow setDelegate:self];392 [_fullscreenWindow setReleasedWhenClosed:YES];393 [_fullscreenWindow setBackgroundColor:[NSColor blackColor]];394 [_fullscreenWindow setTitle:[[self window] title]];395 [_fullscreenPanel setFrame:screenRect display:NO];396 [_fullscreenWindow setContentView:[[_fullscreenPanel contentView] retain]];397 [[self window] orderOut:self];398 [_fullscreenWindow makeKeyAndOrderFront:self];399 [self updateImage];400 401 if([FHSettings boolForKey:FHAutoSwitch]) {402 _loadImageTimer = [[NSTimer scheduledTimerWithTimeInterval:[FHSettings intForKey:FHAutoSwitchTime]403 target:self404 selector:@selector(loadFileTimer:)405 userInfo:NULL406 repeats:YES] retain];407 }408 }409 343 } 410 344 … … 452 386 453 387 388 - (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { 389 if(returnCode == NSOKButton) 390 [self loadURL:[ZAURL fileURLWithPath:[sheet filename]] withHint:FHHandlerHintNone selectRow:0]; 391 } 392 393 394 454 395 - (IBAction)openURL:(id)sender { 455 396 [_openURLTextView setSelectedRange:NSMakeRange(0, [[_openURLTextView string] length])]; … … 464 405 465 406 407 - (void)openURLPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { 408 [_openURLPanel close]; 409 410 if(returnCode == NSRunStoppedResponse) 411 [self loadURL:[ZAURL URLWithString:[_openURLTextView string] scheme:@"http"] withHint:FHHandlerHintNone selectRow:0]; 412 } 413 414 415 416 - (IBAction)openSpotlight:(id)sender { 417 [_openSpotlightTextView setSelectedRange:NSMakeRange(0, [[_openSpotlightTextView string] length])]; 418 419 [NSApp beginSheet:_openSpotlightPanel 420 modalForWindow:[self window] 421 modalDelegate:self 422 didEndSelector:@selector(openSpotlightPanelDidEnd:returnCode:contextInfo:) 423 contextInfo:NULL]; 424 } 425 426 427 428 - (void)openSpotlightPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { 429 ZAURL *url; 430 431 [_openSpotlightPanel close]; 432 433 if(returnCode == NSRunStoppedResponse) { 434 url = [[ZAURL alloc] initWithScheme:@"spotlight" host:@"localhost" port:0]; 435 [url setPath:[NSSWF:@"/%@", [_openSpotlightTextView string]]]; 436 [self loadURL:url withHint:FHHandlerHintSpotlight selectRow:0]; 437 [url release]; 438 } 439 } 440 441 442 466 443 - (IBAction)openParent:(id)sender { 467 444 NSString *name; … … 609 586 610 587 - (IBAction)reload:(id)sender { 611 [self loadURL:[_handler URL] withHint: FHHandlerHintNoneselectRow:[_tableView selectedRow]];588 [self loadURL:[_handler URL] withHint:[_handler hint] selectRow:[_tableView selectedRow]]; 612 589 } 613 590 … … 624 601 625 602 603 - (void)screenPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { 604 NSScreen *screen; 605 NSRect screenRect; 606 int screenNumber; 607 608 [_screenPanel close]; 609 610 if(returnCode == NSRunStoppedResponse) { 611 // --- save in prefs 612 [FHSettings setInt:[_screenPopUpButton indexOfSelectedItem] forKey:FHScreen]; 613 [FHSettings setBool:[_screenAutoSwitchButton state] forKey:FHAutoSwitch]; 614 [FHSettings setInt:[_screenAutoSwitchTextField intValue] forKey:FHAutoSwitchTime]; 615 616 // --- get screen 617 screenNumber = [FHSettings intForKey:FHScreen]; 618 619 if((unsigned int) screenNumber > [[NSScreen screens] count]) 620 screenNumber = 0; 621 622 screen = [[NSScreen screens] objectAtIndex:screenNumber]; 623 screenRect = [screen frame]; 624 screenRect.origin.x = screenRect.origin.y = 0; 625 626 // --- create fullscreen window 627 _fullscreenWindow = [[FHFullscreenWindow alloc] 628 initWithContentRect:screenRect 629 styleMask:NSBorderlessWindowMask 630 backing:NSBackingStoreBuffered 631 defer:YES 632 screen:screen]; 633 634 [_fullscreenWindow setLevel:NSScreenSaverWindowLevel]; 635 [_fullscreenWindow setDelegate:self]; 636 [_fullscreenWindow setReleasedWhenClosed:YES]; 637 [_fullscreenWindow setBackgroundColor:[NSColor blackColor]]; 638 [_fullscreenWindow setTitle:[[self window] title]]; 639 [_fullscreenPanel setFrame:screenRect display:NO]; 640 [_fullscreenWindow setContentView:[[_fullscreenPanel contentView] retain]]; 641 [[self window] orderOut:self]; 642 [_fullscreenWindow makeKeyAndOrderFront:self]; 643 [self updateImage]; 644 645 if([FHSettings boolForKey:FHAutoSwitch]) { 646 _loadImageTimer = [[NSTimer scheduledTimerWithTimeInterval:[FHSettings intForKey:FHAutoSwitchTime] 647 target:self 648 selector:@selector(loadFileTimer:) 649 userInfo:NULL 650 repeats:YES] retain]; 651 } 652 } 653 } 654 655 656 626 657 - (IBAction)slideshowButtons:(id)sender { 627 658 [_screenAutoSwitchTextField setEnabled:[_screenAutoSwitchButton state]]; … … 631 662 632 663 - (IBAction)revealInFinder:(id)sender { 633 // --- might be disabled634 664 if(![_revealInFinderButton isEnabled]) 635 665 return; 636 666 637 // --- select in finder638 667 [[NSWorkspace sharedWorkspace] selectFile:[[self selectedFile] path] inFileViewerRootedAtPath:NULL]; 639 668 } … … 645 674 int row; 646 675 647 // --- might be disabled648 676 if(![_moveToTrashButton isEnabled]) 649 677 return; 650 678 651 // --- move to trash652 679 file = [self selectedFile]; 653 680 … … 664 691 row--; 665 692 666 // --- reload667 693 [self loadURL:[_handler URL] withHint:FHHandlerHintNone selectRow:row]; 668 694 } … … 677 703 [self startSpinning]; 678 704 679 // --- load files680 705 [url retain]; 681 [_handler release]; 706 707 if(_handler) { 708 if(![_handler isSynchronous] && ![_handler isFinished]) 709 [self stopSpinning]; 710 711 [_handler release]; 712 } 713 682 714 _handler = [[FHHandler alloc] initWithURL:url hint:hint]; 715 [_handler setDelegate:self]; 683 716 [url release]; 684 717 685 // --- adjust interface686 718 [self updateLeftStatus]; 687 719 [self updateButtons]; … … 708 740 } 709 741 710 [self stopSpinning]; 742 if([_handler isSynchronous]) 743 [self stopSpinning]; 711 744 } 712 745 … … 917 950 918 951 952 - (void)handlerDidAddFile:(FHHandler *)handler { 953 [_tableView reloadData]; 954 [self updateLeftStatus]; 955 } 956 957 958 959 - (void)handlerDidFinishLoading:(FHHandler *)handler { 960 [self stopSpinning]; 961 } 962 963 964 919 965 #pragma mark - 920 966 Footagehead/trunk/FHHandler.h
r920 r2886 1 /* $Id : FHHandler.h,v 1.7 2005/01/08 22:55:46 morris Exp$ */1 /* $Id$ */ 2 2 3 3 /* … … 33 33 FHHandlerHintGallery, 34 34 FHHandlerHintImage, 35 FHHandlerHintRange 35 FHHandlerHintRange, 36 FHHandlerHintSpotlight 36 37 }; 37 38 typedef enum FHHandlerHint FHHandlerHint; … … 43 44 44 45 FHHandlerHint _hint; 46 47 id _delegate; 45 48 46 49 BOOL _loadedFiles; … … 56 59 - (id) initWithURL:(ZAURL *)url hint:(FHHandlerHint)hint; 57 60 61 - (void) setDelegate:(id)delegate; 62 - (id) delegate; 63 58 64 - (NSArray *) files; 59 65 - (unsigned int) numberOfFiles; … … 61 67 - (unsigned int) numberOfImages; 62 68 - (BOOL) isLocal; 69 - (BOOL) isSynchronous; 70 - (BOOL) isFinished; 63 71 - (FHHandlerHint) hint; 64 72 … … 71 79 72 80 81 @interface NSObject(FHHandlerDelegate) 82 83 - (void)handlerDidAddFile:(FHHandler *)handler; 84 - (void)handlerDidFinishLoading:(FHHandler *)handler; 85 86 @end 87 73 88 74 89 @interface FHPlaceholderHandler : FHHandler Footagehead/trunk/FHHandler.m
r2885 r2886 33 33 #import "FHImageHandler.h" 34 34 #import "FHRangeHandler.h" 35 #import "FHSpotlightHandler.h" 35 36 36 37 static NSDictionary *FHHandlerHints; … … 50 51 [FHImageHandler class], 51 52 [NSNumber numberWithInt:FHHandlerHintImage], 53 [FHSpotlightHandler class], 54 [NSNumber numberWithInt:FHHandlerHintSpotlight], 52 55 NULL]; 53 56 … … 57 60 [FHRangeHandler class], 58 61 [FHImageHandler class], 62 [FHSpotlightHandler class], 59 63 NULL]; 60 64 } … … 148 152 #pragma mark - 149 153 154 - (void)setDelegate:(id)delegate { 155 _delegate = delegate; 156 } 157 158 159 160 - (id)delegate { 161 return _delegate; 162 } 163 164 165 166 #pragma mark - 167 150 168 - (NSArray *)files { 151 169 [self doesNotRecognizeSelector:_cmd]; … … 189 207 - (BOOL)isLocal { 190 208 return [[self URL] isFileURL]; 209 } 210 211 212 213 - (BOOL)isSynchronous { 214 return YES; 215 } 216 217 218 219 - (BOOL)isFinished { 220 return YES; 191 221 } 192 222 Footagehead/trunk/Footagehead.xcode/project.pbxproj
r2884 r2886 56 56 children = ( 57 57 A53901F30596A3E7000FBFD6, 58 1058C7A1FEA54F0111CA2CBB,58 A50932DE083E9530006646D1, 59 59 A54D2E8D076214FC00227EBE, 60 60 ); … … 63 63 refType = 4; 64 64 sourceTree = "<group>"; 65 };66 1058C7A1FEA54F0111CA2CBB = {67 isa = PBXFileReference;68 lastKnownFileType = wrapper.framework;69 name = Cocoa.framework;70 path = /System/Library/Frameworks/Cocoa.framework;71 refType = 0;72 sourceTree = "<absolute>";73 65 }; 74 66 1058C7A2FEA54F0111CA2CBB = { … … 115 107 29B97313FDCFA39411CA2CEA = { 116 108 buildSettings = { 117 MACOSX_DEPLOYMENT_TARGET = 10.2;118 SDKROOT = /Developer/SDKs/MacOSX10.2.8.sdk;119 109 }; 120 110 buildStyles = ( … … 263 253 GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 264 254 GCC_OPTIMIZATION_LEVEL = 0; 265 OTHER_CFLAGS = "-DDEVELOPMENT ";255 OTHER_CFLAGS = "-DDEVELOPMENT $(value)"; 266 256 ZERO_LINK = YES; 267 257 }; … … 275 265 GCC_GENERATE_DEBUGGING_SYMBOLS = NO; 276 266 GCC_WARN_UNINITIALIZED_AUTOS = YES; 277 OTHER_CFLAGS = "-DDEPLOYMENT ";267 OTHER_CFLAGS = "-DDEPLOYMENT $(value)"; 278 268 ZERO_LINK = NO; 279 269 }; … … 324 314 refType = 4; 325 315 sourceTree = "<group>"; 326 };327 770EBFC4083C94CE0094BD6C = {328 fileRef = 770EBFC2083C94CE0094BD6C;329 isa = PBXBuildFile;330 settings = {331 };332 316 }; 333 317 770EBFC5083C94CE0094BD6C = { … … 1465 1449 INFOPLIST_FILE = Info.plist; 1466 1450 MACOSX_DEPLOYMENT_TARGET = 10.2; 1451 OTHER_CFLAGS = "-DMAC_OS_X_VERSION_MAX_ALLOWED=1040"; 1467 1452 PRODUCT_NAME = Footagehead; 1468 1453 WRAPPER_EXTENSION = app; … … 1530 1515 77CDB023083B6B85003BE654, 1531 1516 770EBFC5083C94CE0094BD6C, 1517 A5092F57083E7812006646D1, 1532 1518 ); 1533 1519 isa = PBXSourcesBuildPhase; … … 1545 1531 buildActionMask = 2147483647; 1546 1532 files = ( 1533 A50932DF083E9530006646D1, 1547 1534 A53901F40596A3E7000FBFD6, 1548 A539028B0596A45A000FBFD6,1549 1535 A54D2E8E076214FC00227EBE, 1550 1536 770EB7A5083BA97E0094BD6C, … … 1579 1565 //A53 1580 1566 //A54 1567 A5092F55083E7812006646D1 = { 1568 fileEncoding = 5; 1569 isa = PBXFileReference; 1570 lastKnownFileType = sourcecode.c.objc; 1571 path = FHSpotlightHandler.m; 1572 refType = 4; 1573 sourceTree = "<group>"; 1574 }; 1575 A5092F56083E7812006646D1 = { 1576 fileEncoding = 5; 1577 isa = PBXFileReference; 1578 lastKnownFileType = sourcecode.c.h; 1579 path = FHSpotlightHandler.h; 1580 refType = 4; 1581 sourceTree = "<group>"; 1582 }; 1583 A5092F57083E7812006646D1 = { 1584 fileRef = A5092F55083E7812006646D1; 1585 isa = PBXBuildFile; 1586 settings = { 1587 }; 1588 }; 1589 A50932DE083E9530006646D1 = { 1590 isa = PBXFileReference; 1591 lastKnownFileType = wrapper.framework; 1592 name = Cocoa.framework; 1593 path = /System/Library/Frameworks/Cocoa.framework; 1594 refType = 0; 1595 sourceTree = "<absolute>"; 1596 }; 1597 A50932DF083E9530006646D1 = { 1598 fileRef = A50932DE083E9530006646D1; 1599 isa = PBXBuildFile; 1600 settings = { 1601 }; 1602 }; 1581 1603 A51395F405771ED4007FE220 = { 1582 1604 isa = PBXFileReference; … … 1644 1666 A53901F40596A3E7000FBFD6 = { 1645 1667 fileRef = A53901F30596A3E7000FBFD6; 1646 isa = PBXBuildFile;1647 settings = {1648 };1649 };1650 A539028B0596A45A000FBFD6 = {1651 fileRef = 1058C7A1FEA54F0111CA2CBB;1652 1668 isa = PBXBuildFile; 1653 1669 settings = { … … 1854 1870 files = ( 1855 1871 A54D42DD07663AA300227EBE, 1856 770EBFC4083C94CE0094BD6C,1857 1872 ); 1858 1873 isa = PBXCopyFilesBuildPhase; … … 1893 1908 A5B1F9BF067BDF2300111D0A, 1894 1909 A5B1F9C0067BDF2300111D0A, 1910 A5092F55083E7812006646D1, 1911 A5092F56083E7812006646D1, 1895 1912 ); 1896 1913 isa = PBXGroup;
