Some cleanup here and there.

This commit is contained in:
Mitchell Livingston 2006-10-21 20:09:28 +00:00
parent f5a6f4309e
commit baee0d4398
2 changed files with 9 additions and 6 deletions

View File

@ -54,7 +54,7 @@
#define WINDOW_REGULAR_WIDTH 468.0 #define WINDOW_REGULAR_WIDTH 468.0
#define UPDATE_UI_SECONDS 1.0 #define UPDATE_UI_SECONDS 1.0
#define AUTO_SPEED_LIMIT_SECONDS 10.0 #define AUTO_SPEED_LIMIT_SECONDS 5.0
#define WEBSITE_URL @"http://transmission.m0k.org/" #define WEBSITE_URL @"http://transmission.m0k.org/"
#define FORUM_URL @"http://transmission.m0k.org/forum/" #define FORUM_URL @"http://transmission.m0k.org/forum/"
@ -1328,13 +1328,14 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
//toggle if within first few seconds of hour //toggle if within first few seconds of hour
NSCalendarDate * currentDate = [NSCalendarDate calendarDate]; NSCalendarDate * currentDate = [NSCalendarDate calendarDate];
if ([currentDate minuteOfHour] == 0 && [currentDate secondOfMinute] < AUTO_SPEED_LIMIT_SECONDS if ([currentDate minuteOfHour] == 0 && [currentDate secondOfMinute] < AUTO_SPEED_LIMIT_SECONDS
&& [currentDate hourOfDay] == (fSpeedLimitEnabled ? [fDefaults integerForKey: @"SpeedLimitAutoOffHour"] && [currentDate hourOfDay] == [fDefaults integerForKey: fSpeedLimitEnabled
: [fDefaults integerForKey: @"SpeedLimitAutoOnHour"])) ? @"SpeedLimitAutoOffHour" : @"SpeedLimitAutoOnHour"])
{ {
[self toggleSpeedLimit: nil]; [self toggleSpeedLimit: nil];
[GrowlApplicationBridge notifyWithTitle: [@"Speed Limit Auto " stringByAppendingString: [GrowlApplicationBridge notifyWithTitle: fSpeedLimitEnabled
fSpeedLimitEnabled ? @"Enabled" : @"Disabled"] description: @"Bandwidth settings changed" ? @"Speed Limit Auto Enabled" : @"Speed Limit Auto Disabled"
description: @"Bandwidth settings changed"
notificationName: GROWL_AUTO_SPEED_LIMIT iconData: nil priority: 0 isSticky: NO clickContext: nil]; notificationName: GROWL_AUTO_SPEED_LIMIT iconData: nil priority: 0 isSticky: NO clickContext: nil];
} }
} }

View File

@ -45,6 +45,8 @@
#define TAB_FILES_HEIGHT 260.0 #define TAB_FILES_HEIGHT 260.0
#define TAB_OPTIONS_HEIGHT 83.0 #define TAB_OPTIONS_HEIGHT 83.0
#define INVALID -99
@interface InfoWindowController (Private) @interface InfoWindowController (Private)
- (void) updateInfoActivity; - (void) updateInfoActivity;
@ -322,7 +324,7 @@
{ {
NSEnumerator * enumerator = [fTorrents objectEnumerator]; NSEnumerator * enumerator = [fTorrents objectEnumerator];
Torrent * torrent = [enumerator nextObject]; //first torrent Torrent * torrent = [enumerator nextObject]; //first torrent
const int INVALID = -99;
int ratioSetting = [torrent stopRatioSetting]; int ratioSetting = [torrent stopRatioSetting];
float ratioLimit = [torrent ratioLimit]; float ratioLimit = [torrent ratioLimit];