1
0
Fork 0

Stopping of refresh timer while the menu is updating

master
Matthieu Lalonde 13 years ago
parent 355c28895d
commit bc547d0c36

@ -166,9 +166,9 @@
- (void) setMenubarText:(NSString *)menubarText - (void) setMenubarText:(NSString *)menubarText
{ {
// Todo set proper line height // TODO set proper line height and proper right align
NSFontManager *fontManager = [NSFontManager sharedFontManager]; NSFontManager *fontManager = [NSFontManager sharedFontManager];
NSFont *menuFont = [fontManager fontWithFamily:@"Lucida Grande" traits:NSBoldFontMask weight:10 size:8]; NSFont *menuFont = [fontManager fontWithFamily:@"Lucida Grande" traits:NSBoldFontMask weight:10 size:8 ];
NSDictionary *titleAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:menuFont, NSFontAttributeName, NSDictionary *titleAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:menuFont, NSFontAttributeName,
[NSColor blackColor], NSForegroundColorAttributeName, nil]; [NSColor blackColor], NSForegroundColorAttributeName, nil];
@ -415,6 +415,8 @@
- (void) refreshMenu:(id)sender - (void) refreshMenu:(id)sender
{ {
NSLog(@"Refresh Menu"); NSLog(@"Refresh Menu");
[_readTimer invalidate];
_readTimer = nil;
[wrt_client getStatusUpdate:@"Status_Router.live.asp" delegate:self callback:@selector(doUpdateStatus:)]; [wrt_client getStatusUpdate:@"Status_Router.live.asp" delegate:self callback:@selector(doUpdateStatus:)];
@ -605,6 +607,9 @@
} }
[_appMenu popUpStatusItemMenu:AppMenu]; [_appMenu popUpStatusItemMenu:AppMenu];
_readTimer = [NSTimer scheduledTimerWithTimeInterval:refreshTime+1 target:self selector:@selector(updateThroughput:) userInfo:nil repeats:YES];
[_readTimer fire];
} }
- (IBAction) copyParentMenuTitle:(id)sender - (IBAction) copyParentMenuTitle:(id)sender

Loading…
Cancel
Save