Index: trunk/Cocoa/AntiRSI/AntiRSI.m
===================================================================
--- trunk/Cocoa/AntiRSI/AntiRSI.m	(revision 329)
+++ trunk/Cocoa/AntiRSI/AntiRSI.m	(revision 330)
@@ -279,4 +279,7 @@
 				micro_pause_t += tick_time;
 				work_break_t += tick_time;
+                if (idle_time < 1) {
+                    session_t += tick_time;
+                }
 				micro_pause_taking_t = 0;
 				if (work_break_taking_t > 0) {
@@ -338,17 +341,11 @@
 			if (idle_time < 1 && !slack) {
 				micro_pause_taking_t = 0;
+                session_t += tick_time;
 			}
 				
 			// update window
-			[progress setDoubleValue:micro_pause_taking_t];
-			[self drawTimeLeft:micro_pause_duration - micro_pause_taking_t];
-			[self drawNextBreak:work_break_period - work_break_t];
-
-			// if user likes to be interrupted
-			if (lock_focus) {
-				[NSApp activateIgnoringOtherApps:YES];
-				[main_window makeKeyAndOrderFront:self];
-			}
-			
+            [self updateBreakWindowDuration:micro_pause_duration progress:micro_pause_taking_t
+                                  nextBreak:work_break_period - work_break_t];
+
 			// check if we done enough
 			if (micro_pause_taking_t > micro_pause_duration) {
@@ -375,16 +372,11 @@
 			if (idle_time >= 2 || work_break_taking_t < 3) {
 				work_break_taking_t += tick_time;
-			}
+			} else if (idle_time < 1) {
+                session_t += tick_time;
+            }
 			
 			// draw window
-			[progress setDoubleValue:work_break_taking_t / 60 - 0.5];
-			[self drawTimeLeft:work_break_duration - work_break_taking_t];
-			[self drawNextBreak:work_break_period + work_break_duration - work_break_taking_t];
-			
-			// if user likes to be interrupted
-			if (lock_focus) {
-				[NSApp activateIgnoringOtherApps:YES];
-				[main_window makeKeyAndOrderFront:self];
-			}
+            [self updateBreakWindowDuration:work_break_duration progress:work_break_taking_t
+                                  nextBreak:work_break_period + work_break_duration - work_break_taking_t];
 
 			// and check if we done enough
@@ -404,4 +396,11 @@
 	// draw dock image
 	if (draw_dock_image) [self drawDockImage];
+}
+
+// dock image
+- (NSMenu *)applicationDockMenu:(NSApplication *)sender;
+{
+    [session_time_item setTitle:[self sessionTimeString]];
+    return dock_menu;
 }
 
@@ -522,14 +521,23 @@
 }
 
-// diplays time left
-- (void)drawTimeLeft:(double)seconds
-{
-	[time setStringValue:[NSString stringWithFormat:@"%d:%02d", lrint(seconds) / 60, lrint(seconds) % 60]];
-}
-
-// displays next break
-- (void)drawNextBreak:(int)seconds
-{
-	int minutes = round(seconds / 60.0) ;
+- (NSString *)sessionTimeString;
+{
+    return [NSString stringWithFormat:@"Session: %d:%02d:%02d", (int)session_t / 3600, (int)session_t / 60, lrint(session_t) % 60];
+}
+
+- (void)updateBreakWindowDuration:(double)duration progress:(double)progress_t nextBreak:(double)nextBreak;
+{
+    // progress
+    [progress setDoubleValue:duration >= 60 ? (progress_t / 60 - 0.5) : progress_t];
+    
+    // time left
+    double timeLeft = duration - progress_t;
+	[time setStringValue:[NSString stringWithFormat:@"%d:%02d", (int)timeLeft / 60, lrint(timeLeft) % 60]];
+    
+    // cumulative typing time in this session (e.g. today)
+    [session_time setStringValue:[self sessionTimeString]];
+    
+    // next break
+	int minutes = round(nextBreak / 60.0);
 	
 	// nice hours, minutes ... 
@@ -540,4 +548,10 @@
 		[next_break setStringValue:[NSString stringWithFormat:@"next break in %d minutes", minutes]];
 	}
+
+    // if user likes to be interrupted
+    if (lock_focus) {
+        [NSApp activateIgnoringOtherApps:YES];
+        [main_window makeKeyAndOrderFront:self];
+    }
 }
 
@@ -597,19 +611,30 @@
 }
 
+- (IBAction)resetSession:(id)sender;
+{
+    if (s_normal != state) {
+        [self endBreak];
+    }
+    session_t = 0;
+}
+
 // validate menu items
 - (BOOL)validateMenuItem:(NSMenuItem *)anItem
 {
-	if ([[anItem title] isEqualToString:@"Take Break Now"] && state == s_normal) {
+	if ([anItem action] == @selector(breakNow:) && state == s_normal)
 		return YES;
-	}
-	
-	if ([[anItem title] isEqualToString:@"Postpone Break"] && state == s_taking_work_break) {
+	
+	if ([anItem action] == @selector(postpone:) && state == s_taking_work_break)
 		return YES;
-	}
-	
-	if ([[anItem title] isEqualToString:@"AntiRSI Help"]) {
+
+    if ([anItem action] == @selector(resetSession:))
 		return YES;
-	}
-	
+
+	if ([anItem action] == @selector(gotoWebsite:))
+		return YES;
+
+    if ([anItem action] == @selector(checkForUpdate:))
+		return YES;
+
 	return NO;
 }
