Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 3b1f8dbc6f
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (25 sloc) 1.039 kB
#import "TomatoDock.h"
#import "TomatoTimer.h"
@implementation TomatoDock
- (BOOL)isEnabled {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"TOMDock"];
}
- (void)unwatchTomato {
[super unwatchTomato];
[[[NSApplication sharedApplication] dockTile] setBadgeLabel:@""];
}
- (void)tomatoPopped:(NSNotification *)notification {
[[[NSApplication sharedApplication] dockTile] setBadgeLabel:@""];
}
- (void)tomatoTick:(NSNotification *)notification {
TomatoTimer *timer = [notification object];
if (timer.status == TOMATORUNNING) {
[[[NSApplication sharedApplication] dockTile] setBadgeLabel:[NSString stringWithFormat:@"%02d:%02d", (timer.remaining / 60), (timer.remaining % 60)]];
}
}
- (void)tomatoEnded:(NSNotification *)notification {
[[[NSApplication sharedApplication] dockTile] setBadgeLabel:@""];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"TOMDockBounce"])
[[NSApplication sharedApplication] requestUserAttention:NSCriticalRequest];
}
@end
Jump to Line
Something went wrong with that request. Please try again.