Changeset 7672


Ignore:
Timestamp:
Jan 11, 2009, 9:17:05 PM (12 years ago)
Author:
livings124
Message:

(1.5x) #1533 Remember selected preferences view across sessions

Location:
branches/1.5x/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5x/macosx/PrefsController.m

    r7666 r7672  
    10631063- (void) setPrefView: (id) sender
    10641064{
    1065     NSView * view = fGeneralView;
     1065    NSString * identifier;
    10661066    if (sender)
    10671067    {
    1068         NSString * identifier = [sender itemIdentifier];
    1069         if ([identifier isEqualToString: TOOLBAR_TRANSFERS])
    1070             view = fTransfersView;
    1071         else if ([identifier isEqualToString: TOOLBAR_BANDWIDTH])
    1072             view = fBandwidthView;
    1073         else if ([identifier isEqualToString: TOOLBAR_PEERS])
    1074             view = fPeersView;
    1075         else if ([identifier isEqualToString: TOOLBAR_NETWORK])
    1076             view = fNetworkView;
    1077         else if ([identifier isEqualToString: TOOLBAR_REMOTE])
    1078             view = fRemoteView;
    1079         else; //general view already selected
    1080     }
     1068        identifier = [sender itemIdentifier];
     1069        [[NSUserDefaults standardUserDefaults] setObject: identifier forKey: @"SelectedPrefView"];
     1070    }
     1071    else
     1072        identifier = [[NSUserDefaults standardUserDefaults] stringForKey: @"SelectedPrefView"];
     1073   
     1074    NSView * view;
     1075    if ([identifier isEqualToString: TOOLBAR_TRANSFERS])
     1076        view = fTransfersView;
     1077    else if ([identifier isEqualToString: TOOLBAR_BANDWIDTH])
     1078        view = fBandwidthView;
     1079    else if ([identifier isEqualToString: TOOLBAR_PEERS])
     1080        view = fPeersView;
     1081    else if ([identifier isEqualToString: TOOLBAR_NETWORK])
     1082        view = fNetworkView;
     1083    else if ([identifier isEqualToString: TOOLBAR_REMOTE])
     1084        view = fRemoteView;
     1085    else
     1086    {
     1087        identifier = TOOLBAR_GENERAL; //general view is the default selected
     1088        view = fGeneralView;
     1089    }
     1090   
     1091    [[[self window] toolbar] setSelectedItemIdentifier: identifier];
    10811092   
    10821093    NSWindow * window = [self window];
  • branches/1.5x/macosx/PrefsWindow.m

    r4423 r7672  
    2929- (void) keyDown: (NSEvent *) event
    3030{
    31     [super keyDown: event];
    3231    if ([event keyCode] == 53) //esc key
    3332        [self close];
     33    else
     34        [super keyDown: event];
    3435}
    3536
Note: See TracChangeset for help on using the changeset viewer.