Commits

Anonymous committed 7f20881

Add total time to UI

Comments (0)

Files changed (5)

English.lproj/MyDocument.nib/classes.nib

-{
-    IBClasses = (
-        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 
-        {CLASS = IntervalFormatter; LANGUAGE = ObjC; SUPERCLASS = NSFormatter; }, 
-        {
-            CLASS = MyDocument; 
-            LANGUAGE = ObjC; 
-            OUTLETS = {tasksController = NSArrayController; }; 
-            SUPERCLASS = NSPersistentDocument; 
-        }, 
-        {CLASS = NSPersistentDocument; LANGUAGE = ObjC; SUPERCLASS = NSDocument; }
-    ); 
-    IBVersion = 1; 
-}
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>IBClasses</key>
+	<array>
+		<dict>
+			<key>CLASS</key>
+			<string>NSManagedObjectContext</string>
+			<key>LANGUAGE</key>
+			<string>ObjC</string>
+			<key>SUPERCLASS</key>
+			<string>NSObject</string>
+		</dict>
+		<dict>
+			<key>CLASS</key>
+			<string>FirstResponder</string>
+			<key>LANGUAGE</key>
+			<string>ObjC</string>
+			<key>SUPERCLASS</key>
+			<string>NSObject</string>
+		</dict>
+		<dict>
+			<key>CLASS</key>
+			<string>MyDocument</string>
+			<key>LANGUAGE</key>
+			<string>ObjC</string>
+			<key>OUTLETS</key>
+			<dict>
+				<key>tasksController</key>
+				<string>NSArrayController</string>
+			</dict>
+			<key>SUPERCLASS</key>
+			<string>NSPersistentDocument</string>
+		</dict>
+		<dict>
+			<key>CLASS</key>
+			<string>IntervalFormatter</string>
+			<key>LANGUAGE</key>
+			<string>ObjC</string>
+			<key>SUPERCLASS</key>
+			<string>NSFormatter</string>
+		</dict>
+		<dict>
+			<key>CLASS</key>
+			<string>NSPersistentDocument</string>
+			<key>LANGUAGE</key>
+			<string>ObjC</string>
+			<key>SUPERCLASS</key>
+			<string>NSDocument</string>
+		</dict>
+	</array>
+	<key>IBVersion</key>
+	<string>1</string>
+</dict>
+</plist>

English.lproj/MyDocument.nib/info.nib

 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-	<key>IBDocumentLocation</key>
-	<string>10 34 356 240 0 0 1440 878 </string>
 	<key>IBFramework Version</key>
-	<string>446.1</string>
+	<string>672</string>
+	<key>IBLastKnownRelativeProjectPath</key>
+	<string>../TaskTracker2.xcodeproj</string>
 	<key>IBOldestOS</key>
-	<integer>4</integer>
+	<integer>5</integer>
 	<key>IBOpenObjects</key>
 	<array>
-		<integer>5</integer>
+		<integer>6</integer>
 	</array>
 	<key>IBSystem Version</key>
-	<string>8N1037</string>
+	<string>9G55</string>
+	<key>targetFramework</key>
+	<string>IBCocoaFramework</string>
 </dict>
 </plist>

English.lproj/MyDocument.nib/keyedobjects.nib

Binary file modified.
 		}
 		if( changed ) {
 			[[self taskDocument] willChangeValueForKey:@"calcTotal"];
+			[[self taskDocument] willChangeValueForKey:@"calcInterval"];
 			[[self taskDocument] didChangeValueForKey:@"calcTotal"];
+			[[self taskDocument] didChangeValueForKey:@"calcInterval"];
 		}
 	}
 	[[moc undoManager] enableUndoRegistration];
 
 @implementation TaskDocumentMO
 
-- (double)calcTotal {
+- (NSTimeInterval)calcInterval {
 	NSTimeInterval totalSeconds = 0.0;
 	
 	nsenumerate ([[self managedObjectContext] executeFetchRequestNamed:@"billablePeriods" error:nil], TaskPeriodMO, period) {
 		totalSeconds += [period calcInterval];
 	}
-	
+	return totalSeconds;
+}
+
+- (double)calcTotal {
+	NSTimeInterval totalSeconds = [self calcInterval];
 	return calculateTotal( [[self valueForKey:@"dollarsPerHour"] doubleValue], totalSeconds );
 }