Changeset 6369

Show
Ignore:
Timestamp:
11/30/08 13:47:13 (1 month ago)
Author:
morris
Message:

Make preference window tabbed with toolbar

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Spiral/SPPreferencesController.h

    r5471 r6369  
    3030 
    3131@interface SPPreferencesController : WIWindowController { 
     32        IBOutlet NSView                                                 *_generalView; 
     33        IBOutlet NSView                                                 *_remotesView; 
     34         
    3235        IBOutlet NSButton                                               *_playMoviesWhenOpenedButton; 
    3336        IBOutlet NSButton                                               *_simplifyFilenamesButton; 
     
    4750        IBOutlet NSTextField                                    *_wiiRemoteTextField; 
    4851        IBOutlet NSProgressIndicator                    *_wiiRemoteProgressIndicator; 
     52         
     53        NSView                                                                  *_shownView; 
    4954} 
    5055 
    5156+ (SPPreferencesController *)preferencesController; 
     57 
     58- (IBAction)general:(id)sender; 
     59- (IBAction)remotes:(id)sender; 
    5260 
    5361- (IBAction)playMoviesWhenOpened:(id)sender; 
  • trunk/Spiral/SPPreferencesController.m

    r5823 r6369  
    3333@interface SPPreferencesController(Private) 
    3434 
     35- (void)_showView:(NSView *)view; 
     36 
    3537- (void)_updateFastForwardSpeedTextField; 
    3638- (void)_updatePS3RemoteStatus; 
     
    4143 
    4244@implementation SPPreferencesController(Private) 
     45 
     46- (void)_showView:(NSView *)view { 
     47        NSRect          frame; 
     48         
     49        if(view != _shownView) { 
     50                [_shownView removeFromSuperview]; 
     51                 
     52                [view setAlphaValue:0.0]; 
     53                [[[self window] contentView] addSubview:view]; 
     54                 
     55                frame = [[self window] frame]; 
     56                frame.size = [[self window] frameRectForContentRect:[view frame]].size; 
     57                frame.origin.y -= frame.size.height - [[self window] frame].size.height; 
     58                [[self window] setFrame:frame display:YES animate:YES]; 
     59                 
     60                [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:[[self window] animationResizeTime:frame]]]; 
     61                 
     62                [[view animator] setAlphaValue:1.0]; 
     63 
     64                _shownView = view; 
     65        } 
     66} 
     67 
     68 
     69 
     70#pragma mark - 
    4371 
    4472- (void)_updateFastForwardSpeedTextField { 
     
    159187        [[self window] center]; 
    160188         
     189        [self general:self]; 
     190 
    161191        [_playMoviesWhenOpenedButton setState:[SPSettings boolForKey:SPPlayMoviesWhenOpened]]; 
    162192        [_simplifyFilenamesButton setState:[SPSettings boolForKey:SPSimplifyFilenames]]; 
     
    221251 
    222252 
     253- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar { 
     254        NSMutableArray          *identifiers; 
     255        NSToolbarItem           *item; 
     256         
     257        identifiers = [NSMutableArray array]; 
     258         
     259        for(item in [toolbar items]) 
     260                [identifiers addObject:[item itemIdentifier]]; 
     261         
     262        return identifiers; 
     263} 
     264 
     265 
     266 
     267#pragma mark - 
     268 
     269- (IBAction)general:(id)sender { 
     270        [[self window] setTitle:NSLS(@"General", @"General preferences")]; 
     271 
     272        [self _showView:_generalView]; 
     273         
     274        [[[self window] toolbar] setSelectedItemIdentifier:[[[[self window] toolbar] itemWithTag:0] itemIdentifier]]; 
     275} 
     276 
     277 
     278 
     279- (IBAction)remotes:(id)sender { 
     280        [[self window] setTitle:NSLS(@"Remotes", @"Remote preferences")]; 
     281 
     282        [self _showView:_remotesView]; 
     283         
     284        [[[self window] toolbar] setSelectedItemIdentifier:[[[[self window] toolbar] itemWithTag:1] itemIdentifier]]; 
     285} 
     286 
     287 
     288 
    223289#pragma mark - 
    224290 
  • trunk/Spiral/Spiral.xcodeproj/project.pbxproj

    r6365 r6369  
    175175                A5E54A4B0CC2A8E800A608D1 /* SPFullscreenWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = A5E54A490CC2A8E800A608D1 /* SPFullscreenWindow.m */; }; 
    176176                A5F2F1E00EDCED790047BD9B /* PlaylistExportGroup.icns in Resources */ = {isa = PBXBuildFile; fileRef = A5F2F1DF0EDCED790047BD9B /* PlaylistExportGroup.icns */; }; 
     177                A5F2FB480EE2ACC50047BD9B /* General.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A5F2FB470EE2ACC50047BD9B /* General.tiff */; }; 
     178                A5F2FB4A0EE2ACD00047BD9B /* Remotes.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A5F2FB490EE2ACD00047BD9B /* Remotes.tiff */; }; 
    177179                A5F34DC50DB7F8EB004C3DF6 /* SPDrillItem.m in Sources */ = {isa = PBXBuildFile; fileRef = A5F34DC10DB7F8EB004C3DF6 /* SPDrillItem.m */; }; 
    178180                A5F34DC60DB7F8EB004C3DF6 /* SPDrillListView.m in Sources */ = {isa = PBXBuildFile; fileRef = A5F34DC20DB7F8EB004C3DF6 /* SPDrillListView.m */; }; 
     
    496498                A5E54A490CC2A8E800A608D1 /* SPFullscreenWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPFullscreenWindow.m; sourceTree = "<group>"; }; 
    497499                A5F2F1DF0EDCED790047BD9B /* PlaylistExportGroup.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = PlaylistExportGroup.icns; sourceTree = "<group>"; }; 
     500                A5F2FB470EE2ACC50047BD9B /* General.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = General.tiff; sourceTree = "<group>"; }; 
     501                A5F2FB490EE2ACD00047BD9B /* Remotes.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Remotes.tiff; sourceTree = "<group>"; }; 
    498502                A5F34DC10DB7F8EB004C3DF6 /* SPDrillItem.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = SPDrillItem.m; sourceTree = "<group>"; }; 
    499503                A5F34DC20DB7F8EB004C3DF6 /* SPDrillListView.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = SPDrillListView.m; sourceTree = "<group>"; }; 
     
    758762                        children = ( 
    759763                                A5373FCC0ED6EA61000B6C9E /* AppleTV.tiff */, 
     764                                A5F2FB470EE2ACC50047BD9B /* General.tiff */, 
    760765                                A599C6D70ECCC1AA001A0ACB /* HalfViewed.tiff */, 
    761766                                A569CB200CCAB5640046F90E /* HUDBackground.tiff */, 
     
    796801                                A56D50FB0DB7BD0200F1B2EF /* RemoteNoDeviceFound.tiff */, 
    797802                                A56D50FA0DB7BD0200F1B2EF /* RemoteNotConnected.tiff */, 
     803                                A5F2FB490EE2ACD00047BD9B /* Remotes.tiff */, 
    798804                                A5697FF30CC97A950046F90E /* RepeatAll.tiff */, 
    799805                                A5697FDA0CC978230046F90E /* RepeatOff.tiff */, 
     
    11481154                                A50E4A730CCD46CF0070EBAF /* wmv.icns in Resources */, 
    11491155                                A5373FCD0ED6EA61000B6C9E /* AppleTV.tiff in Resources */, 
     1156                                A5F2FB480EE2ACC50047BD9B /* General.tiff in Resources */, 
    11501157                                A569CB210CCAB5640046F90E /* HUDBackground.tiff in Resources */, 
    11511158                                A569CA610CCAAAD70046F90E /* HUDElapsedTimeBackground.tiff in Resources */, 
     
    11841191                                A56D50FE0DB7BD0200F1B2EF /* RemoteNoDeviceFound.tiff in Resources */, 
    11851192                                A56D50FD0DB7BD0200F1B2EF /* RemoteNotConnected.tiff in Resources */, 
     1193                                A5F2FB4A0EE2ACD00047BD9B /* Remotes.tiff in Resources */, 
    11861194                                A5697FDB0CC978230046F90E /* RepeatOff.tiff in Resources */, 
    11871195                                A5697FF40CC97A950046F90E /* RepeatAll.tiff in Resources */,