Ignore:
Timestamp:
Aug 11, 2006, 10:58:14 PM (16 years ago)
Author:
livings124
Message:

Scheduler is now more automatic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/PrefsController.m

    r746 r752  
    171171   
    172172    //set auto speed limit
    173     BOOL speedLimitAutoOn = [fDefaults boolForKey: @"SpeedLimitAutoOn"];
     173    BOOL speedLimitAuto = [fDefaults boolForKey: @"SpeedLimitAuto"];
     174    [fSpeedLimitAutoCheck setState: speedLimitAuto];
     175   
    174176    int speedLimitAutoOnHour = [fDefaults integerForKey: @"SpeedLimitAutoOnHour"];
    175    
    176     [fSpeedLimitAutoOnCheck setState: speedLimitAutoOn];
    177177    [fSpeedLimitAutoOnField setIntValue: speedLimitAutoOnHour];
    178     [fSpeedLimitAutoOnField setEnabled: speedLimitAutoOn];
    179    
    180     BOOL speedLimitAutoOff = [fDefaults boolForKey: @"SpeedLimitAutoOff"];
     178    [fSpeedLimitAutoOnField setEnabled: speedLimitAuto];
     179   
    181180    int speedLimitAutoOffHour = [fDefaults integerForKey: @"SpeedLimitAutoOffHour"];
    182    
    183     [fSpeedLimitAutoOffCheck setState: speedLimitAutoOff];
    184181    [fSpeedLimitAutoOffField setIntValue: speedLimitAutoOffHour];
    185     [fSpeedLimitAutoOffField setEnabled: speedLimitAutoOff];
     182    [fSpeedLimitAutoOffField setEnabled: speedLimitAuto];
    186183   
    187184    //set ratio limit
     
    500497- (void) setAutoSpeedLimitCheck: (id) sender
    501498{
    502     NSString * key;
    503     NSTextField * field;
    504     if (sender == fSpeedLimitAutoOnCheck)
    505     {
    506         key = @"SpeedLimitAutoOn";
    507         field = fSpeedLimitAutoOnField;
    508     }
    509     else
    510     {
    511         key = @"SpeedLimitAutoOff";
    512         field = fSpeedLimitAutoOffField;
    513     }
    514    
    515499    BOOL check = [sender state] == NSOnState;
    516     [self setAutoSpeedLimitHour: field];
    517     [field setEnabled: check];
    518    
    519     [fDefaults setBool: check forKey: key];
     500   
     501    [fDefaults setBool: check forKey: @"SpeedLimitAuto"];
     502
     503    [self setAutoSpeedLimitHour: fSpeedLimitAutoOnField];
     504    [fSpeedLimitAutoOnField setEnabled: check];
     505   
     506    [self setAutoSpeedLimitHour: fSpeedLimitAutoOffField];
     507    [fSpeedLimitAutoOffField setEnabled: check];
    520508}
    521509
     
    533521    else
    534522        [fDefaults setInteger: hour forKey: key];
     523   
     524    [[NSNotificationCenter defaultCenter] postNotificationName: @"AutoSpeedLimitChange" object: self];
    535525}
    536526
Note: See TracChangeset for help on using the changeset viewer.