Changeset 4716

Show
Ignore:
Timestamp:
04/24/07 13:37:46 (1 year ago)
Author:
morris
Message:

Finalize Footagehead refactoring

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Footagehead/trunk/English.lproj/Browser.nib/classes.nib

    r4715 r4716  
    1919                "_contentBox" = NSBox;  
    2020                "_fileTableColumn" = NSTableColumn;  
    21                 "_imageView" = FHImageView;  
    2221                "_leftStatusTextField" = NSTextField;  
    2322                "_leftView" = NSView;  
     
    4746            CLASS = FHImageView;  
    4847            LANGUAGE = ObjC;  
    49             OUTLETS = {"_scrollView" = NSScrollView; };  
     48            OUTLETS = {"_delegate" = id; "_scrollView" = NSScrollView; };  
    5049            SUPERCLASS = NSView;  
    5150        },  
     
    6564            CLASS = FHWindowController;  
    6665            LANGUAGE = ObjC;  
     66            OUTLETS = {"_imageView" = FHImageView; };  
    6767            SUPERCLASS = WIWindowController;  
    6868        },  
  • Footagehead/trunk/English.lproj/Browser.nib/info.nib

    r4715 r4716  
    44<dict> 
    55        <key>IBDocumentLocation</key> 
    6         <string>1063 138 403 407 0 0 1920 1178 </string> 
     6        <string>1075 123 403 407 0 0 1920 1178 </string> 
    77        <key>IBEditorPositions</key> 
    88        <dict> 
     
    1414        <key>IBOpenObjects</key> 
    1515        <array> 
     16                <integer>52</integer> 
    1617                <integer>82</integer> 
    1718                <integer>65</integer> 
    18                 <integer>52</integer> 
    1919                <integer>7</integer> 
    2020        </array> 
  • Footagehead/trunk/English.lproj/MainMenu.nib/classes.nib

    r4709 r4716  
    11{ 
    22    IBClasses = ( 
    3         {CLASS = FHBrowserView; LANGUAGE = ObjC; SUPERCLASS = NSMatrix; },  
    43        { 
    5             CLASS = FHController;  
     4            CLASS = FHApplicationController;  
    65            LANGUAGE = ObjC;  
    76            OUTLETS = { 
    8                 "_contentBox" = NSBox;  
    9                 "_fileTableColumn" = NSTableColumn;  
    10                 "_fullscreenImageView" = FHImageView;  
    11                 "_fullscreenPanel" = NSPanel;  
    127                "_goMenu" = NSMenu;  
    13                 "_imageView" = FHImageView;  
    14                 "_leftStatusTextField" = NSTextField;  
    15                 "_leftView" = NSView;  
    16                 "_menu" = NSPopUpButton;  
    17                 "_moveToTrashButton" = NSButton;  
    18                 "_openSpotlightMenuItem" = NSMenuItem;  
    19                 "_openSpotlightPanel" = NSPanel;  
    20                 "_openSpotlightTextView" = NSTextView;  
    21                 "_openURLPanel" = NSPanel;  
    22                 "_openURLPopUpButton" = NSPopUpButton;  
    23                 "_openURLTextView" = NSTextView;  
    24                 "_progressIndicator" = NSProgressIndicator;  
    25                 "_revealInFinderButton" = NSButton;  
    26                 "_rightStatusTextField" = NSTextField;  
    27                 "_rightView" = NSView;  
    28                 "_screenAutoSwitchButton" = NSButton;  
    29                 "_screenAutoSwitchTextField" = NSTextField;  
    30                 "_screenBackgroundPopUpButton" = NSPopUpButton;  
    31                 "_screenPanel" = NSPanel;  
    32                 "_screenPopUpButton" = NSPopUpButton;  
    33                 "_scrollView" = NSScrollView;  
    34                 "_splitView" = WISplitView;  
    35                 "_statusBox" = NSBox;  
    36                 "_tableView" = WITableView;  
    378                "_toggleStatusBarMenuItem" = NSMenuItem;  
    389                "_viewMenu" = NSMenu;  
    39                 "_zoomButton" = NSButton;  
    4010            };  
    41             SUPERCLASS = NSObject;  
     11            SUPERCLASS = WIObject;  
    4212        },  
     13        {CLASS = FHBrowserView; LANGUAGE = ObjC; SUPERCLASS = NSMatrix; },  
    4314        { 
    4415            CLASS = FHImageView;  
     
    8556            SUPERCLASS = NSApplication;  
    8657        },  
     58        {CLASS = WIObject; LANGUAGE = ObjC; SUPERCLASS = NSObject; },  
    8759        {CLASS = WISplitView; LANGUAGE = ObjC; SUPERCLASS = NSSplitView; },  
    8860        { 
  • Footagehead/trunk/English.lproj/MainMenu.nib/info.nib

    r4709 r4716  
    1919        </array> 
    2020        <key>IBSystem Version</key> 
    21         <string>8P2137</string> 
     21        <string>8P135</string> 
    2222</dict> 
    2323</plist> 
  • Footagehead/trunk/English.lproj/ReleaseNotes.rtf

    r4714 r4716  
    1 {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf42
     1{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf41
    22{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; 
    33\f3\fnil\fcharset77 LucidaGrande;} 
  • Footagehead/trunk/English.lproj/Slideshow.nib/classes.nib

    r4715 r4716  
    1010            CLASS = FHSlideshowController;  
    1111            LANGUAGE = ObjC;  
    12             OUTLETS = {"_imageView" = FHImageView; };  
    1312            SUPERCLASS = FHWindowController;  
    1413        },  
     
    1716            CLASS = FHWindowController;  
    1817            LANGUAGE = ObjC;  
     18            OUTLETS = {"_imageView" = FHImageView; };  
    1919            SUPERCLASS = WIWindowController;  
    2020        },  
  • Footagehead/trunk/FHApplicationController.h

    r4715 r4716  
    2828 
    2929@class FHBrowserController; 
    30 @class FHImageView, FHSlideshowWindow; 
    31 @class FHHandler, FHFile; 
    3230 
    33 @interface FHController : NSObject { 
    34         IBOutlet NSMenuItem                             *_openSpotlightMenuItem; 
    35  
     31@interface FHApplicationController : WIObject { 
    3632        IBOutlet NSMenu                                 *_goMenu; 
    3733 
     
    3935        IBOutlet NSMenuItem                             *_toggleStatusBarMenuItem; 
    4036         
    41         IBOutlet NSBox                                  *_contentBox; 
    42         IBOutlet NSBox                                  *_statusBox; 
    43  
    44         IBOutlet WISplitView                    *_splitView; 
    45         IBOutlet NSView                                 *_leftView; 
    46         IBOutlet WITableView                    *_tableView; 
    47         IBOutlet NSTableColumn                  *_fileTableColumn; 
    48         IBOutlet NSView                                 *_rightView; 
    49         IBOutlet FHImageView                    *_imageView; 
    50         IBOutlet NSScrollView                   *_scrollView; 
    51          
    52         IBOutlet NSButton                               *_zoomButton; 
    53         IBOutlet NSButton                               *_revealInFinderButton; 
    54         IBOutlet NSButton                               *_moveToTrashButton; 
    55         IBOutlet NSProgressIndicator    *_progressIndicator; 
    56         IBOutlet NSPopUpButton                  *_menu; 
    57  
    58         IBOutlet NSTextField            *_leftStatusTextField; 
    59         IBOutlet NSTextField            *_rightStatusTextField; 
    60  
    61         IBOutlet NSPanel                                *_fullscreenPanel; 
    62         IBOutlet FHImageView                    *_fullscreenImageView; 
    63          
    64         IBOutlet NSPanel                                *_screenPanel; 
    65         IBOutlet NSPopUpButton                  *_screenPopUpButton; 
    66         IBOutlet NSPopUpButton                  *_screenBackgroundPopUpButton; 
    67         IBOutlet NSButton                               *_screenAutoSwitchButton; 
    68         IBOutlet NSTextField                    *_screenAutoSwitchTextField; 
    69  
    70         IBOutlet NSPanel                                *_openURLPanel; 
    71         IBOutlet NSTextView                             *_openURLTextView; 
    72         IBOutlet NSPopUpButton                  *_openURLPopUpButton; 
    73  
    74         IBOutlet NSPanel                                *_openSpotlightPanel; 
    75         IBOutlet NSTextView                             *_openSpotlightTextView; 
    76          
    77         FHBrowserController             *_browserController; 
    78  
    79         FHSlideshowWindow                               *_fullscreenWindow; 
    80         FHHandler                                               *_handler; 
    81          
    82         NSMutableDictionary                             *_toolbarItems; 
    83          
    84         NSTimer                                                 *_loadImageTimer; 
    85         NSConditionLock                                 *_loadImageLock; 
    86         NSConditionLock                                 *_loadThumbnailsLock; 
    87         unsigned int                                    _selectedRow; 
    88         unsigned int                                    _imageCounter; 
    89         unsigned int                                    _thumbnailsCounter; 
    90          
    91         WIEventQueue                                    *_queue; 
    92          
    93         NSSize                                                  _lastTableViewSize; 
     37        FHBrowserController                             *_browserController; 
    9438         
    9539        BOOL                                                    _openLastURL; 
    96         BOOL                                                    _switchingURL; 
    97         BOOL                                                    _deletingFile; 
    98         unsigned int                                    _spinners; 
    9940         
    10041        NSUInteger                                              _menuItems, _initialMenuItems; 
    10142} 
    10243 
    103  
    104 //- (IBAction)open:(id)sender; 
    105 //- (IBAction)openURL:(id)sender; 
    106 //- (IBAction)openSpotlight:(id)sender; 
    107  
    108 /*- (IBAction)openMenu:(id)sender; 
    109 - (IBAction)openFile:(id)sender; 
    110 - (IBAction)firstFile:(id)sender; 
    111 - (IBAction)lastFile:(id)sender; 
    112 - (IBAction)previousImage:(id)sender; 
    113 - (IBAction)nextImage:(id)sender; 
    114 - (IBAction)previousPage:(id)sender; 
    115 - (IBAction)nextPage:(id)sender; 
    116 - (IBAction)slideshow:(id)sender; 
    117 - (IBAction)autoSwitch:(id)sender; 
    118 */ 
    11944@end 
  • Footagehead/trunk/FHApplicationController.m

    r4715 r4716  
    2727 */ 
    2828 
    29 #import "NSImage-FHAdditions.h" 
     29#import "FHApplicationController.h" 
    3030#import "FHBrowserController.h" 
    31 #import "FHCache.h" 
    32 #import "FHController.h" 
    33 #import "FHFile.h" 
    34 #import "FHFileCell.h" 
    35 #import "FHSlideshowWindow.h" 
    3631#import "FHHandler.h" 
    37 #import "FHImage.h" 
    3832#import "FHImageView.h" 
    3933#import "FHSettings.h" 
    4034 
    41 @interface FHController(Private) 
     35@interface FHApplicationController(Private) 
    4236 
    4337- (void)_buildGoMenu; 
     
    4640- (void)_reloadPathsInGoMenuForHandler:(FHHandler *)handler; 
    4741 
    48 - (void)_startSpinning; 
    49 - (void)_stopSpinning; 
    50 - (void)_updateFullscreenStatus; 
    51  
    5242@end 
    5343 
    5444 
    55 @implementation FHController(Private) 
     45@implementation FHApplicationController(Private) 
    5646 
    5747- (void)_buildGoMenu { 
     
    180170} 
    181171 
    182  
    183  
    184 #pragma mark - 
    185  
    186 - (void)_loadFileTimer:(NSTimer *)timer { 
    187         NSArray         *files; 
    188         int                     i, count; 
    189         BOOL            next = NO; 
    190          
    191 //      [self nextImage:self]; 
    192          
    193         i = [_tableView selectedRow]; 
    194         files = [_handler files]; 
    195         count = [files count]; 
    196          
    197         while(i < count - 1) { 
    198                 if(![[files objectAtIndex:i] isDirectory]) { 
    199                         next = YES; 
    200                          
    201                         break; 
    202                 } 
    203         } 
    204          
    205         if(!next) 
    206                 [timer invalidate]; 
    207 } 
    208  
    209  
    210  
    211 #pragma mark - 
    212  
    213 - (void)_startSpinning { 
    214         if(_spinners == 0) 
    215                 [_progressIndicator startAnimation:self]; 
    216          
    217         _spinners++; 
    218 } 
    219  
    220  
    221  
    222 - (void)_stopSpinning { 
    223         _spinners--; 
    224          
    225         if(_spinners == 0) 
    226                 [_progressIndicator stopAnimation:self]; 
    227 } 
    228  
    229  
    230  
    231 - (void)_updateFullscreenStatus { 
    232 /*      NSArray                 *files; 
    233         FHFile                  *file; 
    234         unsigned int    i, count, index; 
    235          
    236         file = [self _selectedFile]; 
    237         files = [_handler files]; 
    238         count = [files count]; 
    239  
    240         for(i = index = 0; i < count; i++) { 
    241                 if(![[files objectAtIndex:i] isDirectory]) 
    242                         index++; 
    243                  
    244                 if([files objectAtIndex:i] == file) 
    245                         break; 
    246         } 
    247          
    248         [_fullscreenImageView setLabel:[NSSWF:NSLS(@"%@ %C %u/%u", @"'image.jpg - 1/10'"), 
    249                 [file name], 
    250                 0x2014, 
    251                 index, 
    252                 [_handler numberOfImages]]];*/ 
    253 } 
    254  
    255172@end 
    256173 
    257174 
    258 @implementation FHController 
     175@implementation FHApplicationController 
     176 
     177- (void)dealloc { 
     178        [_browserController release]; 
     179         
     180        [super dealloc]; 
     181
     182 
     183 
    259184 
    260185- (void)awakeFromNib { 
     
    325250- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)application { 
    326251        return YES; 
    327 } 
    328  
    329  
    330  
    331 - (void)applicationDidChangeScreenParameters:(NSNotification *)notification { 
    332 //      [self _reloadScreens]; 
    333252} 
    334253 
     
    368287 
    369288 
    370 - (void)windowWillClose:(NSNotification *)notification { 
    371 /*      if([notification object] == _fullscreenWindow) { 
    372                 [_loadImageTimer invalidate]; 
    373                 [_loadImageTimer release]; 
    374                 _loadImageTimer = NULL; 
    375  
    376 //              [self showWindow:self]; 
    377                  
    378                 _fullscreenWindow = NULL; 
    379  
    380                 [self _updateImage]; 
    381         }*/ 
    382 } 
    383  
    384  
    385  
    386289- (void)windowControllerDidLoadHandler:(NSNotification *)notification { 
    387290        [self _reloadPathsInGoMenuForHandler:[notification object]]; 
     
    412315} 
    413316 
    414  
    415  
    416 #pragma mark - 
    417  
    418 - (IBAction)slideshow:(id)sender { 
    419 /*      [NSApp beginSheet:_screenPanel 
    420            modalForWindow:[self window] 
    421                 modalDelegate:self 
    422            didEndSelector:@selector(slideshowPanelDidEnd:returnCode:contextInfo:) 
    423                   contextInfo:NULL];*/ 
    424 } 
    425  
    426  
    427  
    428 - (void)slideshowPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { 
    429 /*      NSScreen                *screen; 
    430         NSRect                  screenRect; 
    431         int                             screenNumber; 
    432  
    433         [_screenPanel close]; 
    434          
    435         if(returnCode == NSAlertDefaultReturn) { 
    436                 // --- save in prefs 
    437                 [FHSettings setInt:[_screenPopUpButton indexOfSelectedItem] forKey:FHFullscreenScreen]; 
    438                 [FHSettings setInt:[_screenBackgroundPopUpButton tagOfSelectedItem] forKey:FHFullscreenBackground]; 
    439                 [FHSettings setBool:[_screenAutoSwitchButton state] forKey:FHFullscreenAutoSwitch]; 
    440                 [FHSettings setInt:[_screenAutoSwitchTextField intValue] forKey:FHFullscreenAutoSwitchTime]; 
    441                  
    442                 // --- get screen 
    443                 screenNumber = [FHSettings intForKey:FHFullscreenScreen]; 
    444                  
    445                 if((unsigned int) screenNumber > [[NSScreen screens] count]) 
    446                         screenNumber = 0; 
    447                  
    448                 screen = [[NSScreen screens] objectAtIndex:screenNumber]; 
    449                 screenRect = [screen frame]; 
    450                 screenRect.origin.x = screenRect.origin.y = 0; 
    451                  
    452                 // --- create fullscreen window 
    453                 _fullscreenWindow = [[FHSlideshowWindow alloc] 
    454                         initWithContentRect:screenRect 
    455                                           styleMask:NSBorderlessWindowMask 
    456                                                 backing:NSBackingStoreBuffered 
    457                                                   defer:YES 
    458                                                  screen:screen]; 
    459                  
    460                 [_fullscreenWindow setLevel:NSScreenSaverWindowLevel]; 
    461                 [_fullscreenWindow setDelegate:self]; 
    462                 [_fullscreenWindow setReleasedWhenClosed:YES]; 
    463                 [_fullscreenWindow setTitle:[[self window] title]]; 
    464                 [_fullscreenImageView setBackgroundColor:[_screenBackgroundPopUpButton representedObjectOfSelectedItem]]; 
    465                 [_fullscreenImageView setImageScaling:[FHSettings intForKey:FHFullscreenImageScalingMethod]]; 
    466                 [_fullscreenImageView setImageRotation:[_imageView imageRotation]]; 
    467                 [_fullscreenPanel setFrame:screenRect display:NO]; 
    468                 [_fullscreenWindow setContentView:[[_fullscreenPanel contentView] retain]]; 
    469                 [[self window] orderOut:self]; 
    470                 [_fullscreenWindow makeKeyAndOrderFront:self]; 
    471                 [self _updateImage]; 
    472  
    473                 if([FHSettings boolForKey:FHFullscreenAutoSwitch]) { 
    474                         _loadImageTimer = [[NSTimer scheduledTimerWithTimeInterval:[FHSettings intForKey:FHFullscreenAutoSwitchTime] 
    475                                                                                                                                 target:self 
    476                                                                                                                           selector:@selector(_loadFileTimer:) 
    477                                                                                                                           userInfo:NULL 
    478                                                                                                                            repeats:YES] retain]; 
    479                 } 
    480         }*/ 
    481 } 
    482  
    483  
    484  
    485 - (IBAction)autoSwitch:(id)sender { 
    486         [_screenAutoSwitchTextField setEnabled:[_screenAutoSwitchButton state]]; 
    487 } 
    488  
    489317@end 
  • Footagehead/trunk/FHBrowserController.h

    r4715 r4716  
    2929#import "FHWindowController.h" 
    3030 
    31 @class FHTableView, FHImageView; 
    32 @class FHImageLoader, FHHandler; 
     31@class FHTableView; 
    3332 
    3433@interface FHBrowserController : FHWindowController { 
     
    3938        IBOutlet NSTableColumn                  *_fileTableColumn; 
    4039        IBOutlet NSView                                 *_rightView; 
    41         IBOutlet FHImageView                    *_imageView; 
    4240        IBOutlet NSScrollView                   *_scrollView; 
    4341 
     
    6260        IBOutlet NSTextField                    *_screenAutoSwitchTextField; 
    6361 
    64         FHImageLoader                                   *_imageLoader; 
    65         FHHandler                                               *_handler; 
    66          
    6762        NSMutableDictionary                             *_toolbarItems; 
    6863 
    6964        NSSize                                                  _tableViewSize; 
    7065        BOOL                                                    _deletingFile; 
     66        BOOL                                                    _switchingURL; 
     67        NSInteger                                               _previousRow; 
    7168} 
    7269 
     
    7976- (IBAction)openFile:(id)sender; 
    8077- (IBAction)openDirectory:(id)sender; 
    81 - (IBAction)firstFile:(id)sender; 
    82 - (IBAction)lastFile:(id)sender; 
    83 - (IBAction)previousImage:(id)sender; 
    84 - (IBAction)nextImage:(id)sender; 
    85 - (IBAction)previousPage:(id)sender; 
    86 - (IBAction)nextPage:(id)sender; 
    8778 
    8879- (IBAction)autoSwitch:(id)sender; 
  • Footagehead/trunk/FHBrowserController.m

    r4715 r4716  
    4343- (void)_resizeTableView; 
    4444- (void)_reloadScreens; 
     45- (void)_updateZoomModeToolbarItems; 
    4546- (void)_toggleStatusBar:(BOOL)show; 
    4647 
     
    5455- (void)_updateRightStatus; 
    5556 
    56 - (void)_showFile:(FHFile *)file; 
    57 - (void)_selectFileAtIndex:(NSUInteger)index; 
    58 - (FHFile *)_fileAtIndex:(NSUInteger)index; 
    59 - (FHFile *)_selectedFile; 
    60  
    6157@end 
    6258 
     
    7066        _toolbarItems = [[NSMutableDictionary alloc] init]; 
    7167 
    72         item = [NSToolbarItem toolbarItemWithIdentifier:@"OpenParent" 
    73                                                                                            name:NSLS(@"Open Parent", @"Open parent toolbar item") 
    74                                                                                         content:[NSImage imageNamed:@"OpenParent"] 
     68        item = [NSToolbarItem toolbarItemWithIdentifier:@"Parent" 
     69                                                                                           name:NSLS(@"Parent", @"Parent toolbar item") 
     70                                                                                        content:[NSImage imageNamed:@"Parent"] 
    7571                                                                                         target:self 
    7672                                                                                         action:@selector(openParent:)]; 
     
    10096        [_toolbarItems setObject:item forKey:[item itemIdentifier]]; 
    10197 
     98        item = [NSToolbarItem toolbarItemWithIdentifier:@"StretchToFit" 
     99                                                                                           name:NSLS(@"Stretch To Fit", @"Stretch to fit toolbar item") 
     100                                                                                        content:[NSImage imageNamed:@"StretchToFit"] 
     101                                                                                         target:self 
     102                                                                                         action:@selector(zoomMode:)]; 
     103        [item setTag:FHScaleStretchedProportionally]; 
     104        [_toolbarItems setObject:item forKey:[item itemIdentifier]]; 
     105 
    102106        item = [NSToolbarItem toolbarItemWithIdentifier:@"RotateLeft" 
    103107                                                                                           name:NSLS(@"Rotate Left", @"Rotate left toolbar item") 
     
    183187 
    184188 
     189- (void)_updateZoomModeToolbarItems { 
     190        switch([_imageView imageScaling]) { 
     191                case FHScaleNone: 
     192                        [[[self window] toolbar] setSelectedItemIdentifier:@"ActualSize"]; 
     193                        break; 
     194                         
     195                case FHScaleProportionally: 
     196                        [[[self window] toolbar] setSelectedItemIdentifier:@"ZoomToFit"]; 
     197                        break; 
     198                         
     199                case FHScaleStretchedProportionally: 
     200                        [[[self window] toolbar] setSelectedItemIdentifier:@"StretchToFit"]; 
     201                        break; 
     202                 
     203                default: 
     204                        [[[self window] toolbar] setSelectedItemIdentifier:NULL]; 
     205                        break; 
     206        } 
     207} 
     208 
     209 
     210 
    185211- (void)_toggleStatusBar:(BOOL)show { 
    186212        NSRect          frame; 
     
    232258        BOOL                    select; 
    233259         
    234 //     [self _startSpinning]
     260       _switchingURL = YES
    235261         
    236262        handler = [[FHHandler alloc] initHandlerWithURL:url]; 
    237263         
    238         if(!handler) { 
    239 //              [self _stopSpinning]; 
    240                  
     264        if(!handler) 
    241265                return; 
    242         } 
    243266 
    244267        if(_handler) { 
    245 //              if(![_handler isSynchronous] && ![_handler isFinished]) 
    246 //                      [self _stopSpinning]; 
    247                  
    248268                if([[_handler URL] isFileURL]) 
    249269                        [[WIEventQueue sharedQueue] removePath:[[_handler URL] path]]; 
     
    291311        if([_handler isLocal]) 
    292312                [_imageLoader startLoadingThumbnails]; 
    293  
    294 //      if([_handler isSynchronous]) 
    295 //              [self _stopSpinning]; 
     313         
     314        _switchingURL = NO; 
    296315} 
    297316 
     
    305324         
    306325        url = [[_handler URL] retain]; 
    307         file = [[[self _selectedFile] name] retain]; 
     326        file = [[[self selectedFile] name] retain]; 
    308327 
    309328        [[FHCache cache] dropThumbnailsForURL:url]; 
     
    374393         
    375394        string = [NSMutableString stringWithFormat:NSLS(@"%@, %.0fx%.0f", @"'image.jpg, 640x480'"), 
    376                 [[self _selectedFile] name], 
     395                [[self selectedFile] name], 
    377396                imageSize.width, 
    378397                imageSize.height]; 
     
    391410} 
    392411 
    393  
    394  
    395 #pragma mark - 
    396  
    397 - (void)_showFile:(FHFile *)file { 
    398         FHImage         *image; 
    399         BOOL            success; 
    400  
    401         if([file isLoaded]) { 
    402                 image = [file image]; 
    403                 success = (image && [image size].width > 0.0); 
    404                  
    405                 if(success) { 
    406                         [NSCursor setHiddenUntilMouseMoves:YES]; 
    407                         [_imageView setImage:image]; 
    408                         [self _updateRightStatus]; 
    409                 } else { 
    410                         [_imageView setImage:[FHImage imageNamed:@"Error"]]; 
    411                         [_rightStatusTextField setStringValue:[NSSWF:NSLS(@"error opening image", @"Error message")]]; 
    412                 } 
    413         } else { 
    414                 [_imageView setImage:NULL]; 
    415                 [self _updateRightStatus]; 
    416         } 
    417 } 
    418  
    419  
    420  
    421 - (void)_selectFileAtIndex:(NSUInteger)index { 
    422         [_tableView selectRow:index byExtendingSelection:NO]; 
    423         [_tableView scrollRowToVisible:index]; 
    424 } 
    425  
    426  
    427  
    428 - (FHFile *)_fileAtIndex:(NSUInteger)index { 
    429         return [[_handler files] objectAtIndex:index]; 
    430 } 
    431  
    432  
    433  
    434  
    435 - (FHFile *)_selectedFile { 
    436         NSInteger               row; 
    437          
    438         row = [_tableView selectedRow]; 
    439          
    440         if(row < 0) 
    441                 return NULL; 
    442          
    443         return [self _fileAtIndex:row]; 
    444 } 
    445  
    446412@end 
    447413 
     
    453419        self = [super initWithWindowNibName:@"Browser"]; 
    454420         
    455         _imageLoader = [[FHImageLoader alloc] init]; 
    456         [_imageLoader setDelegate:self]; 
    457          
    458421        [self window]; 
    459422         
     
    464427 
    465428- (void)dealloc { 
    466         [_imageLoader release]; 
    467429        [_toolbarItems release]; 
    468          
    469         [_handler release]; 
    470430         
    471431        [super dealloc]; 
     
    479439        [[self window] setToolbar:[self _toolbar]]; 
    480440         
     441        [self _updateZoomModeToolbarItems]; 
     442 
    481443        [self setShouldCascadeWindows:NO]; 
    482444        [self setWindowFrameAutosaveName:@"Footagehead"]; 
     
    584546 
    585547- (void)handlerDidFinishLoading:(FHHandler *)handler { 
    586 //      [self _stopSpinning]; 
    587548} 
    588549 
     
    590551 
    591552- (void)imageLoaderDidLoadImageForFile:(FHFile *)file { 
    592         if(file == [self _selectedFile]) 
    593                 [self _showFile:file]; 
     553        if(file == [self selectedFile]) 
     554                [self showFile:file]; 
    594555} 
    595556 
     
    627588- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar { 
    628589        return [NSArray arrayWithObjects: 
    629                 @"OpenParent", 
    630                 @"Slideshow", 
     590                @"Parent", 
    631591                @"Reload", 
     592                NSToolbarSeparatorItemIdentifier, 
     593                @"ActualSize", 
     594                @"ZoomToFit", 
     595                @"StretchToFit", 
    632596                NSToolbarSeparatorItemIdentifier, 
    633597                @"RotateLeft", 
    634598                @"RotateRight", 
    635599                NSToolbarSeparatorItemIdentifier, 
    636                 @"ActualSize", 
    637                 @"ZoomToFit", 
    638                 NSToolbarSeparatorItemIdentifier, 
     600                @"Slideshow", 
    639601                @"RevealInFinder", 
    640602                @"MoveToTrash", 
     
    648610- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar { 
    649611        return [NSArray arrayWithObjects: 
    650                 @"OpenParent", 
     612                @"Parent", 
    651613                @"Reload", 
    652614                @"ActualSize", 
    653615                @"ZoomToFit", 
     616                @"StretchToFit", 
    654617                @"RotateLeft", 
    655618                @"RotateRight", 
     619                @"Slideshow", 
    656620                @"RevealInFinder", 
    657621                @"MoveToTrash", 
    658                 @"Slideshow", 
    659622                NSToolbarSeparatorItemIdentifier, 
    660623                NSToolbarSpaceItemIdentifier, 
    661624                NSToolbarFlexibleSpaceItemIdentifier, 
    662625                NSToolbarCustomizeToolbarItemIdentifier, 
     626                NULL]; 
     627} 
     628 
     629 
     630 
     631- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar { 
     632        return [NSArray arrayWithObjects: 
     633                @"ActualSize", 
     634                @"ZoomToFit", 
     635                @"StretchToFit", 
    663636                NULL]; 
    664637} 
     
    726699#pragma mark - 
    727700 
     701- (NSUInteger)selectedIndex { 
     702        NSInteger       row; 
     703         
     704        row = [_tableView selectedRow]; 
     705         
     706        return (row < 0) ? NSNotFound : row; 
     707} 
     708 
     709 
     710 
     711- (void)selectFileAtIndex:(NSUInteger)index { 
     712        [_tableView selectRow:index byExtendingSelection:NO]; 
     713        [_tableView scrollRowToVisible:index]; 
     714} 
     715 
     716 
     717 
     718- (void)updateFileStatus { 
     719        [NSCursor setHiddenUntilMouseMoves:YES]; 
     720 
     721        [self _updateRightStatus]; 
     722} 
     723 
     724 
     725 
     726#pragma mark - 
     727 
    728728- (BOOL)validateSelector:(SEL)selector { 
    729729        if(selector == @selector(openParent:)) { 
     
    733733                      &n