mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
a bit more Mac rpc work
This commit is contained in:
parent
3ef8240b80
commit
555617a93c
2 changed files with 16 additions and 7 deletions
|
@ -120,6 +120,7 @@
|
|||
- (void) setAutoSpeedLimitDay: (id) sender;
|
||||
- (void) updateAutoSpeedLimitDay;
|
||||
+ (NSInteger) dateToTimeSum: (NSDate *) date;
|
||||
+ (NSDate *) timeSumToDate: (NSInteger) sum;
|
||||
|
||||
- (void) setAutoImport: (id) sender;
|
||||
- (void) importFolderSheetShow: (id) sender;
|
||||
|
|
|
@ -743,6 +743,15 @@ tr_session * fHandle;
|
|||
return [components hour] * 60 + [components minute];
|
||||
}
|
||||
|
||||
+ (NSDate *) timeSumToDate: (NSInteger) sum
|
||||
{
|
||||
NSDateComponents * comps = [[[NSDateComponents alloc] init] autorelease];
|
||||
[comps setHour: sum / 60];
|
||||
[comps setMinute: sum % 60];
|
||||
|
||||
return [[NSCalendar currentCalendar] dateFromComponents: comps];
|
||||
}
|
||||
|
||||
- (BOOL) control: (NSControl *) control textShouldBeginEditing: (NSText *) fieldEditor
|
||||
{
|
||||
[fInitialString release];
|
||||
|
@ -1228,8 +1237,8 @@ tr_session * fHandle;
|
|||
|
||||
#warning fix
|
||||
//alt speed limit enabled
|
||||
/*const BOOL useAltSpeed = tr_sessionUsesAltSpeed(fHandle);
|
||||
[fDefaults setBool: useAltSpeed forKey: @"SpeedLimit"];*/
|
||||
const BOOL useAltSpeed = tr_sessionUsesAltSpeed(fHandle);
|
||||
[fDefaults setBool: useAltSpeed forKey: @"SpeedLimit"];
|
||||
|
||||
//alt speed limit - down
|
||||
const int downLimitAlt = tr_sessionGetAltSpeed(fHandle, TR_DOWN);
|
||||
|
@ -1243,17 +1252,14 @@ tr_session * fHandle;
|
|||
const BOOL useAltSpeedSched = tr_sessionUsesAltSpeedTime(fHandle);
|
||||
[fDefaults setBool: useAltSpeedSched forKey: @"SpeedLimitAuto"];
|
||||
|
||||
#warning refactor schedule date?
|
||||
/*NSDate * limitStartDate = [PrefsController timeSumToDate: tr_sessionGetAltSpeedBegin(fHandle)];
|
||||
NSDate * limitStartDate = [PrefsController timeSumToDate: tr_sessionGetAltSpeedBegin(fHandle)];
|
||||
[fDefaults setObject: limitStartDate forKey: @"SpeedLimitAutoOnDate"];
|
||||
|
||||
NSDate * limitEndDate = [PrefsController timeSumToDate: tr_sessionGetAltSpeedEnd(fHandle)];
|
||||
[fDefaults setObject: limitEndDate forKey: @"SpeedLimitAutoOffDate"];*/
|
||||
[fDefaults setObject: limitEndDate forKey: @"SpeedLimitAutoOffDate"];
|
||||
|
||||
#warning refactor how to work with schedule day
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName: @"SpeedLimitUpdate" object: nil];
|
||||
|
||||
//blocklist
|
||||
const BOOL blocklist = tr_blocklistIsEnabled(fHandle);
|
||||
[fDefaults setBool: blocklist forKey: @"Blocklist"];
|
||||
|
@ -1302,6 +1308,8 @@ tr_session * fHandle;
|
|||
//ratio limit enabled handled by bindings
|
||||
[fRatioStopField setFloatValue: ratioLimit];
|
||||
}
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName: @"SpeedLimitUpdate" object: nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue