Changeset 105
- Timestamp:
- 08/12/07 22:18:15 (1 year ago)
- Files:
-
- branches/robert/English.lproj/Localizable.strings (modified) (1 diff)
- branches/robert/GrowlNotificationController.h (modified) (1 diff)
- branches/robert/GrowlNotificationController.m (modified) (3 diffs)
- branches/robert/TunnelController.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/robert/English.lproj/Localizable.strings
r64 r105 112 112 113 113 "UnknownHostKey" = "Unknown Host Key"; 114 115 "TunnelOpened" = "Tunnel Opened"; 116 "TunnelHasBeenOpened" = "The tunnel has been opened."; 117 "TunnelClosed" = "Tunnel Closed"; 118 "TunnelHasBeenClosed" = "The tunnel has been closed."; 119 "TunnelRestart" = "Tunnel Restart"; 120 "TunnelIsBeeingRestarted" = "The tunnel is beeing restarted."; branches/robert/GrowlNotificationController.h
r104 r105 12 12 13 13 /* events */ 14 - (void) tunnelOpened; 14 - (void) tunnelOpened:(NSString *) tunnelName; 15 - (void) tunnelClosed:(NSString *) tunnelName; 16 - (void) tunnelRestart:(NSString *) tunnelName; 15 17 - (void) warningWithTitle:(NSString *)title andMessage:(NSString *)message; 16 18 @end branches/robert/GrowlNotificationController.m
r104 r105 1 1 #import "GrowlNotificationController.h" 2 2 #import "PreferenceController.h" 3 4 /* This function resides in Controller.m. */ 5 extern NSString *local(NSString *theString); 3 6 4 7 @implementation GrowlNotificationController … … 13 16 NSArray *notifications; 14 17 15 notifications = [NSArray arrayWithObjects: @"Tunnel Opened", @" Warning", nil];18 notifications = [NSArray arrayWithObjects: @"Tunnel Opened", @"Tunnel Closed", @"Tunnel Restart", @"Warning", nil]; 16 19 17 20 NSDictionary *dict; … … 28 31 } 29 32 30 - (void) tunnelOpened 33 - (void) tunnelOpened:(NSString *) tunnelName 31 34 { 32 35 if ([self isOn]) { 33 36 [GrowlApplicationBridge 34 notifyWithTitle: @"Tunnel Opened"35 description: @"Yuppi!"37 notifyWithTitle:local(@"TunnelOpened") 38 description:[NSString stringWithFormat: @"(%@) %@", tunnelName, local(@"TunnelHasBeenOpened")] 36 39 notificationName:@"Tunnel Opened" 40 iconData:nil 41 priority:0 42 isSticky:NO 43 clickContext:nil]; 44 } 45 } 46 47 - (void) tunnelClosed:(NSString *) tunnelName 48 { 49 if ([self isOn]) { 50 [GrowlApplicationBridge 51 notifyWithTitle:local(@"TunnelClosed") 52 description:[NSString stringWithFormat: @"(%@) %@", tunnelName, local(@"TunnelHasBeenClosed")] 53 notificationName:@"Tunnel Closed" 54 iconData:nil 55 priority:0 56 isSticky:NO 57 clickContext:nil]; 58 } 59 } 60 61 - (void) tunnelRestart:(NSString *) tunnelName 62 { 63 if ([self isOn]) { 64 [GrowlApplicationBridge 65 notifyWithTitle:local(@"TunnelRestart") 66 description:[NSString stringWithFormat: @"(%@) %@", tunnelName, local(@"TunnelIsBeeingRestarted")] 67 notificationName:@"Tunnel Restart" 37 68 iconData:nil 38 69 priority:0 branches/robert/TunnelController.m
r104 r105 325 325 326 326 [tunnel closeTunnel]; 327 328 [growlNotificationController tunnelClosed:[aTunnel objectForKey:@"TunnelName"]]; 327 329 328 330 [dict removeObjectForKey:@"TunnelObject"]; … … 528 530 withInfo:[dict objectForKey:@"TunnelUUID"]]; 529 531 532 if ([dict objectForKey:@"LastTerminated"]) { 533 [growlNotificationController tunnelRestart: [dict objectForKey:@"TunnelName"]]; 534 } 535 530 536 if([tunnel openTunnel]) 531 537 { … … 540 546 [self setToolTipForActiveTunnels]; 541 547 542 [growlNotificationController tunnelOpened]; 548 if (! [dict objectForKey:@"LastTerminated"]) { 549 [growlNotificationController tunnelOpened: [dict objectForKey:@"TunnelName"]]; 550 } 543 551 } 544 552 /* Either the dictionary has it, or it didn't work and we don't want it. */
