Changeset 901
- Timestamp:
- 12/03/04 13:32:51 (4 years ago)
- Files:
-
- Footagehead/trunk/English.lproj/InfoPlist.strings (modified) (1 diff)
- Footagehead/trunk/English.lproj/Localizable.strings (modified) (1 diff)
- Footagehead/trunk/English.lproj/MainMenu.nib/classes.nib (modified) (3 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/FHBrowserCell.h (deleted)
- Footagehead/trunk/FHBrowserCell.m (deleted)
- Footagehead/trunk/FHBrowserView.h (deleted)
- Footagehead/trunk/FHBrowserView.m (deleted)
- Footagehead/trunk/FHCache.h (modified) (2 diffs)
- Footagehead/trunk/FHCache.m (modified) (8 diffs)
- Footagehead/trunk/FHController.h (modified) (4 diffs)
- Footagehead/trunk/FHController.m (modified) (33 diffs)
- Footagehead/trunk/FHFile.h (modified) (2 diffs)
- Footagehead/trunk/FHFile.m (modified) (6 diffs)
- Footagehead/trunk/FHFileCell.h (added)
- Footagehead/trunk/FHFileCell.m (added)
- Footagehead/trunk/FHFileHandler.h (modified) (1 diff)
- Footagehead/trunk/FHFileHandler.m (modified) (10 diffs)
- Footagehead/trunk/FHFullscreenWindow.h (modified) (3 diffs)
- Footagehead/trunk/FHFullscreenWindow.m (modified) (4 diffs)
- Footagehead/trunk/FHGalleryHandler.h (modified) (1 diff)
- Footagehead/trunk/FHGalleryHandler.m (modified) (6 diffs)
- Footagehead/trunk/FHHTMLHandler.h (modified) (1 diff)
- Footagehead/trunk/FHHTMLHandler.m (modified) (7 diffs)
- Footagehead/trunk/FHHandler.h (modified) (3 diffs)
- Footagehead/trunk/FHHandler.m (modified) (4 diffs)
- Footagehead/trunk/FHImageHandler.h (modified) (1 diff)
- Footagehead/trunk/FHImageHandler.m (modified) (5 diffs)
- Footagehead/trunk/FHImageView.h (modified) (2 diffs)
- Footagehead/trunk/FHImageView.m (modified) (3 diffs)
- Footagehead/trunk/FHRARHandler.h (modified) (1 diff)
- Footagehead/trunk/FHRARHandler.m (modified) (5 diffs)
- Footagehead/trunk/FHRangeHandler.h (modified) (1 diff)
- Footagehead/trunk/FHRangeHandler.m (modified) (7 diffs)
- Footagehead/trunk/FHSettings.h (modified) (2 diffs)
- Footagehead/trunk/FHSettings.m (modified) (8 diffs)
- Footagehead/trunk/FHSplitView.h (deleted)
- Footagehead/trunk/FHSplitView.m (deleted)
- Footagehead/trunk/FHZipHandler.h (modified) (1 diff)
- Footagehead/trunk/FHZipHandler.m (modified) (5 diffs)
- Footagehead/trunk/Footagehead.xcode/project.pbxproj (modified) (42 diffs)
- Footagehead/trunk/Japanese.lproj/InfoPlist.strings (modified) (1 diff)
- Footagehead/trunk/Japanese.lproj/MainMenu.nib/classes.nib (modified) (2 diffs)
- Footagehead/trunk/Japanese.lproj/MainMenu.nib/info.nib (modified) (2 diffs)
- Footagehead/trunk/Japanese.lproj/MainMenu.nib/keyedobjects.nib (modified) (previous)
- Footagehead/trunk/Japanese.lproj/MainMenu.nib/objects.nib (modified) (previous)
- Footagehead/trunk/NSDataAdditions.h (deleted)
- Footagehead/trunk/NSDataAdditions.m (deleted)
- Footagehead/trunk/NSFileManagerAdditions.h (deleted)
- Footagehead/trunk/NSFileManagerAdditions.m (deleted)
- Footagehead/trunk/NSImage-FHAdditions.h (added)
- Footagehead/trunk/NSImage-FHAdditions.m (added)
- Footagehead/trunk/NSImageAdditions.h (deleted)
- Footagehead/trunk/NSImageAdditions.m (deleted)
- Footagehead/trunk/NSStringAdditions.h (deleted)
- Footagehead/trunk/NSStringAdditions.m (deleted)
- Footagehead/trunk/main.m (modified) (1 diff)
- Footagehead/trunk/prefix.pch (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Footagehead/trunk/English.lproj/InfoPlist.strings
r867 r901 2 2 3 3 CFBundleName = "Footagehead"; 4 CFBundleShortVersionString = "Footagehead 1. 1";5 CFBundleGetInfoString = "Footagehead 1. 1, Copyright 2003-2004 Zanka Software.";4 CFBundleShortVersionString = "Footagehead 1.2"; 5 CFBundleGetInfoString = "Footagehead 1.2, Copyright 2003-2004 Zanka Software."; 6 6 NSHumanReadableCopyright = "Copyright 2003-2004 Zanka Software."; Footagehead/trunk/English.lproj/Localizable.strings
r867 r901 16 16 /* No comment provided by engineer. */ 17 17 "Screen %u, %.0fx%.0f" = "Screen %u, %.0fx%.0f"; 18 Footagehead/trunk/English.lproj/MainMenu.nib/classes.nib
r887 r901 4 4 { 5 5 ACTIONS = { 6 cancelSheet = id;7 6 delete = id; 8 7 open = id; 8 openFile = id; 9 9 openMenu = id; 10 10 openParent = id; … … 14 14 slideshow = id; 15 15 slideshowButtons = id; 16 submitSheet = id;17 16 }; 18 17 CLASS = FHController; 19 18 LANGUAGE = ObjC; 20 19 OUTLETS = { 21 "_browserScrollView" = NSScrollView; 22 "_browserView" = FHBrowserView; 20 "_fileTableColumn" = NSTableColumn; 23 21 "_fullscreenImageView" = FHImageView; 24 22 "_fullscreenPanel" = NSPanel; 25 "_imageScrollView" = NSScrollView;26 23 "_imageView" = NSImageView; 27 24 "_leftStatusTextField" = NSTextField; 25 "_leftView" = NSScrollView; 28 26 "_menu" = NSPopUpButton; 29 27 "_moveToTrashButton" = NSButton; … … 34 32 "_revealInFinderButton" = NSButton; 35 33 "_rightStatusTextField" = NSTextField; 34 "_rightView" = NSScrollView; 36 35 "_screenAutoSwitchButton" = NSButton; 37 36 "_screenAutoSwitchTextField" = NSTextField; 38 37 "_screenPanel" = NSPanel; 39 38 "_screenPopUpButton" = NSPopUpButton; 40 "_splitView" = FHSplitView; 39 "_splitView" = ZASplitView; 40 "_tableView" = ZATableView; 41 41 }; 42 SUPERCLASS = NSWindowController;42 SUPERCLASS = ZAWindowController; 43 43 }, 44 44 {CLASS = FHImageView; LANGUAGE = ObjC; SUPERCLASS = NSImageView; }, 45 {CLASS = FHSplitView; LANGUAGE = ObjC; SUPERCLASS = NSSplitView; }, 46 {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } 45 { 46 ACTIONS = {cancelSheet = id; submitSheet = id; }; 47 CLASS = FirstResponder; 48 LANGUAGE = ObjC; 49 SUPERCLASS = NSObject; 50 }, 51 {CLASS = NSObject; LANGUAGE = ObjC; }, 52 {CLASS = ZASplitView; LANGUAGE = ObjC; SUPERCLASS = NSSplitView; }, 53 { 54 ACTIONS = {showViewOptions = id; }; 55 CLASS = ZATableView; 56 LANGUAGE = ObjC; 57 SUPERCLASS = NSTableView; 58 }, 59 { 60 CLASS = ZAWindowController; 61 LANGUAGE = ObjC; 62 SUPERCLASS = NSWindowController; 63 } 47 64 ); 48 65 IBVersion = 1; Footagehead/trunk/English.lproj/MainMenu.nib/info.nib
r887 r901 4 4 <dict> 5 5 <key>IBDocumentLocation</key> 6 <string> 349 217 395 374 0 0 1280 1002</string>6 <string>894 604 395 374 0 0 1680 1028 </string> 7 7 <key>IBEditorPositions</key> 8 8 <dict> 9 9 <key>29</key> 10 <string> 423 630 256 44 0 0 1280 1002</string>10 <string>588 647 256 44 0 0 1680 1028 </string> 11 11 </dict> 12 12 <key>IBFramework Version</key> … … 16 16 <key>IBOpenObjects</key> 17 17 <array> 18 <integer>438</integer> 19 <integer>302</integer> 20 <integer>29</integer> 18 21 <integer>21</integer> 19 <integer>29</integer>20 22 </array> 21 23 <key>IBSystem Version</key> 22 <string>7 H63</string>24 <string>7R28</string> 23 25 </dict> 24 26 </plist> Footagehead/trunk/FHCache.h
r866 r901 1 /* $Id: FHCache.h,v 1. 1 2004/06/14 23:36:06morris Exp $ */1 /* $Id: FHCache.h,v 1.2 2004/12/03 12:29:49 morris Exp $ */ 2 2 3 3 /* … … 27 27 */ 28 28 29 @interface FHCache : NSObject 29 @interface FHCache : NSObject { 30 NSImage *_directoryIcon; 31 NSMutableDictionary *_fileIcons; 32 NSMutableDictionary *_images; 33 NSMutableArray *_temporaryPaths; 34 35 NSRecursiveLock *_lock; 36 } 30 37 31 38 32 + ( NSImage *) directoryIcon;39 + (FHCache *) cache; 33 40 34 + (void) setFileIcon:(NSImage *)icon forExtension:(NSString *)extension; 35 + (NSImage *) fileIconForExtension:(NSString *)extension; 41 - (NSImage *) directoryIcon; 36 42 37 + (void) setFileIcon:(NSImage *)icon forPath:(NSString *)extension;38 + (NSImage *) fileIconForPath:(NSString *)path;43 - (void) setFileIcon:(NSImage *)icon forExtension:(NSString *)extension; 44 - (NSImage *) fileIconForExtension:(NSString *)extension; 39 45 40 + (void) setImage:(NSImage *)image forURL:(NSURL *)url;41 + (NSImage *) imageForURL:(NSURL *)url;46 - (void) setFileIcon:(NSImage *)icon forPath:(NSString *)extension; 47 - (NSImage *) fileIconForPath:(NSString *)path; 42 48 43 + (void) addTemporaryPath:(NSString *)path; 44 + (void) purgeTemporaryPaths; 49 - (void) setImage:(NSImage *)image forURL:(NSURL *)url; 50 - (NSImage *) imageForURL:(NSURL *)url; 51 52 - (void) addTemporaryPath:(NSString *)path; 53 - (void) purgeTemporaryPaths; 45 54 46 55 @end Footagehead/trunk/FHCache.m
r869 r901 1 /* $Id: FHCache.m,v 1. 2 2004/06/16 12:56:17morris Exp $ */1 /* $Id: FHCache.m,v 1.3 2004/12/03 12:29:49 morris Exp $ */ 2 2 3 3 /* … … 29 29 #import "FHCache.h" 30 30 31 static NSImage *directoryIcon; 32 static NSMutableDictionary *fileIcons; 33 static NSMutableDictionary *images; 34 static NSMutableArray *temporaryPaths; 31 @implementation FHCache 32 33 + (FHCache *)cache { 34 static FHCache *sharedCache; 35 36 if(!sharedCache) 37 sharedCache = [[self alloc] init]; 38 39 return sharedCache; 40 } 35 41 36 42 37 @implementation FHCache38 43 39 44 - (id)init { 40 45 self = [super init]; 41 46 42 // --- init directory icon 43 directoryIcon = [[[NSWorkspace sharedWorkspace] iconForFile:@"/tmp"] retain]; 44 [directoryIcon setSize:NSMakeSize(128, 128)]; 47 _directoryIcon = [[[NSWorkspace sharedWorkspace] iconForFile:@"/tmp"] retain]; 48 [_directoryIcon setSize:NSMakeSize(128, 128)]; 45 49 46 // --- init dictionaries to hold our caches 47 fileIcons = [[NSMutableDictionary alloc] initWithCapacity:100]; 48 images = [[NSMutableDictionary alloc] initWithCapacity:5]; 49 temporaryPaths = [[NSMutableArray alloc] initWithCapacity:10]; 50 _fileIcons = [[NSMutableDictionary alloc] initWithCapacity:100]; 51 _images = [[NSMutableDictionary alloc] initWithCapacity:5]; 52 _temporaryPaths = [[NSMutableArray alloc] initWithCapacity:10]; 53 54 _lock = [[NSRecursiveLock alloc] init]; 50 55 51 56 return self; … … 55 60 56 61 - (void)dealloc { 57 [directoryIcon release]; 58 [fileIcons release]; 59 [images release]; 60 [temporaryPaths release]; 62 [_directoryIcon release]; 63 [_fileIcons release]; 64 [_images release]; 65 [_temporaryPaths release]; 66 67 [_lock release]; 61 68 62 69 [super dealloc]; … … 67 74 #pragma mark - 68 75 69 +(NSImage *)directoryIcon {70 return directoryIcon;76 - (NSImage *)directoryIcon { 77 return _directoryIcon; 71 78 } 72 79 … … 75 82 #pragma mark - 76 83 77 + (void)setFileIcon:(NSImage *)icon forExtension:(NSString *)extension { 78 if([fileIcons count] > 100) 79 [fileIcons removeObjectForKey:[[fileIcons allKeys] objectAtIndex:0]]; 84 - (void)setFileIcon:(NSImage *)icon forExtension:(NSString *)extension { 85 [_lock lock]; 80 86 81 [fileIcons setObject:icon forKey:extension]; 87 if([_fileIcons count] > 100) 88 [_fileIcons removeObjectForKey:[[_fileIcons allKeys] objectAtIndex:0]]; 89 90 [_fileIcons setObject:icon forKey:extension]; 91 92 [_lock unlock]; 82 93 } 83 94 84 95 85 96 86 + (NSImage *)fileIconForExtension:(NSString *)extension { 87 return [fileIcons objectForKey:extension]; 97 - (NSImage *)fileIconForExtension:(NSString *)extension { 98 NSImage *image; 99 100 [_lock lock]; 101 image = [_fileIcons objectForKey:extension]; 102 [_lock unlock]; 103 104 return image; 88 105 } 89 106 … … 92 109 #pragma mark - 93 110 94 + (void)setFileIcon:(NSImage *)icon forPath:(NSString *)path { 95 if([fileIcons count] > 100) 96 [fileIcons removeObjectForKey:[[fileIcons allKeys] objectAtIndex:0]]; 111 - (void)setFileIcon:(NSImage *)icon forPath:(NSString *)path { 112 [_lock lock]; 97 113 98 [fileIcons setObject:icon forKey:path]; 114 if([_fileIcons count] > 100) 115 [_fileIcons removeObjectForKey:[[_fileIcons allKeys] objectAtIndex:0]]; 116 117 [_fileIcons setObject:icon forKey:path]; 118 119 [_lock unlock]; 99 120 } 100 121 101 122 102 123 103 + (NSImage *)fileIconForPath:(NSString *)path { 104 return [fileIcons objectForKey:path]; 124 - (NSImage *)fileIconForPath:(NSString *)path { 125 NSImage *image; 126 127 [_lock lock]; 128 image = [_fileIcons objectForKey:path]; 129 [_lock unlock]; 130 131 return image; 105 132 } 106 133 … … 109 136 #pragma mark - 110 137 111 + (void)setImage:(NSImage *)image forURL:(NSURL *)url { 138 - (void)setImage:(NSImage *)image forURL:(NSURL *)url { 139 [_lock lock]; 140 112 141 if(!image) { 113 [ images removeObjectForKey:url];142 [_images removeObjectForKey:url]; 114 143 } else { 115 if([ images count] > 5)116 [ images removeObjectForKey:[[images allKeys] objectAtIndex:0]];144 if([_images count] > 5) 145 [_images removeObjectForKey:[[_images allKeys] objectAtIndex:0]]; 117 146 118 [ images setObject:image forKey:[url absoluteString]];147 [_images setObject:image forKey:[url absoluteString]]; 119 148 } 149 150 [_lock unlock]; 120 151 } 121 152 122 153 123 154 124 + (NSImage *)imageForURL:(NSURL *)url { 125 return [images objectForKey:[url absoluteString]]; 155 - (NSImage *)imageForURL:(NSURL *)url { 156 NSImage *image; 157 158 [_lock lock]; 159 image = [[_images objectForKey:[url absoluteString]] retain]; 160 [_lock unlock]; 161 162 return [image autorelease]; 126 163 } 127 164 … … 130 167 #pragma mark - 131 168 132 + (void)addTemporaryPath:(NSString *)path { 133 [temporaryPaths addObject:path]; 169 - (void)addTemporaryPath:(NSString *)path { 170 [_lock lock]; 171 [_temporaryPaths addObject:path]; 172 [_lock unlock]; 134 173 } 135 174 136 175 137 176 138 + (void)purgeTemporaryPaths { 139 int i, count; 177 - (void)purgeTemporaryPaths { 178 NSFileManager *fileManager; 179 int i, count; 180 181 [_lock lock]; 140 182 141 count = [temporaryPaths count]; 183 fileManager = [NSFileManager defaultManager]; 184 count = [_temporaryPaths count]; 142 185 143 for(i = 0; i < count; i++) {144 [ [NSFileManager defaultManager] removeFileAtPath:[temporaryPaths objectAtIndex:i]145 handler:NULL];146 }186 for(i = 0; i < count; i++) 187 [fileManager removeFileAtPath:[_temporaryPaths objectAtIndex:i] handler:NULL]; 188 189 [_lock unlock]; 147 190 } 148 191 Footagehead/trunk/FHController.h
r885 r901 1 /* $Id: FHController.h,v 1. 9 2004/07/09 03:08:36morris Exp $ */1 /* $Id: FHController.h,v 1.10 2004/12/03 12:29:49 morris Exp $ */ 2 2 3 3 /* 4 * Copyright ©2003-2004 Axel Andersson4 * Copyright (c) 2003-2004 Axel Andersson 5 5 * All rights reserved. 6 6 * … … 27 27 */ 28 28 29 @class FH SplitView, FHBrowserView, FHImageView, FHFullscreenWindow;30 @class FH Settings, FHCache, FHHandler, FHFile;29 @class FHImageView, FHFullscreenWindow; 30 @class FHHandler, FHFile; 31 31 32 @interface FHController : NSWindowController { 33 IBOutlet FHSplitView *_splitView; 34 IBOutlet NSScrollView *_browserScrollView; 35 IBOutlet FHBrowserView *_browserView; 36 IBOutlet NSScrollView *_imageScrollView; 32 @interface FHController : ZAWindowController { 33 IBOutlet ZASplitView *_splitView; 34 IBOutlet NSScrollView *_leftView; 35 IBOutlet ZATableView *_tableView; 36 IBOutlet NSTableColumn *_fileTableColumn; 37 IBOutlet NSScrollView *_rightView; 37 38 IBOutlet NSImageView *_imageView; 38 39 39 IBOutlet NSPopUpButton *_menu;40 40 IBOutlet NSButton *_revealInFinderButton; 41 41 IBOutlet NSButton *_moveToTrashButton; 42 42 IBOutlet NSProgressIndicator *_progressIndicator; 43 IBOutlet NSPopUpButton *_menu; 43 44 44 45 IBOutlet NSTextField *_leftStatusTextField; … … 57 58 IBOutlet NSMatrix *_openURLExtractMatrix; 58 59 59 FHSettings *_settings;60 FHCache *_cache;61 62 60 FHFullscreenWindow *_fullscreenWindow; 63 61 FHHandler *_handler; 64 62 FHFile *_file; 65 63 64 NSTimer *_timer; 65 66 66 BOOL _openLast; 67 int _items;68 int _spinners;67 unsigned int _spinners; 68 unsigned int _menuItems; 69 69 } 70 70 71 71 72 #define FHFileKey @"FHFileKey" 73 #define FHImageKey @"FHImageKey" 74 72 + (FHController *) controller; 75 73 76 74 - (IBAction) open:(id)sender; 77 75 - (IBAction) openURL:(id)sender; 78 - (void) openFile:(FHFile *)file;79 76 - (IBAction) openParent:(id)sender; 80 77 - (IBAction) openMenu:(id)sender; 81 78 - (IBAction) openFile:(id)sender; 79 - (IBAction) previousImage:(id)sender; 80 - (IBAction) nextImage:(id)sender; 82 81 - (IBAction) reload:(id)sender; 83 82 - (IBAction) slideshow:(id)sender; … … 86 85 - (IBAction) delete:(id)sender; 87 86 88 - (IBAction) submitSheet:(id)sender;89 - (IBAction) cancelSheet:(id)sender;90 91 - (FHBrowserView *) browserView;92 - (FHHandler *) handler;93 - (FHImageView *) fullscreenImageView;94 95 - (void) startSlideshow;96 - (void) selectRow:(int)row;97 - (void) loadImage:(FHFile *)file;98 99 - (void) startSpinning;100 - (void) stopSpinning;101 - (void) update;102 - (void) updateButtons;103 - (void) updateVolumes;104 - (void) updateMenu;105 - (void) updateStatus;106 107 87 @end Footagehead/trunk/FHController.m
r900 r901 1 /* $Id: FHController.m,v 1.1 6 2004/10/30 16:48:53morris Exp $ */1 /* $Id: FHController.m,v 1.17 2004/12/03 12:29:49 morris Exp $ */ 2 2 3 3 /* 4 * Copyright ©2003-2004 Axel Andersson4 * Copyright (c) 2003-2004 Axel Andersson 5 5 * All rights reserved. 6 6 * … … 27 27 */ 28 28 29 #import "NSFileManagerAdditions.h" 30 #import "NSImageAdditions.h" 31 #import "NSStringAdditions.h" 29 #import "NSImage-FHAdditions.h" 32 30 #import "FHCache.h" 33 31 #import "FHController.h" 34 #import "FHBrowserCell.h"35 #import "FHBrowserView.h"36 32 #import "FHFile.h" 33 #import "FHFileCell.h" 37 34 #import "FHFullscreenWindow.h" 35 #import "FHHandler.h" 38 36 #import "FHImageView.h" 39 #import "FHHandler.h"40 37 #import "FHSettings.h" 41 #import "FHSplitView.h" 38 39 @interface FHController(Private) 40 41 static FHController *sharedController; 42 43 44 - (FHFile *) selectedFile; 45 - (FHFile *) fileAtIndex:(unsigned int)index; 46 47 - (void) loadURL:(NSURL *)url withHint:(FHHandlerHint)hint selectRow:(unsigned int)row; 48 - (void) loadFile:(FHFile *)file; 49 50 - (void) addMenuItemWithPath:(NSString *)path keyEquivalent:(NSString *)keyEquivalent; 51 - (void) reloadVolumesMenu; 52 - (void) reloadPathMenu; 53 54 - (void) startSpinning; 55 - (void) stopSpinning; 56 - (void) updateImage; 57 - (void) updateButtons; 58 - (void) updateStatus; 59 - (void) updateLeftStatus; 60 - (void) updateRightStatus; 61 - (void) updateFullscreenStatus; 62 - (void) updateTableView; 63 64 @end 65 42 66 43 67 @implementation FHController 68 69 + (FHController *)controller { 70 return sharedController; 71 } 72 73 44 74 45 75 - (void)awakeFromNib { 46 76 NSArray *screens; 47 NSMenuItem *item; 48 NSImage *icon; 49 NSString *path; 50 int i; 51 52 // --- create static classes 53 _settings = [[FHSettings alloc] init]; 54 _cache = [[FHCache alloc] init]; 55 56 // --- splitview position 57 [_splitView setAutosaveName:@"FHBrowser"]; 58 59 // --- window position 60 [self setWindowFrameAutosaveName:@"FHFootagehead"]; 77 FHFileCell *fileCell; 78 int i, count; 79 80 sharedController = self; 81 82 /// --- set custom cell type 83 fileCell = [[FHFileCell alloc] init]; 84 [_fileTableColumn setDataCell:fileCell]; 85 [fileCell release]; 86 87 // --- set up table view 88 [_tableView setDoubleAction:@selector(openFile:)]; 89 [_tableView setForwardAction:@selector(nextImage:)]; 90 [_tableView setBackAction:@selector(previousImage:)]; 91 [_tableView setDeleteAction:@selector(openParent:)]; 92 93 // --- set up split view 94 [_splitView setAutosaveName:@"Browser"]; 95 96 // --- thread spinner 97 [_progressIndicator setUsesThreadedAnimation:YES]; 98 99 // --- set up window 61 100 [self setShouldCascadeWindows:NO]; 62 63 // --- URL settings 101 [self setWindowFrameAutosaveName:@"Footagehead"]; 102 103 // --- set up URL panel 64 104 [_openURLExtractMatrix selectCellWithTag:[FHSettings intForKey:FHExtract]]; 65 105 66 // --- s creen settings106 // --- set up fullscreen panel 67 107 [_screenPopUpButton removeAllItems]; 68 108 screens = [NSScreen screens]; 69 70 for(i = 0; i < [screens count]; i++) { 109 count = [screens count]; 110 111 for(i = 0; i < count; i++) { 71 112 [_screenPopUpButton addItemWithTitle:[NSString stringWithFormat: 72 NSL ocalizedString(@"Screen %u, %.0fx%.0f", @""),113 NSLS(@"Screen %u, %.0fx%.0f", @""), 73 114 i + 1, 74 115 [[screens objectAtIndex:i] frame].size.width, … … 76 117 } 77 118 78 if([FHSettings intForKey:FHScreen] < [screens count])119 if([FHSettings intForKey:FHScreen] < count) 79 120 [_screenPopUpButton selectItemAtIndex:[FHSettings intForKey:FHScreen]]; 80 121 … … 83 124 [_screenAutoSwitchTextField setIntValue:[FHSettings intForKey:FHAutoSwitchTime]]; 84 125 85 // --- thread spinner86 [_progressIndicator setUsesThreadedAnimation:YES];87 88 126 // --- open last directory by default (unset if started by opening a file) 89 127 _openLast = YES; 90 128 91 // --- clearmenu129 // --- build menu 92 130 [_menu removeAllItems]; 93 94 // --- load disks to menu 95 [self updateVolumes]; 96 97 // --- add home directory to menu 98 path = NSHomeDirectory(); 99 item = [[NSMenuItem alloc] initWithTitle:[[NSFileManager defaultManager] displayNameAtPath:path] 100 action:@selector(openMenu:) 101 keyEquivalent:@"H"]; 102 icon = [[NSWorkspace sharedWorkspace] iconForFile:path]; 103 [icon setSize:NSMakeSize(16, 16)]; 104 [item setRepresentedObject:[NSURL fileURLWithPath:path]]; 105 [item setImage:icon]; 106 [[_menu menu] addItem:item]; 107 _items++; 108 [item release]; 109 110 // --- add desktop directory to menu 111 path = [NSHomeDirectory() stringByAppendingPathComponent:@"Desktop"]; 112 item = [[NSMenuItem alloc] initWithTitle:[[NSFileManager defaultManager] displayNameAtPath:path] 113 action:@selector(openMenu:) 114 keyEquivalent:@"d"]; 115 icon = [[NSWorkspace sharedWorkspace] iconForFile:path]; 116 [icon setSize:NSMakeSize(16, 16)]; 117 [item setRepresentedObject:[NSURL fileURLWithPath:path]]; 118 [item setImage:icon]; 119 [[_menu menu] addItem:item]; 120 _items++; 121 [item release]; 122 123 // --- add pictures directory to menu 124 path = [NSHomeDirectory() stringByAppendingPathComponent:@"Pictures"]; 125 item = [[NSMenuItem alloc] initWithTitle:[[NSFileManager defaultManager] displayNameAtPath:path] 126 action:@selector(openMenu:) 127 keyEquivalent:@"P"]; 128 icon = [[NSWorkspace sharedWorkspace] iconForFile:path]; 129 [icon setSize:NSMakeSize(16, 16)]; 130 [item setRepresentedObject:[NSURL fileURLWithPath:path]]; 131 [item setImage:icon]; 132 [[_menu menu] addItem:item]; 133 _items++; 134 [item release]; 135 136 // --- add spacer to menu 137 [[_menu menu] addItem:[NSMenuItem separatorItem]]; 138 _items++; 139 140 // --- register with these 131 [self reloadVolumesMenu]; 132 [self addMenuItemWithPath:@"~" keyEquivalent:@"H"]; 133 [self addMenuItemWithPath:@"~/Desktop" keyEquivalent:@"d"]; 134 [self addMenuItemWithPath:@"~/Pictures" keyEquivalent:@"P"]; 135 [_menu addItem:[NSMenuItem separatorItem]]; 136 _menuItems++; 137 138 // --- subscribe to these 141 139 [[[NSWorkspace sharedWorkspace] notificationCenter] 142 140 addObserver:self … … 150 148 name:NSWorkspaceDidUnmountNotification 151 149 object:NULL]; 150 151 [[NSNotificationCenter defaultCenter] 152 addObserver:self 153 selector:@selector(viewFrameDidChange:) 154 name:NSViewFrameDidChangeNotification 155 object:_tableView]; 156 157 // --- set from prefs 158 [self updateTableView]; 152 159 } 153 160 … … 157 164 158 165 - (void)applicationDidFinishLaunching:(NSNotification *)notification { 159 int hint;160 161 // --- get hint166 NSURL *url; 167 int hint; 168 162 169 hint = [FHSettings intForKey:FHOpenHint]; 163 170 164 171 // --- if option redirect to home 165 172 if((GetCurrentKeyModifiers() & optionKey) != 0) { 166 [FHSettings setObject:[[NSURL fileURLWithPath:NSHomeDirectory()] absoluteString] 167 forKey:FHOpenURL]; 168 169 hint = FHHandlerHintNone; 170 } 171 172 // --- go to last open directory 173 [FHSettings setObject:[[NSURL fileURLWithPath:NSHomeDirectory()] absoluteString] forKey:FHOpenURL]; 174 175 hint = FHHandlerHintFile; 176 } 177 173 178 if(_openLast) { 174 NSURL *url; 175 176 // --- start spinning 177 [self startSpinning]; 178 179 // --- get url 179 // --- get url of last open directory 180 180 url = [NSURL URLWithString:[FHSettings objectForKey:FHOpenURL]]; 181 181 182 if([url isFileURL] && ![ NSFileManagerdirectoryExistsAtPath:[url path]]) {182 if([url isFileURL] && ![[NSFileManager defaultManager] directoryExistsAtPath:[url path]]) { 183 183 url = [NSURL fileURLWithPath:NSHomeDirectory()]; 184 184 hint = FHHandlerHintNone; 185 185 } 186 186 187 // --- create handler 188 _handler = [[FHHandler alloc] initWithURL:url hint:hint]; 189 190 // --- set files 191  
