Growl for auto speed limit

This commit is contained in:
Mitchell Livingston 2006-08-08 03:04:25 +00:00
parent 5a3352be5c
commit 8a9e593121
1 changed files with 9 additions and 2 deletions

View File

@ -44,6 +44,7 @@
#define GROWL_DOWNLOAD_COMPLETE @"Download Complete" #define GROWL_DOWNLOAD_COMPLETE @"Download Complete"
#define GROWL_SEEDING_COMPLETE @"Seeding Complete" #define GROWL_SEEDING_COMPLETE @"Seeding Complete"
#define GROWL_AUTO_ADD @"Torrent Auto Added" #define GROWL_AUTO_ADD @"Torrent Auto Added"
#define GROWL_AUTO_SPEED_LIMIT @"Speed Limit Auto Changed"
#define TORRENT_TABLE_VIEW_DATA_TYPE @"TorrentTableViewDataType" #define TORRENT_TABLE_VIEW_DATA_TYPE @"TorrentTableViewDataType"
@ -1227,7 +1228,13 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
return; return;
if ([currentDate hourOfDay] == (fSpeedLimitEnabled ? offHour : onHour)) if ([currentDate hourOfDay] == (fSpeedLimitEnabled ? offHour : onHour))
{
[self toggleSpeedLimit: nil]; [self toggleSpeedLimit: nil];
[GrowlApplicationBridge notifyWithTitle: [@"Speed Limit Auto " stringByAppendingString:
fSpeedLimitEnabled ? @"Enabled" : @"Disabled"] description: @"Bandwidth settings changed"
notificationName: GROWL_AUTO_SPEED_LIMIT iconData: nil priority: 0 isSticky: NO clickContext: nil];
}
} }
- (void) setLimitGlobalEnabled: (id) sender - (void) setLimitGlobalEnabled: (id) sender
@ -2271,8 +2278,8 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
- (NSDictionary *) registrationDictionaryForGrowl - (NSDictionary *) registrationDictionaryForGrowl
{ {
NSArray * notifications = [NSArray arrayWithObjects: GROWL_DOWNLOAD_COMPLETE, NSArray * notifications = [NSArray arrayWithObjects: GROWL_DOWNLOAD_COMPLETE, GROWL_SEEDING_COMPLETE,
GROWL_SEEDING_COMPLETE, GROWL_AUTO_ADD, nil]; GROWL_AUTO_ADD, GROWL_AUTO_SPEED_LIMIT, nil];
return [NSDictionary dictionaryWithObjectsAndKeys: notifications, GROWL_NOTIFICATIONS_ALL, return [NSDictionary dictionaryWithObjectsAndKeys: notifications, GROWL_NOTIFICATIONS_ALL,
notifications, GROWL_NOTIFICATIONS_DEFAULT, nil]; notifications, GROWL_NOTIFICATIONS_DEFAULT, nil];
} }