Ignore:
Timestamp:
Apr 5, 2009, 3:55:20 PM (13 years ago)
Author:
livings124
Message:

a bit more Mac rpc work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/PrefsController.m

    r8147 r8150  
    744744}
    745745
     746+ (NSDate *) timeSumToDate: (NSInteger) sum
     747{
     748    NSDateComponents * comps = [[[NSDateComponents alloc] init] autorelease];
     749    [comps setHour: sum / 60];
     750    [comps setMinute: sum % 60];
     751   
     752    return [[NSCalendar currentCalendar] dateFromComponents: comps];
     753}
     754
    746755- (BOOL) control: (NSControl *) control textShouldBeginEditing: (NSText *) fieldEditor
    747756{
     
    12291238    #warning fix
    12301239    //alt speed limit enabled
    1231     /*const BOOL useAltSpeed = tr_sessionUsesAltSpeed(fHandle);
    1232     [fDefaults setBool: useAltSpeed forKey: @"SpeedLimit"];*/
     1240    const BOOL useAltSpeed = tr_sessionUsesAltSpeed(fHandle);
     1241    [fDefaults setBool: useAltSpeed forKey: @"SpeedLimit"];
    12331242   
    12341243    //alt speed limit - down
     
    12441253    [fDefaults setBool: useAltSpeedSched forKey: @"SpeedLimitAuto"];
    12451254   
    1246     #warning refactor schedule date?
    1247     /*NSDate * limitStartDate = [PrefsController timeSumToDate: tr_sessionGetAltSpeedBegin(fHandle)];
     1255    NSDate * limitStartDate = [PrefsController timeSumToDate: tr_sessionGetAltSpeedBegin(fHandle)];
    12481256    [fDefaults setObject: limitStartDate forKey: @"SpeedLimitAutoOnDate"];
    12491257   
    12501258    NSDate * limitEndDate = [PrefsController timeSumToDate: tr_sessionGetAltSpeedEnd(fHandle)];
    1251     [fDefaults setObject: limitEndDate forKey: @"SpeedLimitAutoOffDate"];*/
     1259    [fDefaults setObject: limitEndDate forKey: @"SpeedLimitAutoOffDate"];
    12521260   
    12531261    #warning refactor how to work with schedule day
    1254    
    1255     [[NSNotificationCenter defaultCenter] postNotificationName: @"SpeedLimitUpdate" object: nil];
    12561262   
    12571263    //blocklist
     
    13031309        [fRatioStopField setFloatValue: ratioLimit];
    13041310    }
     1311   
     1312    [[NSNotificationCenter defaultCenter] postNotificationName: @"SpeedLimitUpdate" object: nil];
    13051313}
    13061314
Note: See TracChangeset for help on using the changeset viewer.