├── .gitignore ├── khronos.icns ├── Graphics ├── edit.gif ├── minus.gif ├── plus.gif ├── jobPause.png ├── jobActive.png ├── stst_null.png ├── stst_pause.png ├── stst_start.png ├── stst_stop.png ├── jobInactive.png ├── showSessions.gif ├── showSessions2.png ├── stst_nullMB.png ├── stst_pause2.png ├── stst_pause2MB.png ├── stst_playMB.png ├── stst_startMB.png ├── stst_stopMB.png ├── MBjobSelector3.png ├── MBjobSelector3Alt.png └── stst_nullPauseMB.png ├── MBjobSelector3Alt.png ├── support ├── i │ ├── appEdit.gif │ ├── appPlus.gif │ ├── appStop.gif │ ├── 2appPause.gif │ ├── appMinus.gif │ ├── appStart.gif │ ├── 2appMenuBar.gif │ ├── 2appUnpause.gif │ ├── app4buttons.gif │ ├── appAddSheet.gif │ ├── appComments.gif │ ├── appSessions.gif │ └── 2appMenuBarMenuing.gif ├── khelp.css └── index.html ├── English.lproj ├── InfoPlist.strings ├── MainMenu.nib │ ├── keyedobjects.nib │ ├── info.nib │ └── classes.nib └── MainMenu~.nib │ ├── keyedobjects.nib │ ├── info.nib │ └── classes.nib ├── main.m ├── Khronos_Prefix.pch ├── CUFontFormatter.h ├── version.plist ├── CUFontFormatter.m ├── dataHandler.h ├── Info.plist ├── tableGenerator.h ├── cuDateTime.h ├── CUPreferenceController.h ├── CUPreferences.h ├── Controller.h ├── tableGenerator.m ├── CUPreferenceController.m ├── Khronos.xcodeproj ├── cs.pbxuser └── gdey.pbxuser ├── dataHandler.m ├── CUPreferences.m ├── Khronos.xcode └── project.pbxproj └── cuDateTime.m /.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.tmproj 3 | Khronos.xcodeproj/*.tm_build_errors 4 | -------------------------------------------------------------------------------- /khronos.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/khronos.icns -------------------------------------------------------------------------------- /Graphics/edit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/edit.gif -------------------------------------------------------------------------------- /Graphics/minus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/minus.gif -------------------------------------------------------------------------------- /Graphics/plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/plus.gif -------------------------------------------------------------------------------- /Graphics/jobPause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/jobPause.png -------------------------------------------------------------------------------- /MBjobSelector3Alt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/MBjobSelector3Alt.png -------------------------------------------------------------------------------- /support/i/appEdit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/support/i/appEdit.gif -------------------------------------------------------------------------------- /support/i/appPlus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/support/i/appPlus.gif -------------------------------------------------------------------------------- /support/i/appStop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/support/i/appStop.gif -------------------------------------------------------------------------------- /Graphics/jobActive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/jobActive.png -------------------------------------------------------------------------------- /Graphics/stst_null.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/stst_null.png -------------------------------------------------------------------------------- /Graphics/stst_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/stst_pause.png -------------------------------------------------------------------------------- /Graphics/stst_start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/stst_start.png -------------------------------------------------------------------------------- /Graphics/stst_stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/stst_stop.png -------------------------------------------------------------------------------- /support/i/2appPause.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/support/i/2appPause.gif -------------------------------------------------------------------------------- /support/i/appMinus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/support/i/appMinus.gif -------------------------------------------------------------------------------- /support/i/appStart.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/support/i/appStart.gif -------------------------------------------------------------------------------- /Graphics/jobInactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/jobInactive.png -------------------------------------------------------------------------------- /Graphics/showSessions.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/showSessions.gif -------------------------------------------------------------------------------- /Graphics/showSessions2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/showSessions2.png -------------------------------------------------------------------------------- /Graphics/stst_nullMB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/stst_nullMB.png -------------------------------------------------------------------------------- /Graphics/stst_pause2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/stst_pause2.png -------------------------------------------------------------------------------- /Graphics/stst_pause2MB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/stst_pause2MB.png -------------------------------------------------------------------------------- /Graphics/stst_playMB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/stst_playMB.png -------------------------------------------------------------------------------- /Graphics/stst_startMB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/stst_startMB.png -------------------------------------------------------------------------------- /Graphics/stst_stopMB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/stst_stopMB.png -------------------------------------------------------------------------------- /support/i/2appMenuBar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/support/i/2appMenuBar.gif -------------------------------------------------------------------------------- /support/i/2appUnpause.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/support/i/2appUnpause.gif -------------------------------------------------------------------------------- /support/i/app4buttons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/support/i/app4buttons.gif -------------------------------------------------------------------------------- /support/i/appAddSheet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/support/i/appAddSheet.gif -------------------------------------------------------------------------------- /support/i/appComments.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/support/i/appComments.gif -------------------------------------------------------------------------------- /support/i/appSessions.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/support/i/appSessions.gif -------------------------------------------------------------------------------- /Graphics/MBjobSelector3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/MBjobSelector3.png -------------------------------------------------------------------------------- /English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /Graphics/MBjobSelector3Alt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/MBjobSelector3Alt.png -------------------------------------------------------------------------------- /Graphics/stst_nullPauseMB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/Graphics/stst_nullPauseMB.png -------------------------------------------------------------------------------- /support/i/2appMenuBarMenuing.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/support/i/2appMenuBarMenuing.gif -------------------------------------------------------------------------------- /English.lproj/MainMenu.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/English.lproj/MainMenu.nib/keyedobjects.nib -------------------------------------------------------------------------------- /main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | return NSApplicationMain(argc, (const char **)argv); 6 | } 7 | -------------------------------------------------------------------------------- /English.lproj/MainMenu~.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Imagine/khronos_time_tracker/master/English.lproj/MainMenu~.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Khronos_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Khronos' target in the 'Khronos' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /CUFontFormatter.h: -------------------------------------------------------------------------------- 1 | // 2 | // CUFontFormatter.h 3 | // Khronos 4 | // 5 | // Created by Gautam Dey on 7/4/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface CUFontFormatter : NSFormatter { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /version.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildVersion 6 | 1 7 | CFBundleShortVersionString 8 | 0.1 9 | CFBundleVersion 10 | 0.1 11 | ProjectName 12 | NibPBTemplates 13 | SourceVersion 14 | 1160200 15 | 16 | 17 | -------------------------------------------------------------------------------- /CUFontFormatter.m: -------------------------------------------------------------------------------- 1 | // 2 | // CUFontFormatter.m 3 | // Khronos 4 | // 5 | // Created by Gautam Dey on 7/4/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "CUFontFormatter.h" 10 | 11 | 12 | @implementation CUFontFormatter 13 | 14 | - (NSString *)stringForObjectValue:(id)obj 15 | { 16 | // Not a font 17 | if(![obj isKindOfClass:[NSFont class]]) 18 | { 19 | return nil; 20 | } 21 | return [NSString stringWithFormat:@"%@ %.0fpt",[obj fontName],[obj pointSize]]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /English.lproj/MainMenu.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBFramework Version 6 | 629 7 | IBOldestOS 8 | 5 9 | IBOpenObjects 10 | 11 | 29 12 | 13 | IBSystem Version 14 | 9G55 15 | targetFramework 16 | IBCocoaFramework 17 | 18 | 19 | -------------------------------------------------------------------------------- /dataHandler.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "cuDateTime.h" 3 | 4 | 5 | @interface dataHandler : NSObject 6 | { 7 | } 8 | 9 | + (NSMutableArray *)createJobListFromFile:(NSString *)dataPath; 10 | + (void)saveJobListToFile:(NSArray *)jobData; 11 | + (void)exportData:(NSArray *)jobData text:(NSString *)textForPanel; 12 | + (NSString *)generateSaveString:(NSArray *)jobData; 13 | + (NSArray *)importData:(NSArray *)jobData text:(NSString *)textForPanel; 14 | 15 | + (NSMutableDictionary *)createJobFromString:(NSString *)jobDataString; 16 | + (NSMutableDictionary *)createSessionFromString:(NSString *)sessionDataString; 17 | + (NSMutableDictionary *)createJobFrom11String:(NSString *)dataString; 18 | + (NSMutableArray *)createSessionListFrom11Data:(NSString *)dataPath; 19 | + (NSMutableDictionary *)createSessionFrom11String:(NSString *)sessionDataString; 20 | @end 21 | -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDocumentTypes 8 | 9 | CFBundleExecutable 10 | Khronos 11 | CFBundleIconFile 12 | khronos.icns 13 | CFBundleIdentifier 14 | com.crewdead.khronos 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | CRUD 21 | CFBundleVersion 22 | 1.3 23 | NSMainNibFile 24 | MainMenu 25 | NSPrincipalClass 26 | NSApplication 27 | 28 | 29 | -------------------------------------------------------------------------------- /English.lproj/MainMenu~.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBDocumentLocation 6 | 7 26 876 240 0 0 1440 878 7 | IBEditorPositions 8 | 9 | 206 10 | 656 391 470 204 0 0 1440 878 11 | 29 12 | 660 792 285 44 0 0 1440 878 13 | 509 14 | 886 458 65 32 0 0 1440 878 15 | 16 | IBFramework Version 17 | 446.1 18 | IBOldestOS 19 | 2 20 | IBOpenObjects 21 | 22 | 205 23 | 29 24 | 237 25 | 627 26 | 27 | IBSystem Version 28 | 8R2218 29 | 30 | 31 | -------------------------------------------------------------------------------- /tableGenerator.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface tableGenerator : NSObject 4 | { 5 | } 6 | 7 | + (NSTableColumn *)createJobNumberColumn:(NSString *)headerText; 8 | + (NSTableColumn *)createJobActiveColumn:(NSString *)headerText; 9 | + (NSTableColumn *)createJobNameColumn:(NSString *)headerText; 10 | + (NSTableColumn *)createJobClientColumn:(NSString *)headerText; 11 | + (NSTableColumn *)createJobHourlyRateColumn:(NSString *)headerText; 12 | + (NSTableColumn *)createJobTimeLoggedColumn:(NSString *)headerText; 13 | + (NSTableColumn *)createJobChargesColumn:(NSString *)headerText; 14 | 15 | + (NSTableColumn *)createSessionNumberColumn:(NSString *)headerText; 16 | + (NSTableColumn *)createSessionActiveColumn:(NSString *)headerText; 17 | + (NSTableColumn *)createSessionSDateColumn:(NSString *)headerText; 18 | + (NSTableColumn *)createSessionSTimeColumn:(NSString *)headerText; 19 | + (NSTableColumn *)createSessionEDateColumn:(NSString *)headerText; 20 | + (NSTableColumn *)createSessionETimeColumn:(NSString *)headerText; 21 | + (NSTableColumn *)createSessionPauseTimeColumn:(NSString *)headerText; 22 | + (NSTableColumn *)createSessionTotalTimeColumn:(NSString *)headerText; 23 | + (NSTableColumn *)createSessionChargesColumn:(NSString *)headerText; 24 | + (NSTableColumn *)createSessionSummaryColumn:(NSString *)headerText; 25 | @end 26 | -------------------------------------------------------------------------------- /support/khelp.css: -------------------------------------------------------------------------------- 1 | 2 | body 3 | { 4 | margin: 0; 5 | padding: 0; 6 | font-size: 76%; 7 | font-family: verdana, sans-serif; 8 | background-color: #647C97; 9 | 10 | } 11 | 12 | #wrp 13 | { 14 | padding: 20px 40px; 15 | padding-right: 340px; 16 | border: 1px dotted #5C80AA; 17 | margin: 5px; 18 | background-color: #ededed; 19 | 20 | } 21 | 22 | #nav 23 | { 24 | position: fixed; 25 | top: 6px; 26 | right: 6px; 27 | border: 1px dotted #333; 28 | padding: 0 10px 6px; 29 | border-width: 0 0 1px 1px; 30 | } 31 | 32 | #nav:hover 33 | { 34 | background-color: #fff; 35 | } 36 | 37 | li 38 | { 39 | font: .94em/1.6em verdana, tahoma, sans-serif; 40 | list-style: circle; 41 | margin-top: 0; 42 | color: #555; 43 | 44 | } 45 | 46 | 47 | #mod 48 | { 49 | font: .94em/1.6em verdana, tahoma, sans-serif; 50 | margin-top: 40px; 51 | padding-top: 3px; 52 | border-top: 1px dotted #888; 53 | color: #888; 54 | } 55 | 56 | h2 57 | { 58 | color: #444; 59 | font-weight: bold; 60 | font: 1.7em/1.6em "Lucida Grande", helvetica, arial, sans-serif; 61 | } 62 | 63 | h3 64 | { 65 | color: #444; 66 | font-weight: bold; 67 | font: 1.4em/1.5em "Lucida Grande", helvetica, arial, sans-serif; 68 | background-color: white; 69 | 70 | } 71 | 72 | h4 73 | { 74 | color: #333; 75 | font: 1.15em/1.4em helvetica, arial, sans-serif; 76 | 77 | } 78 | h5 79 | { 80 | color: #555; 81 | font: 1.0em/1.4em helvetica, arial, sans-serif; 82 | font-weight: bold; 83 | } 84 | p 85 | { 86 | color: #555; 87 | font: .94em/1.5em verdana, tahoma, sans-serif; 88 | margin-top: 15px; 89 | } 90 | 91 | b { font-weight: bold; } 92 | 93 | a 94 | { 95 | color: #5C80AA; 96 | font-weight: bold; 97 | text-decoration: none; 98 | } 99 | 100 | a:visited { color: #AA9C6C; } 101 | 102 | a:hover 103 | { 104 | color: #157FC9; 105 | text-decoration: underline; 106 | } 107 | 108 | img.ack 109 | { 110 | border: 1px solid #333; 111 | } 112 | 113 | 114 | img 115 | { 116 | vertical-align: bottom; 117 | } 118 | -------------------------------------------------------------------------------- /cuDateTime.h: -------------------------------------------------------------------------------- 1 | //cuDateTime.h begins here 2 | 3 | #import 4 | 5 | @interface cuDateTime : NSObject 6 | { 7 | int year; 8 | int month; 9 | int day; 10 | int hour; 11 | int minute; 12 | int second; 13 | } 14 | 15 | //Init Methods 16 | - (cuDateTime *)init; 17 | - (cuDateTime *)initWithCurrentDateAndTime; 18 | - (cuDateTime *)initWithStrings:(NSString *)dateString time:(NSString *)timeString; 19 | - (cuDateTime *)initWithStrings:(NSString *)dateString time:(NSString *)timeString timeFormat:(int)timeFormat; 20 | - (cuDateTime *)initWithTimeString:(NSString *)timeString; 21 | - (cuDateTime *)initWithTwelveHourTimeString:(NSString*)timeString; 22 | 23 | //Getting Strings 24 | - (NSString *)getDateString; 25 | - (NSString *)getTimeStringFor:(int)minutes; 26 | - (NSString *)getTimeString; 27 | - (NSString *)getTimeString:(BOOL)withSeconds; 28 | - (NSString *)getFormattedTimeString:(NSString *)formatter; 29 | - (NSString *)getTwelveHourTimeString; 30 | - (NSString *)getTwelveHourTimeString:(BOOL)withSeconds; 31 | - (NSString *)getFormattedTwelveHourTimeString:(NSString *)formatter; 32 | 33 | //Getting Data 34 | - (int)getYear; 35 | - (int)getMonth; 36 | - (int)getDay; 37 | - (int)getHour; 38 | - (int)getMinute; 39 | - (int)getSecond; 40 | 41 | //Setting Data 42 | - (void)setValues:(cuDateTime *)secondDateTime; 43 | - (void)setDataWithInts:(int)theYear month:(int)theMonth day:(int)theDay hour:(int)theHour minute:(int)theMinute second:(int)theSecond; 44 | - (void)setDataWithStrings:(NSString *)dateString time:(NSString *)timeString; 45 | - (void)setDateWithString:(NSString *)dateString; 46 | - (void)setTimeWithString:(NSString *)timeString; 47 | - (void)setTimeWithTwelveHourString:(NSString *)timeString; 48 | 49 | //Math 50 | - (NSComparisonResult)compare:(cuDateTime *)secondTime; 51 | - (void)updateToCurrent; 52 | - (cuDateTime *)getTimeInterval:(cuDateTime *)secondTime; 53 | - (cuDateTime *)addInterval:(cuDateTime *)timeToAdd; 54 | - (cuDateTime *)subtractInterval:(cuDateTime *)timeToSubtract; 55 | - (double)calculateCharges:(double)hourlyRate format:(NSString *)formatter; 56 | - (void)addDays:(int)howMany; 57 | 58 | //Checking Strings for Init Methods 59 | + (BOOL)checkStringForDate:(NSString *)theString; 60 | + (BOOL)checkStringForTime:(NSString *)theString; 61 | + (BOOL)checkStringForTwelveHourTime:(NSString *)theString; 62 | + (BOOL)checkStringForTimeNoSeconds:(NSString *)theString; 63 | + (BOOL)checkStringForTwelveHourTimeNoSeconds:(NSString *)theString; 64 | @end -------------------------------------------------------------------------------- /CUPreferenceController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CUPreferenceController.h 3 | // Khronos 4 | // 5 | // Created by Gautam Dey on 6/29/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class CUPreferences; 12 | 13 | @interface CUPreferenceController : NSWindowController { 14 | 15 | CUPreferences *preferences; 16 | 17 | IBOutlet NSButton *askDeleteProject; 18 | IBOutlet NSButton *askDeleteSession; 19 | IBOutlet NSButton *autoSaveTime; 20 | IBOutlet NSButton *autoDeleteSettings; 21 | IBOutlet NSTextField *aMonetaryUnit; 22 | IBOutlet NSMatrix *clockSettings; 23 | IBOutlet NSMatrix *updateTime; 24 | 25 | // Project Table Settings 26 | IBOutlet NSMatrix *projectTableColumns; 27 | 28 | // Session Table Settings 29 | IBOutlet NSMatrix *sessionTableColumns; 30 | // Session Table Settings 31 | IBOutlet NSMatrix *menuTableColumns; 32 | 33 | // Invoice Settings 34 | // Text information 35 | IBOutlet NSTextField *indexTitle; 36 | IBOutlet NSTextField *indexHeading; 37 | IBOutlet NSTextField *linkHelp; 38 | IBOutlet NSTextField *invoiceTitle; 39 | IBOutlet NSTextField *invoiceHeading; 40 | // Fonts 41 | IBOutlet NSTextField *bodyFont; 42 | IBOutlet NSTextField *headingFont; 43 | } 44 | 45 | - (IBAction) resetPreferences:(id)sender; 46 | // General Options 47 | 48 | #pragma mark General Options Actions 49 | - (IBAction) changeAskDeleteProject:(id)sender; 50 | - (IBAction) changeAskDeleteSession:(id)sender; 51 | - (IBAction) changeAutoSaveTime:(id)sender; 52 | - (IBAction) changeAutoDeleteSetting:(id)sender; 53 | - (IBAction) changeClock:(id)sender; 54 | - (IBAction) changeUpdateTime:(id)sender; 55 | - (IBAction) changeMonetaryUnit:(id)sender; 56 | 57 | 58 | // Options for the tables; 59 | #pragma mark Project Table Options 60 | - (NSString *)projectTableColumnNameForTag:(int)tag; 61 | 62 | #pragma mark Project Table Options Actions 63 | - (IBAction) changeProjectTableDisplay:(id)sender; 64 | 65 | #pragma mark Session Table Options 66 | - (NSString *)sessionTableColumnNameForTag:(int)tag; 67 | #pragma mark Session Table Actions 68 | - (IBAction) changeSessionTableDisplay:(id)sender; 69 | 70 | // Options for Invoice 71 | #pragma mark Invoice Options Actions 72 | - (IBAction) changeInvoiceIndexTitle:(id)sender; 73 | - (IBAction) changeInvoiceIndexHeading:(id)sender; 74 | - (IBAction) changeInvoiceLinkHelp:(id)sender; 75 | - (IBAction) changeInvoiceTitle:(id)sender; 76 | - (IBAction) changeInvoiceHeading:(id)sender; 77 | - (IBAction) changeInvoiceHeadingFont:(id)sender; 78 | - (IBAction) changeInvoiceBodyFont:(id)sender; 79 | - (IBAction) showFontPanelForHeading:(id)sender; 80 | - (IBAction) showFontPanelForBody:(id)sender; 81 | 82 | #pragma mark Menu Options 83 | - (NSString *)menuTableColumnNameForTag:(int)tag; 84 | 85 | #pragma mark Menu Options Actions 86 | - (IBAction) changeMenuTableDisplay:(id)sender; 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /support/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | Khronos | Support 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 49 | 50 | 51 |
52 | 53 |

Khronos Support

54 | 55 | 56 | 57 |

Other Resources:

58 | 62 | 63 |

Getting Started with Khronos

64 | 65 |

About Khronos

66 |

Khronos is designed to:

67 | 68 |
    69 |
  • Log time spent on each job.
  • 70 |
  • Log time spent on each work session.
  • 71 |
  • Calculates the payment from client (hourly wage).
  • 72 |
  • Modify your work sessions.
  • 73 |
  • Real time feedback.
  • 74 |
  • Export and backup your data.
  • 75 |
  • Print Invoices
  • 76 |
77 | 78 | 79 | 80 | 81 |

Editing Sessions and Jobs

82 |

Here are the formats to use when editing Sessions or Jobs:

83 |
    84 |
  • Dates: 12/12/2004 is M/D/Y
  • 85 |
  • Times: 12:12:12 is H:M:S
  • 86 |
  • Times can be also entered as such: 12:12:12, 12:12, 12:1212 pm, 12:12 pm
  • 87 |
  • Rates: 12 is 12 units of currency per hour
  • 88 |
89 | 90 | 91 | 92 |

Importing and Exporting Data

93 |
Exporting
94 |

Exporting takes the current data and exports it. It'll save the data as a .khd file. The file is tab delineated, so feel free to import it into MS Excel or a similar program.

95 | 96 |
Importing
97 |

For importing, select the .khd file you want to import. Khronos will import the data. Jobs of the same name and client will display twice in Khronos. The data will not be merged, so the session data will be different, but the job and client names will exist twice.

98 | 99 |

You can as well import data exported from version 1.0 or 1.1. Just go to import and select the folder.

100 | 101 |

It's best to import files that have been directly exported from Khronos and not changed in any way.

102 | 103 | 104 |

Known Issues

105 | 106 |
    107 | 108 |
  • Timer will continue during sleep. Make sure to "Stop Recording" before putting your computer to sleep.
  • 109 | 110 | 111 |
  • More improvements to come. Won't list them here since they're so sweet that we wouldn't want the competition to get a head start on us.
  • 112 |
113 | 114 | 115 | 116 |

Donating

117 |

As you might know, Khronos is free. You don't have to give us anything. It's not cripple-ware. It won't stop working in 30 days.

118 | 119 |
How to Donate
120 |

However, if you have the itch to get us some beer money, then you can donate with paypal. 121 | 122 |

Why the Crap Would I Donate to You Guys?
123 | 124 |

Well...

125 |
    126 |
  • We put a lot of time into it.
  • 127 |
  • It works.
  • 128 |
  • You want us to have a beer on you.
  • 129 |
130 | 131 | 132 | 133 | 134 | 135 | 136 |
Last modified Feb 29 2004
137 | 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /CUPreferences.h: -------------------------------------------------------------------------------- 1 | // 2 | // CUPreferences.h 3 | // Khronos 4 | // 5 | // Created by Gautam Dey on 7/5/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | extern NSString *const CUPreferencesResetNotification; 11 | extern NSString *const CUPreferencesAskDeleteJob; 12 | extern NSString *const CUPreferencesAskDeleteSession; 13 | extern NSString *const CUPreferencesAutoSaveTime; 14 | extern NSString *const CUPreferencesAutoDeleteSettings; 15 | extern NSString *const CUPreferencesClockSetting; 16 | extern NSString *const CUPreferencesUpdateTime; 17 | extern NSString *const CUPreferencesMonetaryUnit; 18 | extern NSString *const CUPreferencesFirstLaunch; 19 | extern NSString *const CUPreferencesTimeSettingsChangedNotification; 20 | extern NSString *const CUPreferencesClockSettingNotification; 21 | extern NSString *const CUPreferencesUpdateTimeNotification; 22 | 23 | extern NSString *const CUPreferencesTableNotification; 24 | extern NSString *const CUPreferencesTableUserInfoTableName; 25 | extern NSString *const CUPreferencesTableUserInfoColumnName; 26 | 27 | /*** Which columns in the Project table should be shown. ***/ 28 | extern NSString *const CUPreferencesProjectDisplay; 29 | extern NSString *const CUPreferencesProjectDisplayNumber; 30 | extern NSString *const CUPreferencesProjectDisplayName; 31 | extern NSString *const CUPreferencesProjectDisplayClient; 32 | extern NSString *const CUPreferencesProjectDisplayRate; 33 | extern NSString *const CUPreferencesProjectDisplayTime; 34 | extern NSString *const CUPreferencesProjectDisplayCharges; 35 | 36 | /*** Which columns in the Seesion Table should be shown. ***/ 37 | extern NSString *const CUPreferencesSessionDisplay; 38 | extern NSString *const CUPreferencesSessionDisplayStartDate; 39 | extern NSString *const CUPreferencesSessionDisplayEndDate; 40 | extern NSString *const CUPreferencesSessionDisplayStartTime; 41 | extern NSString *const CUPreferencesSessionDisplayEndTime; 42 | extern NSString *const CUPreferencesSessionDisplayPauseTime; 43 | extern NSString *const CUPreferencesSessionDisplayTotalTime; 44 | extern NSString *const CUPreferencesSessionDisplayCharges; 45 | extern NSString *const CUPreferencesSessionDisplaySummary; 46 | extern NSString *const CUPreferencesSessionDisplayNumber; 47 | 48 | /*** Options for the menu bar ***/ 49 | extern NSString *const CUPreferencesMenuDisplay; 50 | extern NSString *const CUPreferencesMenuDisplayPauseButton; 51 | extern NSString *const CUPreferencesMenuDisplayRecrodingButton; 52 | extern NSString *const CUPreferencesMenuDisplayProjectList; 53 | extern NSString *const CUPreferencesMenuDisplayTotalTime; 54 | extern NSString *const CUPreferencesMenuDisplayCharges; 55 | 56 | /*** Options for Invoice ***/ 57 | extern NSString *const CUPreferencesInvoice; 58 | extern NSString *const CUPreferencesInvoiceIndexTitle; 59 | extern NSString *const CUPreferencesInvoiceIndexHeading; 60 | extern NSString *const CUPreferencesInvoiceLinkHelp; 61 | extern NSString *const CUPreferencesInvoiceTitle; 62 | extern NSString *const CUPreferencesInvoiceHeading; 63 | extern NSString *const CUPreferencesInvoiceBodyFont; 64 | extern NSString *const CUPreferencesInvoiceHeadingFont; 65 | 66 | 67 | extern NSString *const CUPreferencesInvoiceIndexTitleChangedNotification; 68 | extern NSString *const CUPreferencesInvoiceIndexHeadingChangedNotification; 69 | extern NSString *const CUPreferencesInvoiceLinkHelpChangedNotification; 70 | extern NSString *const CUPreferencesInvoiceTitleChangedNotification; 71 | extern NSString *const CUPreferencesInvoiceHeadingChangedNotification; 72 | extern NSString *const CUPreferencesInvoiceHeadingFontChangedNotification; 73 | extern NSString *const CUPreferencesInvoiceBodyFontChangedNotification; 74 | 75 | @interface CUPreferences : NSObject { 76 | 77 | } 78 | 79 | + (void) resetPreferences; 80 | + (void) initializeDefaults; 81 | 82 | // Functions for working with the various tables. 83 | // These functions will work for the Project Table, Session Table and te Menu. 84 | // Basically any of the Contstand with the word Display at the end of it. 85 | - (NSDictionary *)columnsForTable:(NSString *)tableName; 86 | - (void) setTable:(NSString *)tableName column:(NSString *)column display:(BOOL)yn; 87 | - (BOOL) displayForTable:(NSString *)tableName column:(NSString *)column; 88 | 89 | #pragma mark General Options 90 | - (BOOL) askDeleteProject; 91 | - (void) setAskDeleteProject:(BOOL)value; 92 | - (BOOL) askDeleteSession; 93 | - (void) setAskDeleteSession:(BOOL)value; 94 | // Should this return an int? 95 | - (BOOL) autoSaveTime; 96 | - (void) setAutoSaveTime:(BOOL)value; 97 | - (BOOL) autoDeleteSettings; 98 | - (void) setAutoDeleteSettings:(BOOL)value; 99 | - (BOOL) is24HourClock; 100 | - (void) setIs24HourClock:(BOOL)value; 101 | - (int) updateTimeEvery; 102 | - (void) setUpdateTimeEvery:(int)minutes; 103 | - (NSString *)monetaryUnit; 104 | - (void) setMonetaryUnit:(NSString *)unit; 105 | - (BOOL) firstLaunch; 106 | 107 | 108 | #pragma mark Invoice Options 109 | - (NSDictionary *)invoiceTable; 110 | - (id)invoiceValuesForColumn:(NSString *)column; 111 | - (void)setInvoiceValueForColumn:(NSString *)column value:(id)value; 112 | - (NSString *)invoiceIndexTitle; 113 | - (void) setInvoiceIndexTitle:(NSString *)title; 114 | - (NSString *)invoiceIndexHeading; 115 | - (void) setInvoiceIndexHeading:(NSString *)heading; 116 | - (NSString *)invoiceLinkHelp; 117 | - (void) setInvoiceLinkHelp:(NSString *)linkHelp; 118 | - (NSString *)invoiceTitle; 119 | - (void) setInvoiceTitle:(NSString *)title; 120 | - (NSString *)invoiceHeading; 121 | - (void)setInvoiceHeading:(NSString *)heading; 122 | - (NSFont *)invoiceHeadingFont; 123 | - (void)setInvoiceHeadingFont:(NSFont *)aFont; 124 | - (NSFont *)invoiceBodyFont; 125 | - (void)setInvoiceBodyFont:(NSFont *)aFont; 126 | 127 | @end 128 | -------------------------------------------------------------------------------- /English.lproj/MainMenu~.nib/classes.nib: -------------------------------------------------------------------------------- 1 | { 2 | IBClasses = ( 3 | { 4 | ACTIONS = { 5 | addJobButton = id; 6 | addJobCancel = id; 7 | addJobSave = id; 8 | addSessionButton = id; 9 | addSessionCancel = id; 10 | addSessionSave = id; 11 | deleteJobButton = id; 12 | deleteSessionButton = id; 13 | editJobButton = id; 14 | editJobCancel = id; 15 | editJobSave = id; 16 | editSessionButton = id; 17 | editSessionCancel = id; 18 | editSessionSave = id; 19 | menuAddData = id; 20 | menuBlatantAd = id; 21 | menuCheckForUpdates = id; 22 | menuDisplayHelp = id; 23 | menuDonate = id; 24 | menuExport = id; 25 | menuHTML = id; 26 | menuHTMLAll = id; 27 | menuOpenWindow = id; 28 | menuPauseAllJobs = id; 29 | menuPrintInvoice = id; 30 | menuSave = id; 31 | menuSendEmail = id; 32 | menuVisitWebsite = id; 33 | pauseUnpause = id; 34 | prefsJobTableChange = id; 35 | prefsMenuChanged = id; 36 | prefsSave = id; 37 | prefsSessionTableChange = id; 38 | prefsUpdateTimeChange = id; 39 | showPagePanel = id; 40 | startStopRecording = id; 41 | statusItemChanged = id; 42 | }; 43 | CLASS = Controller; 44 | LANGUAGE = ObjC; 45 | OUTLETS = { 46 | addJobClient = id; 47 | addJobHourlyRate = id; 48 | addJobJobName = id; 49 | addJobPanel = id; 50 | addSessionButton = id; 51 | addSessionEndDate = id; 52 | addSessionEndTime = id; 53 | addSessionPanel = id; 54 | addSessionStartDate = id; 55 | addSessionStartTime = id; 56 | deleteJobButton = id; 57 | deleteSessionButton = id; 58 | editJobButton = id; 59 | editJobClient = id; 60 | editJobHourlyRate = id; 61 | editJobJobName = id; 62 | editJobPanel = id; 63 | editSessionButton = id; 64 | editSessionEndDate = id; 65 | editSessionEndTime = id; 66 | editSessionPanel = id; 67 | editSessionStartDate = id; 68 | editSessionStartTime = id; 69 | jobTable = id; 70 | mainWindow = id; 71 | menuJobList = id; 72 | pauseButton = id; 73 | prefs2412Radio = id; 74 | prefsAskDeleteJob = id; 75 | prefsAskDeleteSession = id; 76 | prefsAutoDeleteSetting = id; 77 | prefsAutoSaveTime = id; 78 | prefsInvoiceBodyFont = id; 79 | prefsInvoiceHeader = id; 80 | prefsInvoiceHeaderFont = id; 81 | prefsInvoiceIndex = id; 82 | prefsInvoiceIndexHeader = id; 83 | prefsInvoiceIndexLink = id; 84 | prefsInvoiceSize = id; 85 | prefsInvoiceTitle = id; 86 | prefsJobDisplayCharges = id; 87 | prefsJobDisplayClient = id; 88 | prefsJobDisplayName = id; 89 | prefsJobDisplayNumber = id; 90 | prefsJobDisplayRate = id; 91 | prefsJobDisplayTime = id; 92 | prefsMenuAlertField = id; 93 | prefsMenuDisplayButton = id; 94 | prefsMenuDisplayCharges = id; 95 | prefsMenuDisplayList = id; 96 | prefsMenuDisplayTime = id; 97 | prefsMenuPauseButton = id; 98 | prefsMonetaryUnit = id; 99 | prefsSessionDisplayCharges = id; 100 | prefsSessionDisplayEDate = id; 101 | prefsSessionDisplayETime = id; 102 | prefsSessionDisplayNumber = id; 103 | prefsSessionDisplayPause = id; 104 | prefsSessionDisplaySDate = id; 105 | prefsSessionDisplaySTime = id; 106 | prefsSessionDisplaySummary = id; 107 | prefsSessionDisplayTotalTime = id; 108 | prefsUpdateEveryRadio = id; 109 | prefsWindow = id; 110 | printClientName = id; 111 | printHourlyRate = id; 112 | printJobName = id; 113 | printTable = id; 114 | printTotalCharges = id; 115 | printTotalTimeLogged = id; 116 | printWindow = id; 117 | sessionTable = id; 118 | startStopButton = id; 119 | startStopField = id; 120 | textArr = id; 121 | textBah = id; 122 | textCharges = id; 123 | textClientName = id; 124 | textDataMustBe = id; 125 | textDeleteJobLong = id; 126 | textDeleteJobShort = id; 127 | textDeleteSessionLong = id; 128 | textDeleteSessionShort = id; 129 | textEndLater = id; 130 | textExportTo = id; 131 | textHourSuffix = id; 132 | textJobActive = id; 133 | textJobName = id; 134 | textJobNumber = id; 135 | textMenuDisable = id; 136 | textNewVersion = id; 137 | textNoJobData = id; 138 | textPauses = id; 139 | textProblemConnect = id; 140 | textRate = id; 141 | textRejoice = id; 142 | textSelectFile = id; 143 | textSelectJob = id; 144 | textSessionActive = id; 145 | textSessionCharges = id; 146 | textSessionDate = id; 147 | textSessionEnd = id; 148 | textSessionEndDate = id; 149 | textSessionNumber = id; 150 | textSessionStart = id; 151 | textSessionSummary = id; 152 | textSessionTime = id; 153 | textStartRecording = id; 154 | textStopRecording = id; 155 | textTimeLogged = id; 156 | textTotalDue = id; 157 | textUpToDate = id; 158 | textYeargh = id; 159 | }; 160 | SUPERCLASS = NSObject; 161 | }, 162 | {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 163 | { 164 | CLASS = printHandler; 165 | LANGUAGE = ObjC; 166 | OUTLETS = {theTable = id; theWindow = id; }; 167 | SUPERCLASS = NSObject; 168 | } 169 | ); 170 | IBVersion = 1; 171 | } -------------------------------------------------------------------------------- /Controller.h: -------------------------------------------------------------------------------- 1 | /* Controller */ 2 | 3 | #import 4 | #import "tableGenerator.h" 5 | #import "cuDateTime.h" 6 | #import "dataHandler.h" 7 | 8 | @class CUPreferenceController; 9 | @class CUPreferences; 10 | 11 | @interface Controller : NSObject 12 | { 13 | 14 | BOOL firstLaunch; 15 | int windowHeight; 16 | int windowWidth; 17 | int windowX; 18 | int windowY; 19 | 20 | NSMutableArray *jobData; 21 | 22 | IBOutlet NSMenu *menuJobList; 23 | NSStatusItem *jobPullDownMenu; 24 | NSStatusItem *menuStartStopButton; 25 | NSStatusItem *menuPauseButton; 26 | NSStatusItem *menuTimeDisplay; 27 | NSStatusItem *menuChargeDisplay; 28 | 29 | NSSortDescriptor *lastJobSorter; 30 | NSSortDescriptor *lastSessionSorter; 31 | BOOL lastJobSortAscending; 32 | BOOL lastSessionSortAscending; 33 | 34 | NSPrintInfo *printInfo; 35 | 36 | NSImage *tableActive; 37 | NSImage *tableInactive; 38 | NSImage *tablePaused; 39 | NSImage *pauseYes; 40 | NSImage *pauseNo; 41 | NSImage *startStopGray; 42 | NSImage *startStopGreen; 43 | NSImage *startStopRed; 44 | NSImage *menuStartStopGray; 45 | NSImage *menuStartStopGreen; 46 | NSImage *menuStartStopRed; 47 | NSImage *menuPauseYes; 48 | NSImage *menuPauseNo; 49 | NSImage *menuPauseNull; 50 | NSImage *menuJobListIcon; 51 | NSImage *menuJobListAltIcon; 52 | 53 | NSTimer *updateTimer; 54 | 55 | //PrefsVariables 56 | int saveTimer; 57 | int autoDeleteTime; 58 | 59 | //MainWindow 60 | IBOutlet id mainWindow; 61 | IBOutlet id jobTable; 62 | IBOutlet id pauseButton; 63 | IBOutlet id startStopButton; 64 | IBOutlet id startStopField; 65 | IBOutlet id editJobButton; 66 | IBOutlet id deleteJobButton; 67 | 68 | //Drawer 69 | IBOutlet id sessionTable; 70 | IBOutlet id addSessionButton; 71 | IBOutlet id editSessionButton; 72 | IBOutlet id deleteSessionButton; 73 | 74 | //AddJobPanel 75 | IBOutlet id addJobClient; 76 | IBOutlet id addJobHourlyRate; 77 | IBOutlet id addJobJobName; 78 | IBOutlet id addJobPanel; 79 | 80 | //EditJobPanel 81 | IBOutlet id editJobClient; 82 | IBOutlet id editJobHourlyRate; 83 | IBOutlet id editJobJobName; 84 | IBOutlet id editJobPanel; 85 | 86 | //AddSessionPanel 87 | IBOutlet id addSessionEndDate; 88 | IBOutlet id addSessionEndTime; 89 | IBOutlet id addSessionPanel; 90 | IBOutlet id addSessionStartDate; 91 | IBOutlet id addSessionStartTime; 92 | 93 | //EditSessionPanel 94 | IBOutlet id editSessionEndDate; 95 | IBOutlet id editSessionEndTime; 96 | IBOutlet id editSessionPanel; 97 | IBOutlet id editSessionStartDate; 98 | IBOutlet id editSessionStartTime; 99 | 100 | 101 | //Text Storage 102 | IBOutlet id textArr; 103 | IBOutlet id textBah; 104 | IBOutlet id textCharges; 105 | IBOutlet id textClientName; 106 | IBOutlet id textDataMustBe; 107 | IBOutlet id textDeleteJobLong; 108 | IBOutlet id textDeleteJobShort; 109 | IBOutlet id textDeleteSessionLong; 110 | IBOutlet id textDeleteSessionShort; 111 | IBOutlet id textEndLater; 112 | IBOutlet id textExportTo; 113 | IBOutlet id textHourSuffix; 114 | IBOutlet id textJobActive; 115 | IBOutlet id textJobName; 116 | IBOutlet id textJobNumber; 117 | IBOutlet id textMenuDisable; 118 | IBOutlet id textNewVersion; 119 | IBOutlet id textNoJobData; 120 | IBOutlet id textPauses; 121 | IBOutlet id textProblemConnect; 122 | IBOutlet id textRate; 123 | IBOutlet id textRejoice; 124 | IBOutlet id textSelectFile; 125 | IBOutlet id textSelectJob; 126 | IBOutlet id textSessionActive; 127 | IBOutlet id textSessionCharges; 128 | IBOutlet id textSessionDate; 129 | IBOutlet id textSessionEnd; 130 | IBOutlet id textSessionEndDate; 131 | IBOutlet id textSessionNumber; 132 | IBOutlet id textSessionStart; 133 | IBOutlet id textSessionSummary; 134 | IBOutlet id textSessionTime; 135 | IBOutlet id textStartRecording; 136 | IBOutlet id textStopRecording; 137 | IBOutlet id textTimeLogged; 138 | IBOutlet id textTotalDue; 139 | IBOutlet id textUpToDate; 140 | IBOutlet id textYeargh; 141 | 142 | //PrintWindow 143 | IBOutlet id printWindow; 144 | IBOutlet id printTable; 145 | IBOutlet id printJobName; 146 | IBOutlet id printClientName; 147 | IBOutlet id printHourlyRate; 148 | IBOutlet id printTotalTimeLogged; 149 | IBOutlet id printTotalCharges; 150 | 151 | // New Preferences Controller 152 | CUPreferenceController *preferencesController; 153 | CUPreferences *preferences; 154 | 155 | // Main Bundle 156 | NSBundle *main; 157 | } 158 | //***Main Methods*** 159 | - (void)applicationWillTerminate:(NSNotification *)notification; 160 | - (void)createNewJob:(NSString *)name client:(NSString *)client rate:(double)rate; 161 | - (void)createNewSession:(cuDateTime *)startDateTime endDateTime:(cuDateTime *)endDateTime job:(int)whichJob active:(BOOL)active; 162 | - (void)computeJobTime:(int)job; 163 | // - (void)loadPrefsFromFile; 164 | - (void)updateLoop; 165 | - (void)updateMenuBarData; 166 | - (void)updateMenuBarJobList; 167 | - (void)updateMenuBarButtons; 168 | - (void)jobMenuListSelectionChanged:(id)sender; 169 | - (void)addJobToMenuList:(NSString *)jobName; 170 | - (void)saveLoop; 171 | // - (void)savePrefs; 172 | - (void)buildJobTable; 173 | - (void)buildSessionTable; 174 | 175 | - (void)buildPrintTable; 176 | - (void)updatePrintWindowFields; 177 | 178 | - (void)buildStatusItem; 179 | - (int)getHighestJobNumber; 180 | - (int)getHighestSessionNumber:(int)whichJob; 181 | - (NSString *)truncateChargeString:(NSString *)originalString; 182 | 183 | //***TableView Methods*** 184 | - (int)numberOfRowsInTableView:(NSTableView *)tableView; 185 | - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)rowIndex; 186 | - (void)tableView:(NSTableView *)tableView mouseDownInHeaderOfTableColumn:(NSTableColumn *)tableColumn; 187 | - (void)tableViewSelectionDidChange:(NSNotification *)notification; 188 | - (void)tableDoubleClick:(NSTableView *)tableView; 189 | - (void)tableView:(NSTableView *)tableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)tableColumn row:(int)rowIndex; 190 | - (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(int)row; 191 | 192 | //***Buttons*** 193 | //Main Window 194 | - (IBAction)startStopRecording:(id)sender; 195 | - (IBAction)pauseUnpause:(id)sender; 196 | - (IBAction)addJobButton:(id)sender; 197 | - (IBAction)deleteJobButton:(id)sender; 198 | - (IBAction)editJobButton:(id)sender; 199 | 200 | //Drawer 201 | - (IBAction)addSessionButton:(id)sender; 202 | - (IBAction)deleteSessionButton:(id)sender; 203 | - (IBAction)editSessionButton:(id)sender; 204 | - (void)editJob; 205 | 206 | //AddJobPanel 207 | - (IBAction)addJobCancel:(id)sender; 208 | - (IBAction)addJobSave:(id)sender; 209 | 210 | //EditJobPanel 211 | - (IBAction)editJobCancel:(id)sender; 212 | - (IBAction)editJobSave:(id)sender; 213 | 214 | //AddSessionPanel 215 | - (IBAction)addSessionCancel:(id)sender; 216 | - (IBAction)addSessionSave:(id)sender; 217 | 218 | //EditSessionPanel 219 | - (IBAction)editSessionCancel:(id)sender; 220 | - (IBAction)editSessionSave:(id)sender; 221 | - (void)editSession; 222 | 223 | //***MenuItems*** 224 | - (IBAction)menuPauseAllJobs:(id)sender; 225 | - (IBAction)menuAddData:(id)sender; 226 | - (IBAction)menuBlatantAd:(id)sender; 227 | - (IBAction)menuDisplayHelp:(id)sender; 228 | - (IBAction)menuDonate:(id)sender; 229 | - (IBAction)menuExport:(id)sender; 230 | - (IBAction)menuOpenWindow:(id)sender; 231 | - (IBAction)menuPrintInvoice:(id)sender; 232 | - (IBAction)menuHTML:(id)sender; 233 | - (IBAction)menuHTMLAll:(id)sender; 234 | - (NSString *)generateIndexHTML; 235 | - (NSString *)generateHTMLForJob:(int)jobNumber; 236 | - (IBAction)menuSave:(id)sender; 237 | - (IBAction)menuSendEmail:(id)sender; 238 | - (IBAction)menuVisitWebsite:(id)sender; 239 | - (IBAction)menuCheckForUpdates:(id)sender; 240 | - (IBAction)showPagePanel:(id)sender; 241 | 242 | /***** Preferences *****/ 243 | - (IBAction)showPreferencesPanel:(id)sender; 244 | - (void) handleClockSettingsChanged:(NSNotification *)note; 245 | - (void) handleTableChanges:(NSNotification *)note; 246 | - (void)handlePreferencesReset:(NSNotification *)note; 247 | 248 | @end -------------------------------------------------------------------------------- /tableGenerator.m: -------------------------------------------------------------------------------- 1 | #import "tableGenerator.h" 2 | 3 | @implementation tableGenerator 4 | + (NSTableColumn *)createJobNumberColumn:(NSString *)headerText 5 | { 6 | NSTableColumn *jobNumberColumn = [[NSTableColumn alloc] initWithIdentifier:@"jobNumber"]; 7 | [[jobNumberColumn headerCell] setStringValue:headerText]; 8 | [[jobNumberColumn headerCell] setAlignment:NSCenterTextAlignment]; 9 | [[jobNumberColumn dataCell] setDrawsBackground:NO]; 10 | [[jobNumberColumn dataCell] setAlignment:NSCenterTextAlignment]; 11 | [jobNumberColumn setWidth:20]; 12 | [jobNumberColumn setMinWidth:15]; 13 | [jobNumberColumn setMaxWidth:60]; 14 | [jobNumberColumn setEditable:NO]; 15 | 16 | return jobNumberColumn; 17 | } 18 | 19 | + (NSTableColumn *)createJobActiveColumn:(NSString *)headerText 20 | { 21 | NSTableColumn *jobActiveColumn = [[NSTableColumn alloc] initWithIdentifier:@"jobActive"]; 22 | [[jobActiveColumn headerCell] setStringValue:headerText]; 23 | [[jobActiveColumn headerCell] setAlignment:NSCenterTextAlignment]; 24 | NSImageCell *imageCell = [[NSImageCell alloc] init]; 25 | [jobActiveColumn setDataCell:imageCell]; 26 | [jobActiveColumn setWidth:18]; 27 | [jobActiveColumn setMinWidth:18]; 28 | [jobActiveColumn setMaxWidth:18]; 29 | [jobActiveColumn setEditable:NO]; 30 | 31 | return jobActiveColumn; 32 | } 33 | 34 | + (NSTableColumn *)createJobNameColumn:(NSString *)headerText 35 | { 36 | NSTableColumn *jobNameColumn = [[NSTableColumn alloc] initWithIdentifier:@"jobName"]; 37 | [[jobNameColumn headerCell] setStringValue:headerText]; 38 | [[jobNameColumn headerCell] setAlignment:NSLeftTextAlignment]; 39 | [[jobNameColumn dataCell] setDrawsBackground:NO]; 40 | [[jobNameColumn dataCell] setAlignment:NSLeftTextAlignment]; 41 | [jobNameColumn setWidth:130]; 42 | [jobNameColumn setMinWidth:60]; 43 | [jobNameColumn setEditable:NO]; 44 | 45 | return jobNameColumn; 46 | } 47 | 48 | + (NSTableColumn *)createJobClientColumn:(NSString *)headerText 49 | { 50 | NSTableColumn *jobClientColumn = [[NSTableColumn alloc] initWithIdentifier:@"clientName"]; 51 | [[jobClientColumn headerCell] setStringValue:headerText]; 52 | [[jobClientColumn headerCell] setAlignment:NSLeftTextAlignment]; 53 | [[jobClientColumn dataCell] setDrawsBackground:NO]; 54 | [[jobClientColumn dataCell] setAlignment:NSLeftTextAlignment]; 55 | [jobClientColumn setWidth:140]; 56 | [jobClientColumn setMinWidth:60]; 57 | [jobClientColumn setEditable:NO]; 58 | 59 | return jobClientColumn; 60 | } 61 | 62 | + (NSTableColumn *)createJobHourlyRateColumn:(NSString *)headerText 63 | { 64 | NSTableColumn *hourlyRateColumn = [[NSTableColumn alloc] initWithIdentifier:@"hourlyRate"]; 65 | [[hourlyRateColumn headerCell] setStringValue:headerText]; 66 | [[hourlyRateColumn headerCell] setAlignment:NSLeftTextAlignment]; 67 | [[hourlyRateColumn dataCell] setDrawsBackground:NO]; 68 | [[hourlyRateColumn dataCell] setAlignment:NSLeftTextAlignment]; 69 | [hourlyRateColumn setWidth:70]; 70 | [hourlyRateColumn setMinWidth:50]; 71 | [hourlyRateColumn setEditable:NO]; 72 | 73 | return hourlyRateColumn; 74 | } 75 | 76 | + (NSTableColumn *)createJobTimeLoggedColumn:(NSString *)headerText 77 | { 78 | NSTableColumn *jobTimeColumn = [[NSTableColumn alloc] initWithIdentifier:@"jobTimeLogged"]; 79 | [[jobTimeColumn headerCell] setStringValue:headerText]; 80 | [[jobTimeColumn headerCell] setAlignment:NSLeftTextAlignment]; 81 | [[jobTimeColumn dataCell] setDrawsBackground:NO]; 82 | [[jobTimeColumn dataCell] setAlignment:NSLeftTextAlignment]; 83 | [jobTimeColumn setWidth:60]; 84 | [jobTimeColumn setMinWidth:60]; 85 | [jobTimeColumn setEditable:NO]; 86 | 87 | return jobTimeColumn; 88 | } 89 | 90 | + (NSTableColumn *)createJobChargesColumn:(NSString *)headerText 91 | { 92 | NSTableColumn *jobChargesColumn = [[NSTableColumn alloc] initWithIdentifier:@"jobCharges"]; 93 | [[jobChargesColumn headerCell] setStringValue:headerText]; 94 | [[jobChargesColumn headerCell] setAlignment:NSLeftTextAlignment]; 95 | [[jobChargesColumn dataCell] setDrawsBackground:NO]; 96 | [[jobChargesColumn dataCell] setAlignment:NSLeftTextAlignment]; 97 | [jobChargesColumn setWidth:60]; 98 | [jobChargesColumn setMinWidth:60]; 99 | [jobChargesColumn setEditable:NO]; 100 | 101 | return jobChargesColumn; 102 | } 103 | 104 | + (NSTableColumn *)createSessionNumberColumn:(NSString *)headerText 105 | { 106 | NSTableColumn *sessionNumberColumn = [[NSTableColumn alloc] initWithIdentifier:@"sessionNumber"]; 107 | [[sessionNumberColumn headerCell] setStringValue:headerText]; 108 | [[sessionNumberColumn headerCell] setAlignment:NSCenterTextAlignment]; 109 | [[sessionNumberColumn dataCell] setDrawsBackground:NO]; 110 | [[sessionNumberColumn dataCell] setAlignment:NSCenterTextAlignment]; 111 | [sessionNumberColumn setWidth:20]; 112 | [sessionNumberColumn setMinWidth:15]; 113 | [sessionNumberColumn setMaxWidth:60]; 114 | [sessionNumberColumn setEditable:NO]; 115 | 116 | return sessionNumberColumn; 117 | 118 | } 119 | 120 | + (NSTableColumn *)createSessionActiveColumn:(NSString *)headerText 121 | { 122 | NSTableColumn *sessionActiveColumn = [[NSTableColumn alloc] initWithIdentifier:@"sessionActive"]; 123 | [[sessionActiveColumn headerCell] setStringValue:headerText]; 124 | [[sessionActiveColumn headerCell] setAlignment:NSCenterTextAlignment]; 125 | NSImageCell *imageCell = [[NSImageCell alloc] init]; 126 | [sessionActiveColumn setDataCell:imageCell]; 127 | [sessionActiveColumn setWidth:18]; 128 | [sessionActiveColumn setMinWidth:18]; 129 | [sessionActiveColumn setMaxWidth:18]; 130 | [sessionActiveColumn setEditable:NO]; 131 | 132 | return sessionActiveColumn; 133 | } 134 | 135 | + (NSTableColumn *)createSessionSDateColumn:(NSString *)headerText 136 | { 137 | NSTableColumn *sessionStartDateColumn = [[NSTableColumn alloc] initWithIdentifier:@"startDate"]; 138 | [[sessionStartDateColumn headerCell] setStringValue:headerText]; 139 | [[sessionStartDateColumn headerCell] setAlignment:NSLeftTextAlignment]; 140 | [[sessionStartDateColumn dataCell] setDrawsBackground:NO]; 141 | [[sessionStartDateColumn dataCell] setAlignment:NSLeftTextAlignment]; 142 | [sessionStartDateColumn setWidth:70]; 143 | [sessionStartDateColumn setMinWidth:60]; 144 | [sessionStartDateColumn setEditable:NO]; 145 | 146 | return sessionStartDateColumn; 147 | } 148 | 149 | + (NSTableColumn *)createSessionSTimeColumn:(NSString *)headerText 150 | { 151 | NSTableColumn *sessionStartTimeColumn = [[NSTableColumn alloc] initWithIdentifier:@"startTime"]; 152 | [[sessionStartTimeColumn headerCell] setStringValue:headerText]; 153 | [[sessionStartTimeColumn headerCell] setAlignment:NSLeftTextAlignment]; 154 | [[sessionStartTimeColumn dataCell] setDrawsBackground:NO]; 155 | [[sessionStartTimeColumn dataCell] setAlignment:NSLeftTextAlignment]; 156 | [sessionStartTimeColumn setWidth:75]; 157 | [sessionStartTimeColumn setMinWidth:60]; 158 | [sessionStartTimeColumn setEditable:NO]; 159 | 160 | return sessionStartTimeColumn; 161 | } 162 | 163 | + (NSTableColumn *)createSessionEDateColumn:(NSString *)headerText 164 | { 165 | NSTableColumn *sessionEndDateColumn = [[NSTableColumn alloc] initWithIdentifier:@"endDate"]; 166 | [[sessionEndDateColumn headerCell] setStringValue:headerText]; 167 | [[sessionEndDateColumn headerCell] setAlignment:NSLeftTextAlignment]; 168 | [[sessionEndDateColumn dataCell] setDrawsBackground:NO]; 169 | [[sessionEndDateColumn dataCell] setAlignment:NSLeftTextAlignment]; 170 | [sessionEndDateColumn setWidth:70]; 171 | [sessionEndDateColumn setMinWidth:60]; 172 | [sessionEndDateColumn setEditable:NO]; 173 | 174 | return sessionEndDateColumn; 175 | } 176 | 177 | + (NSTableColumn *)createSessionETimeColumn:(NSString *)headerText 178 | { 179 | NSTableColumn *sessionEndTimeColumn = [[NSTableColumn alloc] initWithIdentifier:@"endTime"]; 180 | [[sessionEndTimeColumn headerCell] setStringValue:headerText]; 181 | [[sessionEndTimeColumn headerCell] setAlignment:NSLeftTextAlignment]; 182 | [[sessionEndTimeColumn dataCell] setDrawsBackground:NO]; 183 | [[sessionEndTimeColumn dataCell] setAlignment:NSLeftTextAlignment]; 184 | [sessionEndTimeColumn setWidth:75]; 185 | [sessionEndTimeColumn setMinWidth:60]; 186 | [sessionEndTimeColumn setEditable:NO]; 187 | 188 | return sessionEndTimeColumn; 189 | } 190 | 191 | + (NSTableColumn *)createSessionPauseTimeColumn:(NSString *)headerText 192 | { 193 | NSTableColumn *sessionTotalTimeColumn = [[NSTableColumn alloc] initWithIdentifier:@"pauseTime"]; 194 | [[sessionTotalTimeColumn headerCell] setStringValue:headerText]; 195 | [[sessionTotalTimeColumn headerCell] setAlignment:NSLeftTextAlignment]; 196 | [[sessionTotalTimeColumn dataCell] setDrawsBackground:NO]; 197 | [[sessionTotalTimeColumn dataCell] setAlignment:NSLeftTextAlignment]; 198 | [sessionTotalTimeColumn setWidth:60]; 199 | [sessionTotalTimeColumn setMinWidth:60]; 200 | [sessionTotalTimeColumn setEditable:NO]; 201 | 202 | return sessionTotalTimeColumn; 203 | } 204 | 205 | + (NSTableColumn *)createSessionTotalTimeColumn:(NSString *)headerText 206 | { 207 | NSTableColumn *sessionTotalTimeColumn = [[NSTableColumn alloc] initWithIdentifier:@"totalTime"]; 208 | [[sessionTotalTimeColumn headerCell] setStringValue:headerText]; 209 | [[sessionTotalTimeColumn headerCell] setAlignment:NSLeftTextAlignment]; 210 | [[sessionTotalTimeColumn dataCell] setDrawsBackground:NO]; 211 | [[sessionTotalTimeColumn dataCell] setAlignment:NSLeftTextAlignment]; 212 | [sessionTotalTimeColumn setWidth:60]; 213 | [sessionTotalTimeColumn setMinWidth:60]; 214 | [sessionTotalTimeColumn setEditable:NO]; 215 | 216 | return sessionTotalTimeColumn; 217 | } 218 | 219 | + (NSTableColumn *)createSessionChargesColumn:(NSString *)headerText 220 | { 221 | NSTableColumn *sessionChargesColumn = [[NSTableColumn alloc] initWithIdentifier:@"sessionCharges"]; 222 | [[sessionChargesColumn headerCell] setStringValue:headerText]; 223 | [[sessionChargesColumn headerCell] setAlignment:NSLeftTextAlignment]; 224 | [[sessionChargesColumn dataCell] setDrawsBackground:NO]; 225 | [[sessionChargesColumn dataCell] setAlignment:NSLeftTextAlignment]; 226 | [sessionChargesColumn setWidth:60]; 227 | [sessionChargesColumn setMinWidth:60]; 228 | [sessionChargesColumn setEditable:NO]; 229 | 230 | return sessionChargesColumn; 231 | } 232 | 233 | + (NSTableColumn *)createSessionSummaryColumn:(NSString *)headerText 234 | { 235 | NSTableColumn *sessionSummaryColumn = [[NSTableColumn alloc] initWithIdentifier:@"sessionSummary"]; 236 | [[sessionSummaryColumn headerCell] setStringValue:headerText]; 237 | [[sessionSummaryColumn headerCell] setAlignment:NSLeftTextAlignment]; 238 | [[sessionSummaryColumn dataCell] setDrawsBackground:NO]; 239 | [[sessionSummaryColumn dataCell] setAlignment:NSLeftTextAlignment]; 240 | [sessionSummaryColumn setWidth:300]; 241 | [sessionSummaryColumn setMinWidth:15]; 242 | [sessionSummaryColumn setEditable:YES]; 243 | 244 | return sessionSummaryColumn; 245 | } 246 | @end -------------------------------------------------------------------------------- /English.lproj/MainMenu.nib/classes.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBClasses 6 | 7 | 8 | ACTIONS 9 | 10 | 11 | id 12 | 13 | CLASS 14 | FirstResponder 15 | LANGUAGE 16 | ObjC 17 | SUPERCLASS 18 | NSObject 19 | 20 | 21 | ACTIONS 22 | 23 | addJobButton 24 | id 25 | addJobCancel 26 | id 27 | addJobSave 28 | id 29 | addSessionButton 30 | id 31 | addSessionCancel 32 | id 33 | addSessionSave 34 | id 35 | deleteJobButton 36 | id 37 | deleteSessionButton 38 | id 39 | editJobButton 40 | id 41 | editJobCancel 42 | id 43 | editJobSave 44 | id 45 | editSessionButton 46 | id 47 | editSessionCancel 48 | id 49 | editSessionSave 50 | id 51 | jobMenuListSelectionChanged 52 | id 53 | menuAddData 54 | id 55 | menuBlatantAd 56 | id 57 | menuCheckForUpdates 58 | id 59 | menuDisplayHelp 60 | id 61 | menuDonate 62 | id 63 | menuExport 64 | id 65 | menuHTML 66 | id 67 | menuHTMLAll 68 | id 69 | menuOpenWindow 70 | id 71 | menuPauseAllJobs 72 | id 73 | menuPrintInvoice 74 | id 75 | menuSave 76 | id 77 | menuSendEmail 78 | id 79 | menuVisitWebsite 80 | id 81 | pauseUnpause 82 | id 83 | prefsJobTableChange 84 | id 85 | prefsMenuChanged 86 | id 87 | prefsSave 88 | id 89 | prefsSessionTableChange 90 | id 91 | prefsUpdateTimeChange 92 | id 93 | showPagePanel 94 | id 95 | showPreferencesPanel 96 | id 97 | startStopRecording 98 | id 99 | statusItemChanged 100 | id 101 | 102 | CLASS 103 | Controller 104 | LANGUAGE 105 | ObjC 106 | OUTLETS 107 | 108 | addJobClient 109 | id 110 | addJobHourlyRate 111 | id 112 | addJobJobName 113 | id 114 | addJobPanel 115 | id 116 | addSessionButton 117 | id 118 | addSessionEndDate 119 | id 120 | addSessionEndTime 121 | id 122 | addSessionPanel 123 | id 124 | addSessionStartDate 125 | id 126 | addSessionStartTime 127 | id 128 | deleteJobButton 129 | id 130 | deleteSessionButton 131 | id 132 | editJobButton 133 | id 134 | editJobClient 135 | id 136 | editJobHourlyRate 137 | id 138 | editJobJobName 139 | id 140 | editJobPanel 141 | id 142 | editSessionButton 143 | id 144 | editSessionEndDate 145 | id 146 | editSessionEndTime 147 | id 148 | editSessionPanel 149 | id 150 | editSessionStartDate 151 | id 152 | editSessionStartTime 153 | id 154 | jobTable 155 | id 156 | mainWindow 157 | id 158 | menuJobList 159 | NSMenu 160 | pauseButton 161 | id 162 | prefs2412Radio 163 | id 164 | prefsAskDeleteJob 165 | id 166 | prefsAskDeleteSession 167 | id 168 | prefsAutoDeleteSetting 169 | id 170 | prefsAutoSaveTime 171 | id 172 | prefsInvoiceBodyFont 173 | id 174 | prefsInvoiceHeader 175 | id 176 | prefsInvoiceHeaderFont 177 | id 178 | prefsInvoiceIndex 179 | id 180 | prefsInvoiceIndexHeader 181 | id 182 | prefsInvoiceIndexLink 183 | id 184 | prefsInvoiceSize 185 | id 186 | prefsInvoiceTitle 187 | id 188 | prefsJobDisplayCharges 189 | id 190 | prefsJobDisplayClient 191 | id 192 | prefsJobDisplayName 193 | id 194 | prefsJobDisplayNumber 195 | id 196 | prefsJobDisplayRate 197 | id 198 | prefsJobDisplayTime 199 | id 200 | prefsMenuAlertField 201 | id 202 | prefsMenuDisplayButton 203 | id 204 | prefsMenuDisplayCharges 205 | id 206 | prefsMenuDisplayList 207 | id 208 | prefsMenuDisplayTime 209 | id 210 | prefsMenuPauseButton 211 | id 212 | prefsMonetaryUnit 213 | id 214 | prefsSessionDisplayCharges 215 | id 216 | prefsSessionDisplayEDate 217 | id 218 | prefsSessionDisplayETime 219 | id 220 | prefsSessionDisplayNumber 221 | id 222 | prefsSessionDisplayPause 223 | id 224 | prefsSessionDisplaySDate 225 | id 226 | prefsSessionDisplaySTime 227 | id 228 | prefsSessionDisplaySummary 229 | id 230 | prefsSessionDisplayTotalTime 231 | id 232 | prefsUpdateEveryRadio 233 | id 234 | prefsWindow 235 | id 236 | printClientName 237 | id 238 | printHourlyRate 239 | id 240 | printJobName 241 | id 242 | printTable 243 | id 244 | printTotalCharges 245 | id 246 | printTotalTimeLogged 247 | id 248 | printWindow 249 | id 250 | sessionTable 251 | id 252 | startStopButton 253 | id 254 | startStopField 255 | id 256 | textArr 257 | id 258 | textBah 259 | id 260 | textCharges 261 | id 262 | textClientName 263 | id 264 | textDataMustBe 265 | id 266 | textDeleteJobLong 267 | id 268 | textDeleteJobShort 269 | id 270 | textDeleteSessionLong 271 | id 272 | textDeleteSessionShort 273 | id 274 | textEndLater 275 | id 276 | textExportTo 277 | id 278 | textHourSuffix 279 | id 280 | textJobActive 281 | id 282 | textJobName 283 | id 284 | textJobNumber 285 | id 286 | textMenuDisable 287 | id 288 | textNewVersion 289 | id 290 | textNoJobData 291 | id 292 | textPauses 293 | id 294 | textProblemConnect 295 | id 296 | textRate 297 | id 298 | textRejoice 299 | id 300 | textSelectFile 301 | id 302 | textSelectJob 303 | id 304 | textSessionActive 305 | id 306 | textSessionCharges 307 | id 308 | textSessionDate 309 | id 310 | textSessionEnd 311 | id 312 | textSessionEndDate 313 | id 314 | textSessionNumber 315 | id 316 | textSessionStart 317 | id 318 | textSessionSummary 319 | id 320 | textSessionTime 321 | id 322 | textStartRecording 323 | id 324 | textStopRecording 325 | id 326 | textTimeLogged 327 | id 328 | textTotalDue 329 | id 330 | textUpToDate 331 | id 332 | textYeargh 333 | id 334 | 335 | SUPERCLASS 336 | NSObject 337 | 338 | 339 | IBVersion 340 | 1 341 | 342 | 343 | -------------------------------------------------------------------------------- /CUPreferenceController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CUPreferenceController.m 3 | // Khronos 4 | // 5 | // Created by Gautam Dey on 6/29/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "CUPreferenceController.h" 10 | #import 11 | #import "CUPreferences.h" 12 | 13 | 14 | 15 | #define CU_PREF_CLOCK_12 12 16 | #define CU_PREF_CLOCK_24 24 17 | 18 | 19 | #define CU_PREF_UPTIME_SEC 0 20 | #define CU_PREF_UPTIME_MIN1 1 21 | #define CU_PREF_UPTIME_MIN15 15 22 | #define CU_PREF_UPTIME_MIN30 30 23 | #define CU_PREF_UPTIME_MIN60 60 24 | 25 | /*** Which columns in the Project table should be shown. ***/ 26 | // CUPreferencesProjectDisplay is a dictonary to hold the options for the Project Table. 27 | 28 | #define CU_PREF_PRJDSP_TAG_NUMBER 0 29 | #define CU_PREF_PRJDSP_TAG_NAME 1 30 | #define CU_PREF_PRJDSP_TAG_CLIENT 2 31 | #define CU_PREF_PRJDSP_TAG_RATE 3 32 | #define CU_PREF_PRJDSP_TAG_TIME 4 33 | #define CU_PREF_PRJDSP_TAG_CHARGES 5 34 | #define CU_PREF_PRJDSP_MAX_TAG_NUMBER 5 35 | 36 | /*** Which columns in the Session Table should be shown. ***/ 37 | // CUPreferencesSessionDisplay is a dictonary to hold the options for the Session Table. 38 | #define CU_PREF_SESDSP_TAG_STARTDATE 0 39 | #define CU_PREF_SESDSP_TAG_ENDDATE 1 40 | #define CU_PREF_SESDSP_TAG_STARTTIME 2 41 | #define CU_PREF_SESDSP_TAG_ENDTIME 3 42 | #define CU_PREF_SESDSP_TAG_PAUSETIME 4 43 | #define CU_PREF_SESDSP_TAG_TOTALTIME 5 44 | #define CU_PREF_SESDSP_TAG_CHARGES 6 45 | #define CU_PREF_SESDSP_TAG_SUMMARY 7 46 | #define CU_PREF_SESDSP_TAG_NUMBER 8 47 | #define CU_PREF_SESDSP_MAX_TAG_NUMBER 8 48 | 49 | /*** Options for the menu bar ***/ 50 | // CUPreferencesMenuDisplay dictonary to hold the options for the menu bar. 51 | 52 | #define CU_PREF_MENUDSP_TAG_PAUSEBUTTON 0 53 | #define CU_PREF_MENUDSP_TAG_RECRODINGBUTTON 1 54 | #define CU_PREF_MENUDSP_TAG_PROJECTLIST 2 55 | #define CU_PREF_MENUDSP_TAG_TOTALTIME 3 56 | #define CU_PREF_MENUDSP_TAG_CHARGES 4 57 | #define CU_PREF_MENUDSP_MAX_TAG_NUMBER 4 58 | 59 | 60 | 61 | @implementation CUPreferenceController 62 | 63 | - (id)init 64 | { 65 | if(![super initWithWindowNibName:@"Preferences"]) 66 | return nil; 67 | preferences = [[CUPreferences alloc] init]; 68 | return self; 69 | } 70 | 71 | - (void) dealloc 72 | { 73 | [preferences release]; 74 | [super dealloc]; 75 | } 76 | - (void) updatePreferences 77 | { 78 | NSDictionary *columns; 79 | int i; 80 | NSLog(@"Preferences NIB has loaded."); 81 | 82 | // Set the clock to the default. 83 | 84 | if([preferences is24HourClock]) { 85 | NSLog(@"Setting clock to 24 hour mode."); 86 | BOOL success = [clockSettings selectCellWithTag:CU_PREF_CLOCK_24]; 87 | if( !success) NSLog(@"Failed to select cell with tag %d",CU_PREF_CLOCK_24); 88 | } else { 89 | NSLog(@"Setting clock to 12 hour mode."); 90 | BOOL success = [clockSettings selectCellWithTag:CU_PREF_CLOCK_12]; 91 | if( !success ) NSLog(@"Failed to select cell with tag %d",CU_PREF_CLOCK_12); 92 | } 93 | 94 | NSLog(@"Setting update to every %d minutes.",[preferences updateTimeEvery]); 95 | [updateTime selectCellWithTag:[preferences updateTimeEvery]]; 96 | NSLog(@"Setting monetaryUnit to %@",[preferences monetaryUnit]); 97 | [aMonetaryUnit setStringValue:[preferences monetaryUnit]]; 98 | 99 | // Project Table Settings 100 | NSLog(@"Setting checkboxes for Project table."); 101 | columns = [preferences columnsForTable:CUPreferencesProjectDisplay]; 102 | for(i=0; i <= CU_PREF_PRJDSP_MAX_TAG_NUMBER; i++){ 103 | id cell = [projectTableColumns cellWithTag:i]; 104 | [cell setState:[[columns objectForKey:[self projectTableColumnNameForTag:i]] boolValue]]; 105 | } 106 | // Session Table Settings. 107 | NSLog(@"Setting checkboxes for Sesison Table."); 108 | columns = [preferences columnsForTable:CUPreferencesSessionDisplay]; 109 | for(i=0; i <= CU_PREF_SESDSP_MAX_TAG_NUMBER; i++){ 110 | id cell = [sessionTableColumns cellWithTag:i]; 111 | [cell setState:[[columns objectForKey:[self sessionTableColumnNameForTag:i]] boolValue]]; 112 | } 113 | // Menu Table Settings. 114 | NSLog(@"Setting checkboxes for Menu Table."); 115 | columns = [preferences columnsForTable:CUPreferencesMenuDisplay]; 116 | for(i=0; i <= CU_PREF_MENUDSP_MAX_TAG_NUMBER; i++){ 117 | id cell = [menuTableColumns cellWithTag:i]; 118 | [cell setState:[[columns objectForKey:[self menuTableColumnNameForTag:i]] boolValue]]; 119 | } 120 | 121 | // Invoice Settings 122 | NSLog(@"Seeting the text for Invoice"); 123 | [indexTitle setStringValue:[preferences invoiceIndexTitle]]; 124 | [indexHeading setStringValue:[preferences invoiceIndexHeading]]; 125 | [linkHelp setStringValue:[preferences invoiceLinkHelp]]; 126 | [invoiceTitle setStringValue:[preferences invoiceTitle]]; 127 | [invoiceHeading setStringValue:[preferences invoiceHeading]]; 128 | [bodyFont setObjectValue:[preferences invoiceBodyFont]]; 129 | [headingFont setObjectValue:[preferences invoiceHeadingFont]]; 130 | 131 | } 132 | - (void) windowDidLoad 133 | { 134 | [self updatePreferences]; 135 | 136 | } 137 | 138 | #pragma mark Project Table Options 139 | - (NSString *)projectTableColumnNameForTag:(int)tag 140 | { 141 | NSString *column = nil; 142 | switch (tag) { 143 | case CU_PREF_PRJDSP_TAG_NAME: 144 | column = CUPreferencesProjectDisplayName; 145 | break; 146 | case CU_PREF_PRJDSP_TAG_NUMBER: 147 | column = CUPreferencesProjectDisplayNumber; 148 | break; 149 | case CU_PREF_PRJDSP_TAG_CLIENT: 150 | column = CUPreferencesProjectDisplayClient; 151 | break; 152 | case CU_PREF_PRJDSP_TAG_RATE: 153 | column = CUPreferencesProjectDisplayRate; 154 | break; 155 | case CU_PREF_PRJDSP_TAG_TIME: 156 | column = CUPreferencesProjectDisplayTime; 157 | break; 158 | case CU_PREF_PRJDSP_TAG_CHARGES: 159 | column = CUPreferencesProjectDisplayCharges; 160 | break; 161 | default: 162 | // do nothing 163 | break; 164 | }; 165 | return column; 166 | } 167 | 168 | #pragma mark Session Table Options 169 | - (NSString *)sessionTableColumnNameForTag:(int)tag 170 | { 171 | NSString *column = nil; 172 | switch (tag) { 173 | case CU_PREF_SESDSP_TAG_STARTDATE: 174 | column = CUPreferencesSessionDisplayStartDate; 175 | break; 176 | case CU_PREF_SESDSP_TAG_ENDDATE: 177 | column = CUPreferencesSessionDisplayEndDate; 178 | break; 179 | case CU_PREF_SESDSP_TAG_STARTTIME: 180 | column = CUPreferencesSessionDisplayStartTime; 181 | break; 182 | case CU_PREF_SESDSP_TAG_ENDTIME: 183 | column = CUPreferencesSessionDisplayEndTime; 184 | break; 185 | case CU_PREF_SESDSP_TAG_PAUSETIME: 186 | column = CUPreferencesSessionDisplayPauseTime; 187 | break; 188 | case CU_PREF_SESDSP_TAG_TOTALTIME: 189 | column = CUPreferencesSessionDisplayTotalTime; 190 | break; 191 | case CU_PREF_SESDSP_TAG_CHARGES: 192 | column = CUPreferencesSessionDisplayCharges; 193 | break; 194 | case CU_PREF_SESDSP_TAG_SUMMARY: 195 | column = CUPreferencesSessionDisplaySummary; 196 | break; 197 | case CU_PREF_SESDSP_TAG_NUMBER: 198 | column = CUPreferencesSessionDisplayNumber; 199 | break; 200 | default: 201 | // do nothing 202 | break; 203 | }; 204 | return column; 205 | } 206 | 207 | 208 | #pragma mark Menu Options 209 | - (NSString *)menuTableColumnNameForTag:(int)tag 210 | { 211 | NSString *column = nil; 212 | switch (tag) { 213 | case CU_PREF_MENUDSP_TAG_PAUSEBUTTON: 214 | column = CUPreferencesMenuDisplayPauseButton; 215 | break; 216 | case CU_PREF_MENUDSP_TAG_RECRODINGBUTTON: 217 | column = CUPreferencesMenuDisplayRecrodingButton; 218 | break; 219 | case CU_PREF_MENUDSP_TAG_PROJECTLIST: 220 | column = CUPreferencesMenuDisplayProjectList; 221 | break; 222 | case CU_PREF_MENUDSP_TAG_TOTALTIME: 223 | column = CUPreferencesMenuDisplayTotalTime; 224 | break; 225 | case CU_PREF_MENUDSP_TAG_CHARGES: 226 | column = CUPreferencesMenuDisplayCharges; 227 | default: 228 | // do nothing 229 | break; 230 | }; 231 | return column; 232 | } 233 | #pragma mark Actions 234 | 235 | - (IBAction)resetPreferences:(id)sender 236 | { 237 | [CUPreferences resetPreferences]; 238 | NSLog(@"Refreshing the display."); 239 | [self updatePreferences]; 240 | } 241 | #pragma mark General Options Actions 242 | 243 | - (IBAction)changeAskDeleteProject:(id)sender 244 | { 245 | [preferences setAskDeleteProject:[askDeleteProject state]]; 246 | } 247 | 248 | -(IBAction)changeAskDeleteSession:(id)sender 249 | { 250 | [preferences setAskDeleteSession:[askDeleteSession state]]; 251 | } 252 | 253 | -(IBAction)changeAutoSaveTime:(id)sender 254 | { 255 | [preferences setAutoSaveTime:[autoSaveTime state]]; 256 | } 257 | 258 | -(IBAction) changeAutoDeleteSetting:(id)sender 259 | { 260 | [preferences setAutoDeleteSettings:[autoDeleteSettings state]]; 261 | } 262 | 263 | -(IBAction) changeClock:(id)sender 264 | { 265 | [preferences setIs24HourClock:([sender selectedTag] == CU_PREF_CLOCK_24)]; 266 | } 267 | 268 | - (IBAction) changeUpdateTime:(id)sender 269 | { 270 | [preferences setUpdateTimeEvery:[sender selectedTag]]; 271 | } 272 | 273 | - (IBAction) changeMonetaryUnit:(id)sender 274 | { 275 | [preferences setMonetaryUnit:[aMonetaryUnit stringValue]]; 276 | } 277 | 278 | #pragma mark Project Table Options Actions 279 | - (IBAction) changeProjectTableDisplay:(id)sender 280 | { 281 | id checkBox = [sender selectedCell]; 282 | int tag = [checkBox tag]; 283 | NSString *column = [self projectTableColumnNameForTag:tag]; 284 | if(column){ 285 | NSLog(@"Setting Project Table Column %@ default value.",column); 286 | [preferences setTable:CUPreferencesProjectDisplay column:column display:[checkBox state]]; 287 | } 288 | } 289 | 290 | #pragma mark Session Table Options Actions 291 | - (IBAction) changeSessionTableDisplay:(id)sender 292 | { 293 | id checkBox = [sender selectedCell]; 294 | int tag = [checkBox tag]; 295 | NSString *column = [self sessionTableColumnNameForTag:tag]; 296 | if(column){ 297 | NSLog(@"Setting Session Table Column %@ default value.",column); 298 | [preferences setTable:CUPreferencesSessionDisplay column:column display:[checkBox state]]; 299 | } 300 | } 301 | 302 | #pragma mark Menu Options Actions 303 | - (IBAction) changeMenuTableDisplay:(id)sender 304 | { 305 | id checkBox = [sender selectedCell]; 306 | int tag = [checkBox tag]; 307 | NSString *column = [self menuTableColumnNameForTag:tag]; 308 | if(column){ 309 | NSLog(@"Setting Menu Table Column %@ default value.",column); 310 | [preferences setTable:CUPreferencesMenuDisplay column:column display:[checkBox state]]; 311 | } 312 | } 313 | #pragma mark Invoice Options Actions 314 | - (IBAction) changeInvoiceIndexTitle:(id)sender 315 | { 316 | [preferences setInvoiceIndexTitle:[indexTitle stringValue]]; 317 | } 318 | 319 | -(IBAction) changeInvoiceIndexHeading:(id)sender 320 | { 321 | [preferences setInvoiceIndexHeading:[indexHeading stringValue]]; 322 | } 323 | 324 | - (IBAction) changeInvoiceTitle:(id)sender 325 | { 326 | [preferences setInvoiceTitle:[invoiceTitle stringValue]]; 327 | } 328 | 329 | -(IBAction) changeInvoiceLinkHelp:(id)sender 330 | { 331 | [preferences setInvoiceLinkHelp:[linkHelp stringValue]]; 332 | } 333 | 334 | -(IBAction) changeInvoiceHeading:(id)sender 335 | { 336 | [preferences setInvoiceHeading:[invoiceHeading stringValue]]; 337 | } 338 | 339 | -(IBAction) showFontPanelForHeading:(id)sender 340 | { 341 | 342 | NSFont *font = [preferences invoiceHeadingFont]; 343 | [[NSFontManager sharedFontManager] setSelectedFont:font 344 | isMultiple:NO]; 345 | NSLog(@"Changing the font manager action to changeInvoiceHeadingFont:"); 346 | [[NSFontManager sharedFontManager] setAction:@selector(changeInvoiceHeadingFont:)]; 347 | [[NSFontManager sharedFontManager] orderFrontFontPanel:self]; 348 | } 349 | -(IBAction) showFontPanelForBody:(id)sender 350 | { 351 | 352 | NSFont *font = [preferences invoiceBodyFont]; 353 | [[NSFontManager sharedFontManager] setSelectedFont:font 354 | isMultiple:NO]; 355 | NSLog(@"Changing the font manager action to changeInvoiceBodyFont:"); 356 | [[NSFontManager sharedFontManager] setAction:@selector(changeInvoiceBodyFont:)]; 357 | [[NSFontManager sharedFontManager] orderFrontFontPanel:self]; 358 | } 359 | 360 | 361 | -(IBAction) changeInvoiceHeadingFont:(id)sender 362 | { 363 | /* This action will open up the font panel. */ 364 | NSFontManager *aFontManager = sender; 365 | NSFont *aFont = [aFontManager convertFont:[preferences invoiceHeadingFont]]; 366 | NSLog(@"Changed Invoice Heading Font called with font name '%@' and size '%.0f'",[aFont fontName], [aFont pointSize]); 367 | [preferences setInvoiceHeadingFont:aFont]; 368 | [headingFont setObjectValue:[preferences invoiceHeadingFont]]; 369 | } 370 | 371 | -(IBAction) changeInvoiceBodyFont:(id)sender 372 | { 373 | /* This action will open up the font panel. */ 374 | NSFontManager *aFontManager = sender; 375 | NSFont *aFont = [aFontManager convertFont:[preferences invoiceBodyFont]]; 376 | NSLog(@"Changed Invoice Body Font called with font name '%@' and size '%.0f'",[aFont fontName], [aFont pointSize]); 377 | [preferences setInvoiceBodyFont:aFont]; 378 | [bodyFont setObjectValue:[preferences invoiceBodyFont]]; 379 | } 380 | 381 | 382 | @end 383 | -------------------------------------------------------------------------------- /Khronos.xcodeproj/cs.pbxuser: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | 089C165DFE840E0CC02AAC07 /* English */ = { 4 | uiCtxt = { 5 | sepNavIntBoundsRect = "{{0, 0}, {700, 430}}"; 6 | sepNavSelRange = "{230, 0}"; 7 | sepNavVisRect = "{{0, 0}, {700, 430}}"; 8 | }; 9 | }; 10 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 11 | activeBuildConfigurationName = Deployment; 12 | activeExecutable = 40458E1B0C3B464E00DB1FB9 /* Khronos */; 13 | activeTarget = 8D1107260486CEB800E47090 /* Khronos */; 14 | breakpointsGroup = 40458E3A0C3B46A100DB1FB9 /* XCBreakpointsBucket */; 15 | codeSenseManager = 40458E300C3B465700DB1FB9 /* Code sense */; 16 | executables = ( 17 | 40458E1B0C3B464E00DB1FB9 /* Khronos */, 18 | ); 19 | perUserDictionary = { 20 | PBXConfiguration.PBXFileTableDataSource3.PBXErrorsWarningsDataSource = { 21 | PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; 22 | PBXFileTableDataSourceColumnSortingKey = PBXErrorsWarningsDataSource_LocationID; 23 | PBXFileTableDataSourceColumnWidthsKey = ( 24 | 20, 25 | 300, 26 | 200, 27 | ); 28 | PBXFileTableDataSourceColumnsKey = ( 29 | PBXErrorsWarningsDataSource_TypeID, 30 | PBXErrorsWarningsDataSource_MessageID, 31 | PBXErrorsWarningsDataSource_LocationID, 32 | ); 33 | }; 34 | PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = { 35 | PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; 36 | PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID; 37 | PBXFileTableDataSourceColumnWidthsKey = ( 38 | 22, 39 | 300, 40 | 322, 41 | ); 42 | PBXFileTableDataSourceColumnsKey = ( 43 | PBXExecutablesDataSource_ActiveFlagID, 44 | PBXExecutablesDataSource_NameID, 45 | PBXExecutablesDataSource_CommentsID, 46 | ); 47 | }; 48 | PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { 49 | PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; 50 | PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; 51 | PBXFileTableDataSourceColumnWidthsKey = ( 52 | 20, 53 | 502, 54 | 20, 55 | 48, 56 | 43, 57 | 43, 58 | 20, 59 | ); 60 | PBXFileTableDataSourceColumnsKey = ( 61 | PBXFileDataSource_FiletypeID, 62 | PBXFileDataSource_Filename_ColumnID, 63 | PBXFileDataSource_Built_ColumnID, 64 | PBXFileDataSource_ObjectSize_ColumnID, 65 | PBXFileDataSource_Errors_ColumnID, 66 | PBXFileDataSource_Warnings_ColumnID, 67 | PBXFileDataSource_Target_ColumnID, 68 | ); 69 | }; 70 | PBXConfiguration.PBXFileTableDataSource3.PBXFindDataSource = { 71 | PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; 72 | PBXFileTableDataSourceColumnSortingKey = PBXFindDataSource_LocationID; 73 | PBXFileTableDataSourceColumnWidthsKey = ( 74 | 200, 75 | 120, 76 | ); 77 | PBXFileTableDataSourceColumnsKey = ( 78 | PBXFindDataSource_MessageID, 79 | PBXFindDataSource_LocationID, 80 | ); 81 | }; 82 | PBXPerProjectTemplateStateSaveDate = 205251733; 83 | PBXWorkspaceStateSaveDate = 205251733; 84 | }; 85 | perUserProjectItems = { 86 | 403765420C3BE4A000C5A9D5 /* PBXTextBookmark */ = 403765420C3BE4A000C5A9D5 /* PBXTextBookmark */; 87 | 40A773400C3B868700DFFD02 = 40A773400C3B868700DFFD02 /* PBXTextBookmark */; 88 | 40A773410C3B868700DFFD02 = 40A773410C3B868700DFFD02 /* PBXTextBookmark */; 89 | 40A773430C3B868700DFFD02 = 40A773430C3B868700DFFD02 /* PBXTextBookmark */; 90 | 40A773450C3B868700DFFD02 = 40A773450C3B868700DFFD02 /* PBXBookmark */; 91 | 40A773460C3B868700DFFD02 = 40A773460C3B868700DFFD02 /* PBXTextBookmark */; 92 | 40A773480C3B868700DFFD02 = 40A773480C3B868700DFFD02 /* PBXTextBookmark */; 93 | 40A773490C3B868700DFFD02 = 40A773490C3B868700DFFD02 /* PBXTextBookmark */; 94 | 40A7734A0C3B868700DFFD02 = 40A7734A0C3B868700DFFD02 /* PBXTextBookmark */; 95 | 40A7734C0C3B868700DFFD02 = 40A7734C0C3B868700DFFD02 /* PBXTextBookmark */; 96 | 40A7734E0C3B868700DFFD02 = 40A7734E0C3B868700DFFD02 /* PBXTextBookmark */; 97 | 40A773500C3B868700DFFD02 = 40A773500C3B868700DFFD02 /* PBXBookmark */; 98 | 40A773510C3B868700DFFD02 = 40A773510C3B868700DFFD02 /* PBXTextBookmark */; 99 | 40A7735C0C3B87B200DFFD02 = 40A7735C0C3B87B200DFFD02 /* PBXBookmark */; 100 | 40A7735F0C3B87B200DFFD02 = 40A7735F0C3B87B200DFFD02 /* PBXBookmark */; 101 | 40A7736F0C3B8A7100DFFD02 = 40A7736F0C3B8A7100DFFD02 /* PBXTextBookmark */; 102 | 40A773760C3B8AA000DFFD02 = 40A773760C3B8AA000DFFD02 /* PBXTextBookmark */; 103 | 40A773770C3B8AA000DFFD02 = 40A773770C3B8AA000DFFD02 /* PBXTextBookmark */; 104 | 40A7737D0C3B8C6A00DFFD02 = 40A7737D0C3B8C6A00DFFD02 /* PBXTextBookmark */; 105 | }; 106 | sourceControlManager = 40458E2F0C3B465700DB1FB9 /* Source Control */; 107 | userBuildSettings = { 108 | }; 109 | }; 110 | 29B97316FDCFA39411CA2CEA /* main.m */ = { 111 | uiCtxt = { 112 | sepNavIntBoundsRect = "{{0, 0}, {843, 263}}"; 113 | sepNavSelRange = "{60, 42}"; 114 | sepNavVisRect = "{{0, 0}, {843, 263}}"; 115 | }; 116 | }; 117 | 403765420C3BE4A000C5A9D5 /* PBXTextBookmark */ = { 118 | isa = PBXTextBookmark; 119 | fRef = 8BC21A8805D881FF001C2B42 /* Controller.m */; 120 | name = "Controller.m: 464"; 121 | rLen = 0; 122 | rLoc = 25991; 123 | rType = 0; 124 | vrLen = 1308; 125 | vrLoc = 25353; 126 | }; 127 | 40458E1B0C3B464E00DB1FB9 /* Khronos */ = { 128 | isa = PBXExecutable; 129 | activeArgIndex = 2147483647; 130 | activeArgIndices = ( 131 | ); 132 | argumentStrings = ( 133 | ); 134 | autoAttachOnCrash = 1; 135 | configStateDict = { 136 | }; 137 | customDataFormattersEnabled = 1; 138 | debuggerPlugin = GDBDebugging; 139 | disassemblyDisplayState = 0; 140 | dylibVariantSuffix = ""; 141 | enableDebugStr = 1; 142 | environmentEntries = ( 143 | ); 144 | executableSystemSymbolLevel = 0; 145 | executableUserSymbolLevel = 0; 146 | libgmallocEnabled = 0; 147 | name = Khronos; 148 | savedGlobals = { 149 | }; 150 | sourceDirectories = ( 151 | ); 152 | }; 153 | 40458E2F0C3B465700DB1FB9 /* Source Control */ = { 154 | isa = PBXSourceControlManager; 155 | fallbackIsa = XCSourceControlManager; 156 | isSCMEnabled = 0; 157 | scmConfiguration = { 158 | }; 159 | scmType = ""; 160 | }; 161 | 40458E300C3B465700DB1FB9 /* Code sense */ = { 162 | isa = PBXCodeSenseManager; 163 | indexTemplatePath = ""; 164 | }; 165 | 40458E3A0C3B46A100DB1FB9 /* XCBreakpointsBucket */ = { 166 | isa = XCBreakpointsBucket; 167 | name = "Project Breakpoints"; 168 | objects = ( 169 | ); 170 | }; 171 | 40A773400C3B868700DFFD02 /* PBXTextBookmark */ = { 172 | isa = PBXTextBookmark; 173 | fRef = 8BEC38CA05D9512D00533678 /* prefs.txt */; 174 | name = "prefs.txt: 1"; 175 | rLen = 0; 176 | rLoc = 0; 177 | rType = 0; 178 | vrLen = 12; 179 | vrLoc = 17; 180 | }; 181 | 40A773410C3B868700DFFD02 /* PBXTextBookmark */ = { 182 | isa = PBXTextBookmark; 183 | fRef = 40A773420C3B868700DFFD02 /* info.nib */; 184 | name = "(null): 1"; 185 | rLen = 0; 186 | rLoc = 0; 187 | rType = 0; 188 | vrLen = 871; 189 | vrLoc = 0; 190 | }; 191 | 40A773420C3B868700DFFD02 /* info.nib */ = { 192 | isa = PBXFileReference; 193 | lastKnownFileType = text.xml; 194 | name = info.nib; 195 | path = "/Users/cs/Cocoa/googlecode/khronos--time-tracker/English.lproj/MainMenu.nib/info.nib"; 196 | sourceTree = ""; 197 | }; 198 | 40A773430C3B868700DFFD02 /* PBXTextBookmark */ = { 199 | isa = PBXTextBookmark; 200 | fRef = 40A773440C3B868700DFFD02 /* classes.nib */; 201 | name = "(null): 13"; 202 | rLen = 0; 203 | rLoc = 396; 204 | rType = 0; 205 | vrLen = 1066; 206 | vrLoc = 0; 207 | }; 208 | 40A773440C3B868700DFFD02 /* classes.nib */ = { 209 | isa = PBXFileReference; 210 | lastKnownFileType = text; 211 | name = classes.nib; 212 | path = "/Users/cs/Cocoa/googlecode/khronos--time-tracker/English.lproj/MainMenu.nib/classes.nib"; 213 | sourceTree = ""; 214 | }; 215 | 40A773450C3B868700DFFD02 /* PBXBookmark */ = { 216 | isa = PBXBookmark; 217 | fRef = 8B217FC505DC64CF008C95F4 /* jobActive.png */; 218 | }; 219 | 40A773460C3B868700DFFD02 /* PBXTextBookmark */ = { 220 | isa = PBXTextBookmark; 221 | fRef = 089C165DFE840E0CC02AAC07 /* English */; 222 | name = "English: 6"; 223 | rLen = 0; 224 | rLoc = 230; 225 | rType = 0; 226 | vrLen = 255; 227 | vrLoc = 0; 228 | }; 229 | 40A773480C3B868700DFFD02 /* PBXTextBookmark */ = { 230 | isa = PBXTextBookmark; 231 | fRef = 8BEC38CA05D9512D00533678 /* prefs.txt */; 232 | name = "prefs.txt: 1"; 233 | rLen = 0; 234 | rLoc = 0; 235 | rType = 0; 236 | vrLen = 12; 237 | vrLoc = 17; 238 | }; 239 | 40A773490C3B868700DFFD02 /* PBXTextBookmark */ = { 240 | isa = PBXTextBookmark; 241 | fRef = 089C165DFE840E0CC02AAC07 /* English */; 242 | name = "English: 6"; 243 | rLen = 0; 244 | rLoc = 230; 245 | rType = 0; 246 | vrLen = 255; 247 | vrLoc = 0; 248 | }; 249 | 40A7734A0C3B868700DFFD02 /* PBXTextBookmark */ = { 250 | isa = PBXTextBookmark; 251 | fRef = 40A7734B0C3B868700DFFD02 /* classes.nib */; 252 | name = "(null): 1"; 253 | rLen = 0; 254 | rLoc = 0; 255 | rType = 0; 256 | vrLen = 1066; 257 | vrLoc = 0; 258 | }; 259 | 40A7734B0C3B868700DFFD02 /* classes.nib */ = { 260 | isa = PBXFileReference; 261 | lastKnownFileType = text; 262 | name = classes.nib; 263 | path = "/Users/cs/Cocoa/googlecode/khronos--time-tracker/English.lproj/MainMenu.nib/classes.nib"; 264 | sourceTree = ""; 265 | }; 266 | 40A7734C0C3B868700DFFD02 /* PBXTextBookmark */ = { 267 | isa = PBXTextBookmark; 268 | fRef = 40A7734D0C3B868700DFFD02 /* info.nib */; 269 | name = "(null): 1"; 270 | rLen = 0; 271 | rLoc = 0; 272 | rType = 0; 273 | vrLen = 871; 274 | vrLoc = 0; 275 | }; 276 | 40A7734D0C3B868700DFFD02 /* info.nib */ = { 277 | isa = PBXFileReference; 278 | lastKnownFileType = text.xml; 279 | name = info.nib; 280 | path = "/Users/cs/Cocoa/googlecode/khronos--time-tracker/English.lproj/MainMenu.nib/info.nib"; 281 | sourceTree = ""; 282 | }; 283 | 40A7734E0C3B868700DFFD02 /* PBXTextBookmark */ = { 284 | isa = PBXTextBookmark; 285 | fRef = 40A7734F0C3B868700DFFD02 /* classes.nib */; 286 | name = "(null): 13"; 287 | rLen = 0; 288 | rLoc = 396; 289 | rType = 0; 290 | vrLen = 1066; 291 | vrLoc = 0; 292 | }; 293 | 40A7734F0C3B868700DFFD02 /* classes.nib */ = { 294 | isa = PBXFileReference; 295 | lastKnownFileType = text; 296 | name = classes.nib; 297 | path = "/Users/cs/Cocoa/googlecode/khronos--time-tracker/English.lproj/MainMenu.nib/classes.nib"; 298 | sourceTree = ""; 299 | }; 300 | 40A773500C3B868700DFFD02 /* PBXBookmark */ = { 301 | isa = PBXBookmark; 302 | fRef = 8B217FC505DC64CF008C95F4 /* jobActive.png */; 303 | }; 304 | 40A773510C3B868700DFFD02 /* PBXTextBookmark */ = { 305 | isa = PBXTextBookmark; 306 | fRef = 089C165DFE840E0CC02AAC07 /* English */; 307 | name = "English: 6"; 308 | rLen = 0; 309 | rLoc = 230; 310 | rType = 0; 311 | vrLen = 255; 312 | vrLoc = 0; 313 | }; 314 | 40A7735C0C3B87B200DFFD02 /* PBXBookmark */ = { 315 | isa = PBXBookmark; 316 | fRef = 8B1E334405D8993C000E3A53 /* showSessions.gif */; 317 | }; 318 | 40A7735E0C3B87B200DFFD02 /* Cocoa.h */ = { 319 | isa = PBXFileReference; 320 | lastKnownFileType = sourcecode.c.h; 321 | name = Cocoa.h; 322 | path = /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h; 323 | sourceTree = ""; 324 | }; 325 | 40A7735F0C3B87B200DFFD02 /* PBXBookmark */ = { 326 | isa = PBXBookmark; 327 | fRef = 8B1E334405D8993C000E3A53 /* showSessions.gif */; 328 | }; 329 | 40A7736F0C3B8A7100DFFD02 /* PBXTextBookmark */ = { 330 | isa = PBXTextBookmark; 331 | fRef = 8BC21A8805D881FF001C2B42 /* Controller.m */; 332 | rLen = 18; 333 | rLoc = 26087; 334 | rType = 0; 335 | }; 336 | 40A773760C3B8AA000DFFD02 /* PBXTextBookmark */ = { 337 | isa = PBXTextBookmark; 338 | fRef = 40A7735E0C3B87B200DFFD02 /* Cocoa.h */; 339 | name = "Cocoa.h: 12"; 340 | rLen = 0; 341 | rLoc = 428; 342 | rType = 0; 343 | vrLen = 485; 344 | vrLoc = 0; 345 | }; 346 | 40A773770C3B8AA000DFFD02 /* PBXTextBookmark */ = { 347 | isa = PBXTextBookmark; 348 | fRef = 40A7735E0C3B87B200DFFD02 /* Cocoa.h */; 349 | name = "Cocoa.h: 12"; 350 | rLen = 0; 351 | rLoc = 428; 352 | rType = 0; 353 | vrLen = 485; 354 | vrLoc = 0; 355 | }; 356 | 40A7737D0C3B8C6A00DFFD02 /* PBXTextBookmark */ = { 357 | isa = PBXTextBookmark; 358 | fRef = 8BC21A8805D881FF001C2B42 /* Controller.m */; 359 | name = "Controller.m: 464"; 360 | rLen = 0; 361 | rLoc = 25991; 362 | rType = 0; 363 | vrLen = 1308; 364 | vrLoc = 25353; 365 | }; 366 | 8B8C911805DAFB7200B25096 /* cuDateTime.h */ = { 367 | uiCtxt = { 368 | sepNavIntBoundsRect = "{{0, 0}, {940, 882}}"; 369 | sepNavSelRange = "{1308, 0}"; 370 | sepNavVisRect = "{{0, 0}, {940, 645}}"; 371 | sepNavWindowFrame = "{{61, 57}, {979, 774}}"; 372 | }; 373 | }; 374 | 8B8C911905DAFB7200B25096 /* cuDateTime.m */ = { 375 | uiCtxt = { 376 | sepNavIntBoundsRect = "{{0, 0}, {940, 11410}}"; 377 | sepNavSelRange = "{0, 0}"; 378 | sepNavVisRect = "{{0, 10765}, {940, 645}}"; 379 | sepNavWindowFrame = "{{84, 36}, {979, 774}}"; 380 | }; 381 | }; 382 | 8BC21A8705D881FF001C2B42 /* Controller.h */ = { 383 | uiCtxt = { 384 | sepNavIntBoundsRect = "{{0, 0}, {940, 3864}}"; 385 | sepNavSelRange = "{7072, 0}"; 386 | sepNavVisRect = "{{0, 3219}, {940, 645}}"; 387 | sepNavWindowFrame = "{{38, 78}, {979, 774}}"; 388 | }; 389 | }; 390 | 8BC21A8805D881FF001C2B42 /* Controller.m */ = { 391 | uiCtxt = { 392 | sepNavIntBoundsRect = "{{0, 0}, {1046, 36232}}"; 393 | sepNavSelRange = "{25991, 0}"; 394 | sepNavVisRect = "{{0, 6300}, {700, 430}}"; 395 | sepNavWindowFrame = "{{30, 85}, {1168, 793}}"; 396 | }; 397 | }; 398 | 8BEBC03205DAA11100534DBC /* tableGenerator.h */ = { 399 | uiCtxt = { 400 | sepNavIntBoundsRect = "{{0, 0}, {940, 645}}"; 401 | sepNavSelRange = "{123, 0}"; 402 | sepNavVisRect = "{{0, 0}, {940, 645}}"; 403 | sepNavWindowFrame = "{{107, 15}, {979, 774}}"; 404 | }; 405 | }; 406 | 8BEBC03305DAA11100534DBC /* tableGenerator.m */ = { 407 | uiCtxt = { 408 | sepNavIntBoundsRect = "{{0, 0}, {940, 3444}}"; 409 | sepNavSelRange = "{0, 0}"; 410 | sepNavVisRect = "{{0, 2799}, {940, 645}}"; 411 | sepNavWindowFrame = "{{15, 99}, {979, 774}}"; 412 | }; 413 | }; 414 | 8BEC38CA05D9512D00533678 /* prefs.txt */ = { 415 | uiCtxt = { 416 | sepNavIntBoundsRect = "{{0, 0}, {700, 644}}"; 417 | sepNavSelRange = "{0, 0}"; 418 | sepNavVisRect = "{{0, 70}, {700, 48}}"; 419 | }; 420 | }; 421 | 8D1107260486CEB800E47090 /* Khronos */ = { 422 | activeExec = 0; 423 | executables = ( 424 | 40458E1B0C3B464E00DB1FB9 /* Khronos */, 425 | ); 426 | }; 427 | } 428 | -------------------------------------------------------------------------------- /dataHandler.m: -------------------------------------------------------------------------------- 1 | #import "dataHandler.h" 2 | 3 | @implementation dataHandler 4 | + (NSMutableArray *)createJobListFromFile:(NSString *)dataPath 5 | { 6 | NSMutableArray *jobData = [[NSMutableArray alloc] init]; 7 | 8 | NSString *theData = [NSString stringWithContentsOfFile:dataPath]; 9 | 10 | int i = 0; 11 | int lowRange = 0; 12 | int count = [theData length]; 13 | 14 | while (i < count) 15 | { 16 | if ([theData characterAtIndex:i] == '\n' && [theData characterAtIndex:i - 1] == '\n') 17 | { 18 | [jobData addObject:[self createJobFromString:[theData substringWithRange:NSMakeRange(lowRange, i - lowRange)]]]; 19 | lowRange = i + 1; 20 | } 21 | 22 | i++; 23 | } 24 | 25 | return jobData; 26 | } 27 | 28 | + (void)saveJobListToFile:(NSArray *)jobData 29 | { 30 | NSMutableString *jobDataString = [[[NSMutableString alloc] init] autorelease]; 31 | [jobDataString setString:[self generateSaveString:jobData]]; 32 | 33 | NSFileManager *fileManager = [NSFileManager defaultManager]; 34 | if (![fileManager fileExistsAtPath:[@"~/Library/Application Support/Khronos" stringByExpandingTildeInPath]]) 35 | [fileManager createDirectoryAtPath:[@"~/Library/Application Support/Khronos/" stringByExpandingTildeInPath] attributes:nil]; 36 | 37 | [jobDataString writeToFile:[@"~/Library/Application Support/Khronos/khronosData.khd" stringByExpandingTildeInPath] atomically:NO]; 38 | } 39 | 40 | + (void)exportData:(NSArray *)jobData text:(NSString *)textForPanel 41 | { 42 | NSSavePanel *savePanel = [NSSavePanel savePanel]; 43 | [savePanel setTitle:textForPanel]; 44 | int i = [savePanel runModal]; 45 | if (i == NSOKButton) 46 | { 47 | NSMutableString *dataPath = [[[NSMutableString alloc] init] autorelease]; 48 | [dataPath setString:[savePanel filename]]; 49 | NSMutableString *jobDataString = [[[NSMutableString alloc] init] autorelease]; 50 | 51 | [jobDataString setString:[self generateSaveString:jobData]]; 52 | 53 | [dataPath appendString:@".khd"]; 54 | [jobDataString writeToFile:dataPath atomically:NO]; 55 | } 56 | } 57 | + (NSString *)generateSaveString:(NSArray *)jobData 58 | { 59 | NSMutableString *jobDataString = [[[NSMutableString alloc] init] autorelease]; 60 | int i = 0; 61 | int count = [jobData count]; 62 | int j = 0; 63 | int sessionCount = 0; 64 | NSString *summary; 65 | NSMutableArray *sessionList = [[[NSMutableArray alloc] init] autorelease]; 66 | while (i < count) 67 | { 68 | [jobDataString appendString:[[[jobData objectAtIndex:i] objectForKey:@"jobNumber"] stringValue]]; 69 | [jobDataString appendString:@"\t"]; 70 | [jobDataString appendString:[[jobData objectAtIndex:i] objectForKey:@"jobName"]]; 71 | [jobDataString appendString:@"\t"]; 72 | [jobDataString appendString:[[jobData objectAtIndex:i] objectForKey:@"clientName"]]; 73 | [jobDataString appendString:@"\t"]; 74 | [jobDataString appendString:[[[jobData objectAtIndex:i] objectForKey:@"hourlyRate"] stringValue]]; 75 | [jobDataString appendString:@"\t"]; 76 | [jobDataString appendString:@"\n"]; 77 | 78 | sessionCount = [[[jobData objectAtIndex:i] objectForKey:@"sessionList"] count]; 79 | [sessionList setArray:[[jobData objectAtIndex:i] objectForKey:@"sessionList"]]; 80 | while (j < sessionCount) 81 | { 82 | [jobDataString appendString:[[[sessionList objectAtIndex:j] objectForKey:@"sessionNumber"] stringValue]]; 83 | [jobDataString appendString:@"\t"]; 84 | [jobDataString appendString:[[[sessionList objectAtIndex:j] objectForKey:@"startDateTime"] getDateString]]; 85 | [jobDataString appendString:@"\t"]; 86 | [jobDataString appendString:[[[sessionList objectAtIndex:j] objectForKey:@"startDateTime"] getTimeString]]; 87 | [jobDataString appendString:@"\t"]; 88 | [jobDataString appendString:[[[sessionList objectAtIndex:j] objectForKey:@"endDateTime"] getDateString]]; 89 | [jobDataString appendString:@"\t"]; 90 | [jobDataString appendString:[[[sessionList objectAtIndex:j] objectForKey:@"endDateTime"] getTimeString]]; 91 | [jobDataString appendString:@"\t"]; 92 | [jobDataString appendString:[[[sessionList objectAtIndex:j] objectForKey:@"pauseTime"] getTimeString]]; 93 | [jobDataString appendString:@"\t"]; 94 | summary = [[sessionList objectAtIndex:j] objectForKey:@"sessionSummary"]; 95 | if ([summary length] == 0) [jobDataString appendString:@" "]; 96 | else [jobDataString appendString:[[sessionList objectAtIndex:j] objectForKey:@"sessionSummary"]]; 97 | [jobDataString appendString:@"\t"]; 98 | [jobDataString appendString:@"\n"]; 99 | 100 | j++; 101 | } 102 | 103 | [jobDataString appendString:@"\n"]; 104 | 105 | i++; 106 | j = 0; 107 | } 108 | 109 | return jobDataString; 110 | } 111 | 112 | + (NSArray *)importData:(NSArray *)jobData text:(NSString *)textForPanel 113 | { 114 | NSOpenPanel *openPanel = [NSOpenPanel openPanel]; 115 | [openPanel setTitle:textForPanel]; 116 | [openPanel setCanChooseDirectories:YES]; 117 | [openPanel setCanChooseFiles:YES]; 118 | 119 | int i = [openPanel runModal]; 120 | 121 | if (i == NSOKButton) 122 | { 123 | NSFileManager *fileManager = [NSFileManager defaultManager]; 124 | NSMutableArray *originalData = [[[NSMutableArray alloc] init] autorelease]; 125 | NSMutableArray *newData = [[[NSMutableArray alloc] init] autorelease]; 126 | [originalData setArray:jobData]; 127 | 128 | NSString *targetFilePath = [openPanel filename]; 129 | BOOL directoryBool = NO; 130 | if ([fileManager fileExistsAtPath:targetFilePath isDirectory:&directoryBool] && directoryBool) 131 | { 132 | NSArray *targetContents = [fileManager directoryContentsAtPath:targetFilePath]; 133 | BOOL jobDataFound = NO; 134 | 135 | int k = 0; 136 | int fileCount = [targetContents count]; 137 | while (k < fileCount) 138 | { 139 | if ([[targetContents objectAtIndex:k] isEqualTo:@"jobData.txt"]) jobDataFound = YES; 140 | k++; 141 | } 142 | 143 | if (!jobDataFound) NSRunAlertPanel(@"Arr", @"No usable job data file found in this directory.", @"OK", nil, nil); 144 | else 145 | { 146 | NSMutableString *jobDataPath = [[[NSMutableString alloc] init] autorelease]; 147 | [jobDataPath setString:[targetFilePath stringByAppendingString:@"/jobData.txt"]]; 148 | NSString *jobDataTextString = [NSString stringWithContentsOfFile:jobDataPath]; 149 | 150 | int l = 0; 151 | int jobDataStringCount = [jobDataTextString length]; 152 | int jobDataStringLowRange = 0; 153 | while (l < jobDataStringCount) 154 | { 155 | if ([jobDataTextString characterAtIndex:l] == '\n') 156 | { 157 | [newData addObject:[dataHandler createJobFrom11String:[jobDataTextString substringWithRange:NSMakeRange(jobDataStringLowRange, l - jobDataStringLowRange)]]]; 158 | jobDataStringLowRange = l + 1; 159 | } 160 | l++; 161 | } 162 | 163 | NSMutableString *sessionDataString = [[[NSMutableString alloc] init] autorelease]; 164 | [sessionDataString setString:[targetFilePath stringByAppendingString:@"/"]]; 165 | l = 0; 166 | int newJobDataCount = [newData count]; 167 | while (l < newJobDataCount) 168 | { 169 | [[newData objectAtIndex:l] setObject:[self createSessionListFrom11Data: 170 | [sessionDataString stringByAppendingString:[[newData objectAtIndex:l] objectForKey:@"jobName"]]] 171 | forKey:@"sessionList"]; 172 | l++; 173 | } 174 | } 175 | } 176 | else if ([fileManager fileExistsAtPath:targetFilePath isDirectory:&directoryBool] && !directoryBool) 177 | { 178 | if (![[targetFilePath substringFromIndex:[targetFilePath length] - 4] isEqualTo:@".khd"]) 179 | { 180 | NSRunAlertPanel(@"Arr", @"Data must be of type khd or a directory.", @"OK", nil, nil); 181 | } 182 | else [newData setArray:[dataHandler createJobListFromFile:targetFilePath]]; 183 | } 184 | 185 | int i = 0; 186 | int testInt = 1; 187 | int count = [originalData count]; 188 | while (i < count) 189 | { 190 | if ([[[originalData objectAtIndex:i] objectForKey:@"jobNumber"] intValue] >= testInt) 191 | testInt = [[[originalData objectAtIndex:i] objectForKey:@"jobNumber"] intValue] + 1; 192 | i++; 193 | } 194 | 195 | int j = 0; 196 | int newCount = [newData count]; 197 | while (j < newCount) 198 | { 199 | [[newData objectAtIndex:j] setObject:[NSNumber numberWithInt:testInt] forKey:@"jobNumber"]; 200 | [originalData addObject:[newData objectAtIndex:j]]; 201 | testInt++; 202 | j++; 203 | } 204 | 205 | return originalData; 206 | } 207 | else 208 | { 209 | return jobData; 210 | } 211 | } 212 | 213 | + (NSMutableDictionary *)createJobFromString:(NSString *)jobDataString 214 | { 215 | NSNumber *jobNumber = [NSNumber numberWithInt:0]; 216 | NSMutableString *nameString = [[[NSMutableString alloc] init] autorelease]; 217 | NSMutableString *clientString = [[[NSMutableString alloc] init] autorelease]; 218 | NSNumber *hourlyRate = [NSNumber numberWithDouble:0]; 219 | 220 | int i = 0; 221 | int count = [jobDataString length]; 222 | int dataCount = 0; 223 | int lowRange = 0; 224 | while (i < count && [jobDataString characterAtIndex:i] != '\n') 225 | { 226 | if ([jobDataString characterAtIndex:i] == '\t') 227 | { 228 | if (dataCount == 0) jobNumber = [NSNumber numberWithInt:[[jobDataString substringToIndex:i] intValue]]; 229 | if (dataCount == 1) [nameString setString:[jobDataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 230 | if (dataCount == 2) [clientString setString:[jobDataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 231 | if (dataCount == 3) hourlyRate = [NSNumber numberWithDouble:[[jobDataString substringWithRange:NSMakeRange(lowRange, i - lowRange)] doubleValue]]; 232 | 233 | lowRange = i + 1; 234 | dataCount++; 235 | } 236 | i++; 237 | } 238 | 239 | NSMutableDictionary *tempJob = [[NSMutableDictionary alloc] init]; 240 | [tempJob setObject:jobNumber forKey:@"jobNumber"]; 241 | [tempJob setObject:@"No" forKey:@"jobActive"]; 242 | [tempJob setObject:nameString forKey:@"jobName"]; 243 | [tempJob setObject:clientString forKey:@"clientName"]; 244 | cuDateTime *tempTimeLogged = [[[cuDateTime alloc] initWithTimeString:@"0:00:00"] autorelease]; 245 | [tempJob setObject:tempTimeLogged forKey:@"jobTimeLogged"]; 246 | [tempJob setObject:hourlyRate forKey:@"hourlyRate"]; 247 | [tempJob setObject:[NSNumber numberWithDouble:0] forKey:@"jobCharges"]; 248 | 249 | NSMutableArray *tempSessionList = [[NSMutableArray alloc] init]; 250 | 251 | NSString *sessionDataString = [jobDataString substringFromIndex:i + 1]; 252 | int subCount = [sessionDataString length]; 253 | int j = 0; 254 | int subLowRange = 0; 255 | while (j < subCount) 256 | { 257 | if ([sessionDataString characterAtIndex:j] == '\n') 258 | { 259 | [tempSessionList addObject:[dataHandler createSessionFromString:[sessionDataString substringWithRange:NSMakeRange(subLowRange, j - subLowRange + 1)]]]; 260 | subLowRange = j + 1; 261 | } 262 | j++; 263 | } 264 | [tempJob setObject:tempSessionList forKey:@"sessionList"]; 265 | 266 | return tempJob; 267 | } 268 | 269 | + (NSMutableDictionary *)createSessionFromString:(NSString *)sessionDataString 270 | { 271 | NSMutableDictionary *tempSession = [[[NSMutableDictionary alloc] init] autorelease]; 272 | NSNumber *sessionNumber = [NSNumber numberWithInt:0]; 273 | NSMutableString *sessionSummary = [[[NSMutableString alloc] init] autorelease]; 274 | NSMutableString *startDate = [[[NSMutableString alloc] init] autorelease]; 275 | NSMutableString *startTime = [[[NSMutableString alloc] init] autorelease]; 276 | NSMutableString *endDate = [[[NSMutableString alloc] init] autorelease]; 277 | NSMutableString *endTime = [[[NSMutableString alloc] init] autorelease]; 278 | NSMutableString *pauseString = [[[NSMutableString alloc] init] autorelease]; 279 | 280 | 281 | int i = 0; 282 | int count = [sessionDataString length]; 283 | int dataCount = 0; 284 | int lowRange = 0; 285 | while (i < count) 286 | { 287 | if ([sessionDataString characterAtIndex:i] == '\t') 288 | { 289 | if (dataCount == 0) sessionNumber = [NSNumber numberWithInt:[[sessionDataString substringToIndex:i] intValue]]; 290 | if (dataCount == 1) [startDate setString:[sessionDataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 291 | if (dataCount == 2) [startTime setString:[sessionDataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 292 | if (dataCount == 3) [endDate setString:[sessionDataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 293 | if (dataCount == 4) [endTime setString:[sessionDataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 294 | if (dataCount == 5) [pauseString setString:[sessionDataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 295 | if (dataCount == 6) [sessionSummary setString:[sessionDataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 296 | 297 | lowRange = i + 1; 298 | dataCount++; 299 | } 300 | 301 | i++; 302 | } 303 | 304 | cuDateTime *startDateTime = [[cuDateTime alloc] initWithStrings:startDate time:startTime]; 305 | cuDateTime *endDateTime = [[cuDateTime alloc] initWithStrings:endDate time:endTime]; 306 | cuDateTime *pauseTime = [[cuDateTime alloc] initWithTimeString:pauseString]; 307 | 308 | [tempSession setObject:[[cuDateTime alloc] init] forKey:@"tempPauseTime"]; 309 | [tempSession setObject:pauseTime forKey:@"pauseTime"]; 310 | [tempSession setObject:@"No" forKey:@"sessionActive"]; 311 | [tempSession setObject:sessionNumber forKey:@"sessionNumber"]; 312 | [tempSession setObject:sessionSummary forKey:@"sessionSummary"]; 313 | [tempSession setObject:startDateTime forKey:@"startDateTime"]; 314 | [tempSession setObject:endDateTime forKey:@"endDateTime"]; 315 | 316 | return tempSession; 317 | } 318 | 319 | + (NSMutableDictionary *)createJobFrom11String:(NSString *)dataString 320 | { 321 | NSMutableDictionary *tempJob = [[NSMutableDictionary alloc] init]; 322 | NSMutableString *jobName = [[NSMutableString alloc] init]; 323 | NSMutableString *clientName = [[NSMutableString alloc] init]; 324 | NSNumber *hourlyRate = [NSNumber numberWithDouble:0]; 325 | NSMutableArray *sessionList = [[NSMutableArray alloc] init]; 326 | 327 | int i = 0; 328 | int count = [dataString length]; 329 | int dataCount = 0; 330 | int lowRange = 0; 331 | while (i < count) 332 | { 333 | if ([dataString characterAtIndex:i] == ';') 334 | { 335 | if (dataCount == 1) [jobName setString:[dataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 336 | if (dataCount == 2) [clientName setString:[dataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 337 | if (dataCount == 3) hourlyRate = [NSNumber numberWithDouble:[[dataString substringWithRange:NSMakeRange(lowRange, i - lowRange)] doubleValue]]; 338 | 339 | dataCount++; 340 | lowRange = i + 1; 341 | } 342 | i++; 343 | } 344 | 345 | [tempJob setObject:jobName forKey:@"jobName"]; 346 | [tempJob setObject:clientName forKey:@"clientName"]; 347 | [tempJob setObject:hourlyRate forKey:@"hourlyRate"]; 348 | [tempJob setObject:@"No" forKey:@"jobActive"]; 349 | cuDateTime *tempTimeLogged = [[cuDateTime alloc] initWithTimeString:@"0:00:00"]; 350 | [tempJob setObject:tempTimeLogged forKey:@"jobTimeLogged"]; 351 | [tempJob setObject:[NSNumber numberWithDouble:0] forKey:@"jobCharges"]; 352 | 353 | [tempJob setObject:sessionList forKey:@"sessionList"]; 354 | 355 | return tempJob; 356 | } 357 | 358 | + (NSMutableArray *)createSessionListFrom11Data:(NSString *)dataPath 359 | { 360 | NSMutableArray *tempSessionList = [[NSMutableArray alloc] init]; 361 | 362 | NSString *sessionData = [NSString stringWithContentsOfFile:[dataPath stringByAppendingString:@".txt"]]; 363 | int i = 0; 364 | int count = [sessionData length]; 365 | int lowRange = 0; 366 | while (i < count) 367 | { 368 | if ([sessionData characterAtIndex:i] == '\n') 369 | { 370 | [tempSessionList addObject:[dataHandler createSessionFrom11String:[sessionData substringWithRange:NSMakeRange(lowRange, i - lowRange)]]]; 371 | lowRange = i + 1; 372 | } 373 | i++; 374 | } 375 | return tempSessionList; 376 | } 377 | 378 | + (NSMutableDictionary *)createSessionFrom11String:(NSString *)sessionDataString 379 | { 380 | NSMutableDictionary *tempSession = [[NSMutableDictionary alloc] init]; 381 | NSNumber *sessionNumber = [NSNumber numberWithInt:0]; 382 | NSMutableString *sessionSummary = [[NSMutableString alloc] init]; 383 | NSMutableString *startDate = [[NSMutableString alloc] init]; 384 | NSMutableString *startTime = [[NSMutableString alloc] init]; 385 | NSMutableString *endTime = [[NSMutableString alloc] init]; 386 | 387 | int i = 0; 388 | int count = [sessionDataString length]; 389 | int dataCount = 0; 390 | int lowRange = 0; 391 | while (i < count) 392 | { 393 | if ([sessionDataString characterAtIndex:i] == ';') 394 | { 395 | if (dataCount == 0) sessionNumber = [NSNumber numberWithInt:[[sessionDataString substringToIndex:i] intValue]]; 396 | if (dataCount == 1) [startDate setString:[sessionDataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 397 | if (dataCount == 2) [startTime setString:[sessionDataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 398 | if (dataCount == 3) [endTime setString:[sessionDataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 399 | if (dataCount == 4) [sessionSummary setString:[sessionDataString substringWithRange:NSMakeRange(lowRange, i - lowRange)]]; 400 | 401 | lowRange = i + 1; 402 | dataCount++; 403 | } 404 | 405 | i++; 406 | } 407 | 408 | cuDateTime *startDateTime = [[cuDateTime alloc] initWithStrings:startDate time:startTime]; 409 | cuDateTime *endDateTime = [[cuDateTime alloc] initWithStrings:startDate time:endTime]; 410 | 411 | if ([[[cuDateTime alloc] initWithStrings:startDate time:startTime] compare:[[cuDateTime alloc] initWithStrings:startDate time:endTime]] != NSOrderedDescending) 412 | [endDateTime addDays:1]; 413 | 414 | 415 | cuDateTime *pauseTime = [[cuDateTime alloc] init]; 416 | 417 | [tempSession setObject:[[cuDateTime alloc] init] forKey:@"tempPauseTime"]; 418 | [tempSession setObject:pauseTime forKey:@"pauseTime"]; 419 | [tempSession setObject:@"No" forKey:@"sessionActive"]; 420 | [tempSession setObject:sessionNumber forKey:@"sessionNumber"]; 421 | [tempSession setObject:sessionSummary forKey:@"sessionSummary"]; 422 | [tempSession setObject:startDateTime forKey:@"startDateTime"]; 423 | [tempSession setObject:endDateTime forKey:@"endDateTime"]; 424 | 425 | return tempSession; 426 | } 427 | @end -------------------------------------------------------------------------------- /CUPreferences.m: -------------------------------------------------------------------------------- 1 | // 2 | // CUPreferences.m 3 | // Khronos 4 | // 5 | // Created by Gautam Dey on 7/5/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "CUPreferences.h" 10 | 11 | NSString *const CUPreferencesResetNotification = @"CUPreferencesResetNotification"; 12 | // These are the General Preferences. 13 | NSString *const CUPreferencesAskDeleteProject = @"Delete Project"; 14 | NSString *const CUPreferencesAskDeleteSession = @"Delete Session" ; 15 | NSString *const CUPreferencesAutoSaveTime = @"Auto Save Time"; 16 | NSString *const CUPreferencesAutoDeleteSettings = @"Delete Settings"; 17 | NSString *const CUPreferencesMonetaryUnit = @"Monetary Unit"; 18 | NSString *const CUPreferencesClockSetting = @"24 Hour Clock"; 19 | NSString *const CUPreferencesUpdateTime = @"Update time"; 20 | NSString *const CUPreferencesFirstLaunch = @"First Launch"; 21 | NSString *const CUPreferencesTimeSettingsChangedNotification = @"CUTimeSettingsChangedNotification"; 22 | NSString *const CUPreferencesClockSettingNotification = @"CUClockChangedNotification"; 23 | NSString *const CUPreferencesUpdateTimeNotification = @"CUUpdateTimeNotification"; 24 | NSString *const CUPreferencesMonetaryUnitChangedNotification = @"CUPreferencesMonetaryUnitChangedNotification"; 25 | 26 | 27 | /*** General Table info ***/ 28 | NSString *const CUPreferencesTableNotification = @"CUPreferencesTableNotification"; 29 | NSString *const CUPreferencesTableUserInfoTableName = @"CUPreferencesTableUserInfoTableName"; 30 | NSString *const CUPreferencesTableUserInfoColumnName = @"CUPreferencesTableUserInfoColumnName"; 31 | /*** Which columns in the Project table should be shown. ***/ 32 | // CUPreferencesProjectDisplay is a dictonary to hold the options for the Project Table. 33 | NSString *const CUPreferencesProjectDisplay = @"Project Display"; 34 | NSString *const CUPreferencesProjectDisplayNumber = @"Number"; 35 | NSString *const CUPreferencesProjectDisplayName = @"Name"; 36 | NSString *const CUPreferencesProjectDisplayClient = @"Client"; 37 | NSString *const CUPreferencesProjectDisplayRate = @"Rate"; 38 | NSString *const CUPreferencesProjectDisplayTime = @"Time"; 39 | NSString *const CUPreferencesProjectDisplayCharges = @"Charges"; 40 | 41 | /*** Which columns in the Session Table should be shown. ***/ 42 | // CUPreferencesSessionDisplay is a dictonary to hold the options for the Session Table. 43 | NSString *const CUPreferencesSessionDisplay = @"Sessions Display"; 44 | NSString *const CUPreferencesSessionDisplayStartDate = @"Start Date"; 45 | NSString *const CUPreferencesSessionDisplayEndDate = @"End Date"; 46 | NSString *const CUPreferencesSessionDisplayStartTime = @"Start Time"; 47 | NSString *const CUPreferencesSessionDisplayEndTime = @"End Time"; 48 | NSString *const CUPreferencesSessionDisplayPauseTime = @"Pause Time"; 49 | NSString *const CUPreferencesSessionDisplayTotalTime = @"Total Time"; 50 | NSString *const CUPreferencesSessionDisplayCharges = @"Charges"; 51 | NSString *const CUPreferencesSessionDisplaySummary = @"Summary"; 52 | NSString *const CUPreferencesSessionDisplayNumber = @"Number"; 53 | 54 | /*** Options for the menu bar ***/ 55 | // CUPreferencesMenuDisplay dictonary to hold the options for the menu bar. 56 | NSString *const CUPreferencesMenuDisplay = @"Menubar Display"; 57 | NSString *const CUPreferencesMenuDisplayPauseButton = @"Pause Button"; 58 | NSString *const CUPreferencesMenuDisplayRecrodingButton = @"Recording Button"; 59 | NSString *const CUPreferencesMenuDisplayProjectList = @"Projects List"; 60 | NSString *const CUPreferencesMenuDisplayTotalTime = @"Total Time"; 61 | NSString *const CUPreferencesMenuDisplayCharges = @"Charges"; 62 | 63 | /*** Options for Invoice ***/ 64 | // CUPreferecncesInvoice is a dictonary to hold the options for creating the Invoice. 65 | NSString *const CUPreferencesInvoice = @"Invoice"; 66 | NSString *const CUPreferencesInvoiceIndexTitle = @"Index Title"; 67 | NSString *const CUPreferencesInvoiceIndexHeading = @"Index Heading"; 68 | NSString *const CUPreferencesInvoiceLinkHelp = @"Link Help"; 69 | NSString *const CUPreferencesInvoiceTitle = @"Title"; 70 | NSString *const CUPreferencesInvoiceHeading = @"Heading"; 71 | NSString *const CUPreferencesInvoiceBodyFont = @"Body Font"; 72 | NSString *const CUPreferencesInvoiceHeadingFont = @"Headings Font"; 73 | NSString *const CUPreferencesInvoiceIndexTitleChangedNotification = @"CUPreferencesInvoiceIndexTitleChangedNotification"; 74 | NSString *const CUPreferencesInvoiceIndexHeadingChangedNotification = @"CUPreferencesInvoiceIndexHeadingChangedNotification"; 75 | NSString *const CUPreferencesInvoiceLinkHelpChangedNotification = @"CUPreferencesInvoiceLinkHelpChangedNotification"; 76 | NSString *const CUPreferencesInvoiceTitleChangedNotification = @"CUPreferencesInvoiceTitleChangedNotification"; 77 | NSString *const CUPreferencesInvoiceHeadingChangedNotification = @"CUPreferencesInvoiceHeadingChangedNotification"; 78 | NSString *const CUPreferencesInvoiceHeadingFontChangedNotification = @"CUPreferencesInvoiceHeadingFontChangedNotification"; 79 | NSString *const CUPreferencesInvoiceBodyFontChangedNotification = @"CUPreferencesInvoiceBodyFontChangedNotification"; 80 | 81 | @implementation CUPreferences 82 | 83 | 84 | + (void) resetPreferences 85 | { 86 | NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; 87 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 88 | NSLog(@"Deleting Preferences."); 89 | [defaults removeObjectForKey:CUPreferencesAskDeleteProject]; 90 | [defaults removeObjectForKey:CUPreferencesAskDeleteSession]; 91 | [defaults removeObjectForKey:CUPreferencesAutoSaveTime]; 92 | [defaults removeObjectForKey:CUPreferencesMonetaryUnit]; 93 | [defaults removeObjectForKey:CUPreferencesClockSetting]; 94 | [defaults removeObjectForKey:CUPreferencesUpdateTime]; 95 | [defaults removeObjectForKey:CUPreferencesInvoice]; 96 | [defaults removeObjectForKey:CUPreferencesProjectDisplay]; 97 | [defaults removeObjectForKey:CUPreferencesSessionDisplay]; 98 | [defaults removeObjectForKey:CUPreferencesMenuDisplay]; 99 | NSLog(@"Sending out notifications."); 100 | NSLog(@"Sending notification %@",CUPreferencesClockSettingNotification); 101 | [nc postNotificationName:CUPreferencesResetNotification object:self]; 102 | 103 | } 104 | 105 | + (void) initializeDefaults 106 | { 107 | #pragma mark Setting Default Values. 108 | // Create a Dictionary 109 | NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary]; 110 | 111 | // Register the default values for Clock, which is 24 hour clock. 112 | [defaultValues setObject:[NSNumber numberWithBool:YES] forKey:CUPreferencesClockSetting]; 113 | // Register the default value for Update time, which is 0 minutes 114 | [defaultValues setObject:[NSNumber numberWithInt:0] forKey:CUPreferencesUpdateTime]; 115 | // Register the default value for Montery Unit. 116 | [defaultValues setObject:@"$" forKey:CUPreferencesMonetaryUnit]; 117 | 118 | 119 | NSLog(@"Registering Project Table Defaults."); 120 | // Register the default value for the Poject Table. 121 | NSArray *keys = [NSArray arrayWithObjects: 122 | CUPreferencesProjectDisplayNumber, 123 | CUPreferencesProjectDisplayName, 124 | CUPreferencesProjectDisplayClient, 125 | CUPreferencesProjectDisplayRate, 126 | CUPreferencesProjectDisplayTime, 127 | CUPreferencesProjectDisplayCharges, 128 | nil]; 129 | NSArray *values = [NSArray arrayWithObjects: 130 | [NSNumber numberWithBool: YES], // Number 131 | [NSNumber numberWithBool: YES], // Name 132 | [NSNumber numberWithBool: YES], // Client Name 133 | [NSNumber numberWithBool: NO] , // Rate 134 | [NSNumber numberWithBool: YES], // Time 135 | [NSNumber numberWithBool: YES], // Charges 136 | nil]; 137 | 138 | NSDictionary *projectTableValues = [NSDictionary dictionaryWithObjects:values 139 | forKeys:keys]; 140 | [defaultValues setObject:projectTableValues forKey:CUPreferencesProjectDisplay]; 141 | 142 | NSLog(@"Registering Session Table Defaults."); 143 | // Register the default value for the Poject Table. 144 | keys = [NSArray arrayWithObjects: 145 | CUPreferencesSessionDisplayStartDate, 146 | CUPreferencesSessionDisplayEndDate, 147 | CUPreferencesSessionDisplayStartTime, 148 | CUPreferencesSessionDisplayEndTime, 149 | CUPreferencesSessionDisplayPauseTime, 150 | CUPreferencesSessionDisplayTotalTime, 151 | CUPreferencesSessionDisplayCharges, 152 | CUPreferencesSessionDisplaySummary, 153 | CUPreferencesSessionDisplayNumber, 154 | nil]; 155 | values = [NSArray arrayWithObjects: 156 | [NSNumber numberWithBool: YES], // Start Date 157 | [NSNumber numberWithBool: YES], // End Date 158 | [NSNumber numberWithBool: YES], // Start Time 159 | [NSNumber numberWithBool: YES], // End Time 160 | [NSNumber numberWithBool: NO ], // Pause Time 161 | [NSNumber numberWithBool: YES], // Total Time 162 | [NSNumber numberWithBool: YES], // Charges 163 | [NSNumber numberWithBool: YES], // Summary 164 | [NSNumber numberWithBool: YES], // Number 165 | nil]; 166 | NSDictionary *sessionTableValues = [NSDictionary dictionaryWithObjects:values 167 | forKeys:keys]; 168 | [defaultValues setObject:sessionTableValues forKey:CUPreferencesSessionDisplay]; 169 | 170 | 171 | NSLog(@"Registering Invoice Defaults"); 172 | NSData *headingFontAsData = [NSKeyedArchiver archivedDataWithRootObject:[NSFont fontWithName:@"Helvetica" size:18]]; 173 | NSData *bodyFontAsData = [NSKeyedArchiver archivedDataWithRootObject:[NSFont fontWithName:@"Helvetica" size:10]]; 174 | keys = [NSArray arrayWithObjects: 175 | CUPreferencesInvoiceIndexTitle, 176 | CUPreferencesInvoiceIndexHeading, 177 | CUPreferencesInvoiceTitle, 178 | CUPreferencesInvoiceLinkHelp, 179 | CUPreferencesInvoiceHeading, 180 | CUPreferencesInvoiceHeadingFont, 181 | CUPreferencesInvoiceBodyFont, 182 | nil]; 183 | values = [NSArray arrayWithObjects: 184 | @"Khronos Invoice List", // Index Title 185 | @"Invoices", // Index Heading 186 | @"Khronos Invoice", // Title 187 | @"Click the job to view the invoice.", // Link Help 188 | @"Invoice", // Heading 189 | headingFontAsData, // Heading Font 190 | bodyFontAsData, // Body Font 191 | nil]; 192 | NSDictionary *invoiceValues = [NSDictionary dictionaryWithObjects:values 193 | forKeys:keys]; 194 | [defaultValues setObject:invoiceValues forKey:CUPreferencesInvoice]; 195 | 196 | NSLog(@"Registering Menu Table Defaults."); 197 | // Register the default value for the Poject Table. 198 | keys = [NSArray arrayWithObjects: 199 | CUPreferencesMenuDisplayPauseButton, 200 | CUPreferencesMenuDisplayRecrodingButton, 201 | CUPreferencesMenuDisplayProjectList, 202 | CUPreferencesMenuDisplayTotalTime, 203 | CUPreferencesMenuDisplayCharges, 204 | nil]; 205 | values = [NSArray arrayWithObjects: 206 | [NSNumber numberWithBool: YES], // Pause Button 207 | [NSNumber numberWithBool: YES], // Recording Button 208 | [NSNumber numberWithBool: YES], // Project List 209 | [NSNumber numberWithBool: YES], // Total Time 210 | [NSNumber numberWithBool: YES], // Charges 211 | nil]; 212 | NSDictionary *menuTableValues = [NSDictionary dictionaryWithObjects:values 213 | forKeys:keys]; 214 | [defaultValues setObject:menuTableValues forKey:CUPreferencesMenuDisplay]; 215 | // Register the dictionary of defaults. 216 | [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues]; 217 | 218 | NSLog(@"Registered defaults: %@", defaultValues ); 219 | } 220 | 221 | #pragma mark Table Options 222 | // These are the setting for Project Table, Session Table and Menu. 223 | - (NSDictionary *)columnsForTable:(NSString *)tableName 224 | { 225 | return [[NSUserDefaults standardUserDefaults] dictionaryForKey:tableName]; 226 | } 227 | - (void) setTable:(NSString *)tableName column:(NSString *)column display:(BOOL)yn 228 | { 229 | NSNotificationCenter *nc; 230 | nc = [NSNotificationCenter defaultCenter]; 231 | NSMutableDictionary *newTable = [[self columnsForTable:tableName] mutableCopy]; 232 | [newTable setObject:[NSNumber numberWithBool:yn] forKey:column]; 233 | NSLog(@"Setting table '%@' to value %@",tableName, newTable); 234 | [[NSUserDefaults standardUserDefaults] setObject:newTable forKey:tableName]; 235 | [nc postNotificationName:CUPreferencesTableNotification 236 | object:self 237 | userInfo:[NSDictionary 238 | dictionaryWithObjects: [NSArray arrayWithObjects: tableName, column, nil] 239 | forKeys: [NSArray arrayWithObjects: CUPreferencesTableUserInfoTableName, CUPreferencesTableUserInfoColumnName, nil]]]; 240 | } 241 | - (BOOL) displayForTable:(NSString *)tableName column:(NSString *)column 242 | { 243 | return [[[self columnsForTable:tableName] objectForKey:column] boolValue]; 244 | } 245 | 246 | #pragma mark General Options 247 | 248 | - (BOOL) askDeleteProject 249 | { 250 | return [[NSUserDefaults standardUserDefaults] boolForKey:CUPreferencesAskDeleteProject]; 251 | } 252 | 253 | - (void) setAskDeleteProject:(BOOL)yn 254 | { 255 | [[NSUserDefaults standardUserDefaults] setBool:yn forKey:CUPreferencesAskDeleteProject]; 256 | } 257 | 258 | - (BOOL) askDeleteSession 259 | { 260 | return [[NSUserDefaults standardUserDefaults] boolForKey:CUPreferencesAskDeleteSession]; 261 | } 262 | 263 | - (void) setAskDeleteSession:(BOOL)yn 264 | { 265 | 266 | [[NSUserDefaults standardUserDefaults] setBool:yn forKey:CUPreferencesAskDeleteSession]; 267 | } 268 | 269 | - (BOOL) autoSaveTime 270 | { 271 | return [[NSUserDefaults standardUserDefaults] boolForKey:CUPreferencesAutoSaveTime]; 272 | } 273 | 274 | - (void) setAutoSaveTime:(BOOL)yn 275 | { 276 | [[NSUserDefaults standardUserDefaults] setBool:yn forKey:CUPreferencesAutoSaveTime]; 277 | } 278 | 279 | - (BOOL) autoDeleteSettings 280 | { 281 | return [[NSUserDefaults standardUserDefaults] boolForKey:CUPreferencesAutoDeleteSettings]; 282 | } 283 | - (void) setAutoDeleteSettings:(BOOL)yn 284 | { 285 | [[NSUserDefaults standardUserDefaults] setBool:yn forKey:CUPreferencesAutoDeleteSettings]; 286 | } 287 | - (BOOL) is24HourClock 288 | { 289 | return [[NSUserDefaults standardUserDefaults] boolForKey:CUPreferencesClockSetting]; 290 | } 291 | - (void) setIs24HourClock:(BOOL)yn 292 | { 293 | [[NSUserDefaults standardUserDefaults] setBool:yn forKey:CUPreferencesClockSetting]; 294 | 295 | // Notification 296 | NSNotificationCenter *nc; 297 | nc = [NSNotificationCenter defaultCenter]; 298 | NSLog(@"Sending notification %@",CUPreferencesClockSettingNotification); 299 | [nc postNotificationName:CUPreferencesClockSettingNotification object:self]; 300 | [nc postNotificationName:CUPreferencesTimeSettingsChangedNotification object:self]; 301 | 302 | } 303 | - (int) updateTimeEvery 304 | { 305 | return [[[NSUserDefaults standardUserDefaults] objectForKey:CUPreferencesUpdateTime] intValue]; 306 | } 307 | - (void) setUpdateTimeEvery:(int)minutes 308 | { 309 | [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInt:minutes] forKey:CUPreferencesUpdateTime]; 310 | NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; 311 | NSLog(@"Sending notification %@",CUPreferencesUpdateTimeNotification); 312 | [nc postNotificationName:CUPreferencesUpdateTimeNotification object:self]; 313 | [nc postNotificationName:CUPreferencesTimeSettingsChangedNotification object:self]; 314 | } 315 | - (NSString *)monetaryUnit 316 | { 317 | return [[NSUserDefaults standardUserDefaults] stringForKey:CUPreferencesMonetaryUnit]; 318 | } 319 | - (void) setMonetaryUnit:(NSString *)unit 320 | { 321 | [[NSUserDefaults standardUserDefaults] setObject:unit forKey:CUPreferencesMonetaryUnit]; 322 | [[NSNotificationCenter defaultCenter] postNotificationName:CUPreferencesMonetaryUnitChangedNotification object:self]; 323 | } 324 | 325 | - (BOOL) firstLaunch 326 | { 327 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; 328 | BOOL state = [defaults boolForKey:CUPreferencesFirstLaunch]; 329 | if(state) 330 | [defaults setBool:NO forKey:CUPreferencesFirstLaunch]; 331 | return state; 332 | } 333 | #pragma mark Invoce Options 334 | - (NSDictionary *)invoiceTable 335 | { 336 | return [[NSUserDefaults standardUserDefaults] dictionaryForKey:CUPreferencesInvoice]; 337 | } 338 | 339 | - (id)invoiceValuesForColumn:(NSString *)column 340 | { 341 | return [[self invoiceTable] objectForKey:column]; 342 | } 343 | 344 | - (void)setInvoiceValueForColumn:(NSString *)column value:(id)value 345 | { 346 | 347 | NSMutableDictionary *table = [[self invoiceTable] mutableCopy]; 348 | [table setObject:value forKey:column]; 349 | [[NSUserDefaults standardUserDefaults] setObject:table forKey:CUPreferencesInvoice]; 350 | } 351 | 352 | - (NSString *)invoiceIndexTitle 353 | { 354 | return [self invoiceValuesForColumn:CUPreferencesInvoiceIndexTitle]; 355 | } 356 | 357 | - (void) setInvoiceIndexTitle:(NSString *)title 358 | { 359 | [self setInvoiceValueForColumn:CUPreferencesInvoiceIndexTitle value:title]; 360 | [[NSNotificationCenter defaultCenter] postNotificationName:CUPreferencesInvoiceIndexTitleChangedNotification object:self]; 361 | } 362 | 363 | - (NSString *)invoiceIndexHeading 364 | { 365 | return [self invoiceValuesForColumn:CUPreferencesInvoiceIndexHeading]; 366 | } 367 | - (void) setInvoiceIndexHeading:(NSString *)heading 368 | { 369 | [self setInvoiceValueForColumn:CUPreferencesInvoiceIndexHeading value:heading]; 370 | [[NSNotificationCenter defaultCenter] postNotificationName:CUPreferencesInvoiceIndexHeadingChangedNotification object:self]; 371 | } 372 | - (NSString *)invoiceLinkHelp 373 | { 374 | return [self invoiceValuesForColumn:CUPreferencesInvoiceLinkHelp]; 375 | } 376 | - (void) setInvoiceLinkHelp:(NSString *)linkHelp 377 | { 378 | [self setInvoiceValueForColumn:CUPreferencesInvoiceLinkHelp value:linkHelp]; 379 | [[NSNotificationCenter defaultCenter] postNotificationName:CUPreferencesInvoiceLinkHelpChangedNotification object:self]; 380 | } 381 | - (NSString *)invoiceTitle 382 | { 383 | return [self invoiceValuesForColumn:CUPreferencesInvoiceTitle]; 384 | } 385 | - (void) setInvoiceTitle:(NSString *)title 386 | { 387 | [self setInvoiceValueForColumn:CUPreferencesInvoiceTitle value:title]; 388 | [[NSNotificationCenter defaultCenter] postNotificationName:CUPreferencesInvoiceTitleChangedNotification object:self]; 389 | } 390 | - (NSString *)invoiceHeading 391 | { 392 | return [self invoiceValuesForColumn:CUPreferencesInvoiceHeading]; 393 | } 394 | - (void)setInvoiceHeading:(NSString *)heading 395 | { 396 | [self setInvoiceValueForColumn:CUPreferencesInvoiceHeading value:heading]; 397 | [[NSNotificationCenter defaultCenter] postNotificationName:CUPreferencesInvoiceHeadingChangedNotification object:self]; 398 | } 399 | - (NSFont *)invoiceHeadingFont 400 | { 401 | NSData *fontAsData = [self invoiceValuesForColumn:CUPreferencesInvoiceHeadingFont]; 402 | return [NSKeyedUnarchiver unarchiveObjectWithData:fontAsData]; 403 | } 404 | - (void)setInvoiceHeadingFont:(NSFont *)aFont 405 | { 406 | NSData *fontAsData = [NSKeyedArchiver archivedDataWithRootObject:aFont]; 407 | [self setInvoiceValueForColumn:CUPreferencesInvoiceHeadingFont value:fontAsData]; 408 | [[NSNotificationCenter defaultCenter] postNotificationName:CUPreferencesInvoiceHeadingFontChangedNotification object:self]; 409 | } 410 | - (NSFont *)invoiceBodyFont 411 | { 412 | NSData *fontAsData = [self invoiceValuesForColumn:CUPreferencesInvoiceBodyFont]; 413 | return [NSKeyedUnarchiver unarchiveObjectWithData:fontAsData]; 414 | } 415 | - (void)setInvoiceBodyFont:(NSFont *)aFont 416 | { 417 | NSData *fontAsData = [NSKeyedArchiver archivedDataWithRootObject:aFont]; 418 | [self setInvoiceValueForColumn:CUPreferencesInvoiceBodyFont value:fontAsData]; 419 | [[NSNotificationCenter defaultCenter] postNotificationName:CUPreferencesInvoiceBodyFontChangedNotification object:self]; 420 | } 421 | 422 | @end 423 | -------------------------------------------------------------------------------- /Khronos.xcodeproj/gdey.pbxuser: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 4 | activeBuildConfigurationName = Development; 5 | activeExecutable = 7AF508300E169D9B0090CFC7 /* Khronos */; 6 | activeTarget = 8D1107260486CEB800E47090 /* Khronos */; 7 | addToTargets = ( 8 | 8D1107260486CEB800E47090 /* Khronos */, 9 | ); 10 | breakpoints = ( 11 | 7AF509470E1CC5650090CFC7 /* CUPreferenceController.m:264 */, 12 | 7AF509550E1CC61E0090CFC7 /* CUPreferenceController.m:264 */, 13 | ); 14 | codeSenseManager = 7AF508360E169DBA0090CFC7 /* Code sense */; 15 | executables = ( 16 | 7AF508300E169D9B0090CFC7 /* Khronos */, 17 | ); 18 | perUserDictionary = { 19 | PBXConfiguration.PBXFileTableDataSource3.PBXErrorsWarningsDataSource = { 20 | PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; 21 | PBXFileTableDataSourceColumnSortingKey = PBXErrorsWarningsDataSource_LocationID; 22 | PBXFileTableDataSourceColumnWidthsKey = ( 23 | 20, 24 | 300, 25 | 231, 26 | ); 27 | PBXFileTableDataSourceColumnsKey = ( 28 | PBXErrorsWarningsDataSource_TypeID, 29 | PBXErrorsWarningsDataSource_MessageID, 30 | PBXErrorsWarningsDataSource_LocationID, 31 | ); 32 | }; 33 | PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { 34 | PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; 35 | PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; 36 | PBXFileTableDataSourceColumnWidthsKey = ( 37 | 20, 38 | 352, 39 | 20, 40 | 48, 41 | 43, 42 | 43, 43 | 20, 44 | ); 45 | PBXFileTableDataSourceColumnsKey = ( 46 | PBXFileDataSource_FiletypeID, 47 | PBXFileDataSource_Filename_ColumnID, 48 | PBXFileDataSource_Built_ColumnID, 49 | PBXFileDataSource_ObjectSize_ColumnID, 50 | PBXFileDataSource_Errors_ColumnID, 51 | PBXFileDataSource_Warnings_ColumnID, 52 | PBXFileDataSource_Target_ColumnID, 53 | ); 54 | }; 55 | PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { 56 | PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; 57 | PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; 58 | PBXFileTableDataSourceColumnWidthsKey = ( 59 | 20, 60 | 1433, 61 | 60, 62 | 20, 63 | 48.16259765625, 64 | 43, 65 | 43, 66 | ); 67 | PBXFileTableDataSourceColumnsKey = ( 68 | PBXFileDataSource_FiletypeID, 69 | PBXFileDataSource_Filename_ColumnID, 70 | PBXTargetDataSource_PrimaryAttribute, 71 | PBXFileDataSource_Built_ColumnID, 72 | PBXFileDataSource_ObjectSize_ColumnID, 73 | PBXFileDataSource_Errors_ColumnID, 74 | PBXFileDataSource_Warnings_ColumnID, 75 | ); 76 | }; 77 | PBXPerProjectTemplateStateSaveDate = 237224240; 78 | PBXWorkspaceStateSaveDate = 237224240; 79 | }; 80 | perUserProjectItems = { 81 | 7ABCCCA80E233D6200F022D3 /* PBXTextBookmark */ = 7ABCCCA80E233D6200F022D3 /* PBXTextBookmark */; 82 | 7ACFD97C0E1EFBE30022C5BD /* PBXTextBookmark */ = 7ACFD97C0E1EFBE30022C5BD /* PBXTextBookmark */; 83 | 7ACFD97D0E1EFBE30022C5BD /* PBXTextBookmark */ = 7ACFD97D0E1EFBE30022C5BD /* PBXTextBookmark */; 84 | 7ACFD9850E1EFBE30022C5BD /* PBXTextBookmark */ = 7ACFD9850E1EFBE30022C5BD /* PBXTextBookmark */; 85 | 7ACFD99B0E1EFFB70022C5BD /* PBXTextBookmark */ = 7ACFD99B0E1EFFB70022C5BD /* PBXTextBookmark */; 86 | 7ACFD99C0E1EFFB70022C5BD /* PBXTextBookmark */ = 7ACFD99C0E1EFFB70022C5BD /* PBXTextBookmark */; 87 | 7ACFDAC50E21EAF30022C5BD /* PBXTextBookmark */ = 7ACFDAC50E21EAF30022C5BD /* PBXTextBookmark */; 88 | 7ACFDAE20E21EC2E0022C5BD /* PBXTextBookmark */ = 7ACFDAE20E21EC2E0022C5BD /* PBXTextBookmark */; 89 | 7ACFDAE30E21EC2E0022C5BD /* PBXTextBookmark */ = 7ACFDAE30E21EC2E0022C5BD /* PBXTextBookmark */; 90 | 7ACFDAE40E21EC2E0022C5BD /* PBXTextBookmark */ = 7ACFDAE40E21EC2E0022C5BD /* PBXTextBookmark */; 91 | 7ACFDAE60E21EC2E0022C5BD /* PBXTextBookmark */ = 7ACFDAE60E21EC2E0022C5BD /* PBXTextBookmark */; 92 | 7ACFDAE70E21EC2E0022C5BD /* PBXTextBookmark */ = 7ACFDAE70E21EC2E0022C5BD /* PBXTextBookmark */; 93 | 7ACFDAE80E21EC2E0022C5BD /* PBXTextBookmark */ = 7ACFDAE80E21EC2E0022C5BD /* PBXTextBookmark */; 94 | 7ACFDAF20E21EC2E0022C5BD /* PBXTextBookmark */ = 7ACFDAF20E21EC2E0022C5BD /* PBXTextBookmark */; 95 | 7ACFDB340E226F450022C5BD /* PBXTextBookmark */ = 7ACFDB340E226F450022C5BD /* PBXTextBookmark */; 96 | 7ACFDB350E226F450022C5BD /* PBXTextBookmark */ = 7ACFDB350E226F450022C5BD /* PBXTextBookmark */; 97 | 7ACFDB420E226F450022C5BD /* PBXTextBookmark */ = 7ACFDB420E226F450022C5BD /* PBXTextBookmark */; 98 | 7ACFDB440E226F450022C5BD /* PBXTextBookmark */ = 7ACFDB440E226F450022C5BD /* PBXTextBookmark */; 99 | 7AE107780E23B8EC0029FDBC /* PBXTextBookmark */ = 7AE107780E23B8EC0029FDBC /* PBXTextBookmark */; 100 | 7AE1077A0E23B8EC0029FDBC /* PBXTextBookmark */ = 7AE1077A0E23B8EC0029FDBC /* PBXTextBookmark */; 101 | 7AE1077B0E23B8EC0029FDBC /* PBXTextBookmark */ = 7AE1077B0E23B8EC0029FDBC /* PBXTextBookmark */; 102 | 7AE2E1CF0E23C38D000233CD /* PBXTextBookmark */ = 7AE2E1CF0E23C38D000233CD /* PBXTextBookmark */; 103 | 7AE2E1D00E23C38D000233CD /* PBXTextBookmark */ = 7AE2E1D00E23C38D000233CD /* PBXTextBookmark */; 104 | 7AE2E1D30E23C38D000233CD /* PBXTextBookmark */ = 7AE2E1D30E23C38D000233CD /* PBXTextBookmark */; 105 | 7AE2E1D40E23C38D000233CD /* PBXTextBookmark */ = 7AE2E1D40E23C38D000233CD /* PBXTextBookmark */; 106 | 7AE2E1D50E23C38D000233CD /* PBXTextBookmark */ = 7AE2E1D50E23C38D000233CD /* PBXTextBookmark */; 107 | 7AF508400E1819560090CFC7 /* PBXTextBookmark */ = 7AF508400E1819560090CFC7 /* PBXTextBookmark */; 108 | 7AF508410E1819560090CFC7 /* PBXTextBookmark */ = 7AF508410E1819560090CFC7 /* PBXTextBookmark */; 109 | 7AF508440E1819560090CFC7 /* PBXTextBookmark */ = 7AF508440E1819560090CFC7 /* PBXTextBookmark */; 110 | 7AF508450E1819560090CFC7 /* PBXTextBookmark */ = 7AF508450E1819560090CFC7 /* PBXTextBookmark */; 111 | 7AF508460E1819560090CFC7 /* PBXTextBookmark */ = 7AF508460E1819560090CFC7 /* PBXTextBookmark */; 112 | 7AF508480E1819560090CFC7 /* PBXTextBookmark */ = 7AF508480E1819560090CFC7 /* PBXTextBookmark */; 113 | 7AF5086D0E1820BE0090CFC7 /* PBXTextBookmark */ = 7AF5086D0E1820BE0090CFC7 /* PBXTextBookmark */; 114 | 7AF5086E0E1820BE0090CFC7 /* PBXTextBookmark */ = 7AF5086E0E1820BE0090CFC7 /* PBXTextBookmark */; 115 | 7AF508700E1820BE0090CFC7 /* PBXTextBookmark */ = 7AF508700E1820BE0090CFC7 /* PBXTextBookmark */; 116 | }; 117 | sourceControlManager = 7AF508350E169DBA0090CFC7 /* Source Control */; 118 | userBuildSettings = { 119 | }; 120 | }; 121 | 29B97316FDCFA39411CA2CEA /* main.m */ = { 122 | uiCtxt = { 123 | sepNavIntBoundsRect = "{{0, 0}, {582, 1017}}"; 124 | sepNavSelRange = "{110, 0}"; 125 | sepNavVisRange = "{0, 119}"; 126 | sepNavWindowFrame = "{{943, 9}, {641, 1145}}"; 127 | }; 128 | }; 129 | 7ABCCCA80E233D6200F022D3 /* PBXTextBookmark */ = { 130 | isa = PBXTextBookmark; 131 | fRef = 8BC21A8705D881FF001C2B42 /* Controller.h */; 132 | name = "Controller.h: 191"; 133 | rLen = 0; 134 | rLoc = 3770; 135 | rType = 0; 136 | vrLen = 200; 137 | vrLoc = 5022; 138 | }; 139 | 7ACFD97C0E1EFBE30022C5BD /* PBXTextBookmark */ = { 140 | isa = PBXTextBookmark; 141 | fRef = 8BEBC03205DAA11100534DBC /* tableGenerator.h */; 142 | name = "tableGenerator.h: 1"; 143 | rLen = 0; 144 | rLoc = 0; 145 | rType = 0; 146 | vrLen = 1240; 147 | vrLoc = 0; 148 | }; 149 | 7ACFD97D0E1EFBE30022C5BD /* PBXTextBookmark */ = { 150 | isa = PBXTextBookmark; 151 | fRef = 8BEBC03305DAA11100534DBC /* tableGenerator.m */; 152 | name = "tableGenerator.m: 1"; 153 | rLen = 0; 154 | rLoc = 0; 155 | rType = 0; 156 | vrLen = 1844; 157 | vrLoc = 0; 158 | }; 159 | 7ACFD9850E1EFBE30022C5BD /* PBXTextBookmark */ = { 160 | isa = PBXTextBookmark; 161 | fRef = 8BEBC03305DAA11100534DBC /* tableGenerator.m */; 162 | name = "tableGenerator.m: 1"; 163 | rLen = 0; 164 | rLoc = 0; 165 | rType = 0; 166 | vrLen = 1844; 167 | vrLoc = 0; 168 | }; 169 | 7ACFD9910E1EFF5D0022C5BD /* CUFontFormatter.h */ = { 170 | uiCtxt = { 171 | sepNavIntBoundsRect = "{{0, 0}, {530, 238}}"; 172 | sepNavSelRange = "{0, 0}"; 173 | sepNavVisRange = "{0, 164}"; 174 | sepNavWindowFrame = "{{15, 28}, {1046, 1145}}"; 175 | }; 176 | }; 177 | 7ACFD9920E1EFF5D0022C5BD /* CUFontFormatter.m */ = { 178 | uiCtxt = { 179 | sepNavIntBoundsRect = "{{0, 0}, {530, 350}}"; 180 | sepNavSelRange = "{427, 0}"; 181 | sepNavVisRange = "{248, 186}"; 182 | sepNavWindowFrame = "{{15, 28}, {1046, 1145}}"; 183 | }; 184 | }; 185 | 7ACFD99B0E1EFFB70022C5BD /* PBXTextBookmark */ = { 186 | isa = PBXTextBookmark; 187 | fRef = 7ACFD9910E1EFF5D0022C5BD /* CUFontFormatter.h */; 188 | name = "CUFontFormatter.h: 1"; 189 | rLen = 0; 190 | rLoc = 0; 191 | rType = 0; 192 | vrLen = 164; 193 | vrLoc = 0; 194 | }; 195 | 7ACFD99C0E1EFFB70022C5BD /* PBXTextBookmark */ = { 196 | isa = PBXTextBookmark; 197 | fRef = 7ACFD9920E1EFF5D0022C5BD /* CUFontFormatter.m */; 198 | name = "CUFontFormatter.m: 1"; 199 | rLen = 0; 200 | rLoc = 0; 201 | rType = 0; 202 | vrLen = 168; 203 | vrLoc = 0; 204 | }; 205 | 7ACFDA8D0E1FD2F20022C5BD /* CUPreferences.h */ = { 206 | uiCtxt = { 207 | sepNavIntBoundsRect = "{{0, 0}, {510, 1764}}"; 208 | sepNavSelRange = "{4189, 0}"; 209 | sepNavVisRange = "{2255, 2555}"; 210 | sepNavWindowFrame = "{{311, 181}, {552, 997}}"; 211 | }; 212 | }; 213 | 7ACFDA8E0E1FD2F20022C5BD /* CUPreferences.m */ = { 214 | uiCtxt = { 215 | sepNavIntBoundsRect = "{{0, 0}, {1285, 5712}}"; 216 | sepNavSelRange = "{429, 0}"; 217 | sepNavVisRange = "{0, 4395}"; 218 | sepNavWindowFrame = "{{14, 33}, {1344, 1145}}"; 219 | }; 220 | }; 221 | 7ACFDAC50E21EAF30022C5BD /* PBXTextBookmark */ = { 222 | isa = PBXTextBookmark; 223 | fRef = 7ACFDA8D0E1FD2F20022C5BD /* CUPreferences.h */; 224 | name = "CUPreferences.h: 84"; 225 | rLen = 0; 226 | rLoc = 4453; 227 | rType = 0; 228 | vrLen = 1138; 229 | vrLoc = 3084; 230 | }; 231 | 7ACFDAE20E21EC2E0022C5BD /* PBXTextBookmark */ = { 232 | isa = PBXTextBookmark; 233 | fRef = 7ACFDA8E0E1FD2F20022C5BD /* CUPreferences.m */; 234 | name = "CUPreferences.m: 64"; 235 | rLen = 0; 236 | rLoc = 5160; 237 | rType = 0; 238 | vrLen = 300; 239 | vrLoc = 3141; 240 | }; 241 | 7ACFDAE30E21EC2E0022C5BD /* PBXTextBookmark */ = { 242 | isa = PBXTextBookmark; 243 | fRef = 7AF508620E181A270090CFC7 /* CUPreferenceController.m */; 244 | name = "CUPreferenceController.m: 245"; 245 | rLen = 0; 246 | rLoc = 8033; 247 | rType = 0; 248 | vrLen = 214; 249 | vrLoc = 8037; 250 | }; 251 | 7ACFDAE40E21EC2E0022C5BD /* PBXTextBookmark */ = { 252 | isa = PBXTextBookmark; 253 | fRef = 7AF508610E181A270090CFC7 /* CUPreferenceController.h */; 254 | name = "CUPreferenceController.h: 87"; 255 | rLen = 0; 256 | rLoc = 2584; 257 | rType = 0; 258 | vrLen = 247; 259 | vrLoc = 1548; 260 | }; 261 | 7ACFDAE60E21EC2E0022C5BD /* PBXTextBookmark */ = { 262 | isa = PBXTextBookmark; 263 | fRef = 7ACFD9910E1EFF5D0022C5BD /* CUFontFormatter.h */; 264 | name = "CUFontFormatter.h: 1"; 265 | rLen = 0; 266 | rLoc = 0; 267 | rType = 0; 268 | vrLen = 164; 269 | vrLoc = 0; 270 | }; 271 | 7ACFDAE70E21EC2E0022C5BD /* PBXTextBookmark */ = { 272 | isa = PBXTextBookmark; 273 | fRef = 8B8C911805DAFB7200B25096 /* cuDateTime.h */; 274 | name = "cuDateTime.h: 1"; 275 | rLen = 0; 276 | rLoc = 0; 277 | rType = 0; 278 | vrLen = 121; 279 | vrLoc = 0; 280 | }; 281 | 7ACFDAE80E21EC2E0022C5BD /* PBXTextBookmark */ = { 282 | isa = PBXTextBookmark; 283 | fRef = 7ACFDA8E0E1FD2F20022C5BD /* CUPreferences.m */; 284 | name = "CUPreferences.m: 64"; 285 | rLen = 0; 286 | rLoc = 5160; 287 | rType = 0; 288 | vrLen = 300; 289 | vrLoc = 3141; 290 | }; 291 | 7ACFDAF20E21EC2E0022C5BD /* PBXTextBookmark */ = { 292 | isa = PBXTextBookmark; 293 | fRef = 8B8C911805DAFB7200B25096 /* cuDateTime.h */; 294 | name = "cuDateTime.h: 1"; 295 | rLen = 0; 296 | rLoc = 0; 297 | rType = 0; 298 | vrLen = 121; 299 | vrLoc = 0; 300 | }; 301 | 7ACFDB340E226F450022C5BD /* PBXTextBookmark */ = { 302 | isa = PBXTextBookmark; 303 | fRef = 7ACFDA8D0E1FD2F20022C5BD /* CUPreferences.h */; 304 | name = "CUPreferences.h: 64"; 305 | rLen = 0; 306 | rLoc = 3572; 307 | rType = 0; 308 | vrLen = 156; 309 | vrLoc = 2411; 310 | }; 311 | 7ACFDB350E226F450022C5BD /* PBXTextBookmark */ = { 312 | isa = PBXTextBookmark; 313 | fRef = 7ACFD9920E1EFF5D0022C5BD /* CUFontFormatter.m */; 314 | name = "CUFontFormatter.m: 22"; 315 | rLen = 0; 316 | rLoc = 427; 317 | rType = 0; 318 | vrLen = 186; 319 | vrLoc = 248; 320 | }; 321 | 7ACFDB420E226F450022C5BD /* PBXTextBookmark */ = { 322 | isa = PBXTextBookmark; 323 | fRef = 8BC21A8705D881FF001C2B42 /* Controller.h */; 324 | name = "Controller.h: 8"; 325 | rLen = 0; 326 | rLoc = 169; 327 | rType = 0; 328 | vrLen = 2304; 329 | vrLoc = 3525; 330 | }; 331 | 7ACFDB440E226F450022C5BD /* PBXTextBookmark */ = { 332 | isa = PBXTextBookmark; 333 | fRef = 8BC21A8705D881FF001C2B42 /* Controller.h */; 334 | name = "Controller.h: 8"; 335 | rLen = 0; 336 | rLoc = 169; 337 | rType = 0; 338 | vrLen = 2304; 339 | vrLoc = 3525; 340 | }; 341 | 7AE107780E23B8EC0029FDBC /* PBXTextBookmark */ = { 342 | isa = PBXTextBookmark; 343 | fRef = 7ACFDA8D0E1FD2F20022C5BD /* CUPreferences.h */; 344 | name = "CUPreferences.h: 10"; 345 | rLen = 0; 346 | rLoc = 216; 347 | rType = 0; 348 | vrLen = 2942; 349 | vrLoc = 3; 350 | }; 351 | 7AE1077A0E23B8EC0029FDBC /* PBXTextBookmark */ = { 352 | isa = PBXTextBookmark; 353 | fRef = 8BC21A8705D881FF001C2B42 /* Controller.h */; 354 | name = "Controller.h: 223"; 355 | rLen = 0; 356 | rLoc = 6168; 357 | rType = 0; 358 | vrLen = 2570; 359 | vrLoc = 4510; 360 | }; 361 | 7AE1077B0E23B8EC0029FDBC /* PBXTextBookmark */ = { 362 | isa = PBXTextBookmark; 363 | fRef = 8BC21A8805D881FF001C2B42 /* Controller.m */; 364 | name = "Controller.m: 1672"; 365 | rLen = 0; 366 | rLoc = 78760; 367 | rType = 0; 368 | vrLen = 2194; 369 | vrLoc = 111864; 370 | }; 371 | 7AE2E1CF0E23C38D000233CD /* PBXTextBookmark */ = { 372 | isa = PBXTextBookmark; 373 | comments = "error: 'prefsMenuDisplayList' undeclared (first use in this function)"; 374 | fRef = 8BC21A8805D881FF001C2B42 /* Controller.m */; 375 | rLen = 0; 376 | rLoc = 55; 377 | rType = 1; 378 | }; 379 | 7AE2E1D00E23C38D000233CD /* PBXTextBookmark */ = { 380 | isa = PBXTextBookmark; 381 | fRef = 8BC21A8805D881FF001C2B42 /* Controller.m */; 382 | name = "Controller.m: 56"; 383 | rLen = 0; 384 | rLoc = 1473; 385 | rType = 0; 386 | vrLen = 326; 387 | vrLoc = 1433; 388 | }; 389 | 7AE2E1D30E23C38D000233CD /* PBXTextBookmark */ = { 390 | isa = PBXTextBookmark; 391 | fRef = 7ACFDA8D0E1FD2F20022C5BD /* CUPreferences.h */; 392 | name = "CUPreferences.h: 94"; 393 | rLen = 0; 394 | rLoc = 4189; 395 | rType = 0; 396 | vrLen = 2555; 397 | vrLoc = 2255; 398 | }; 399 | 7AE2E1D40E23C38D000233CD /* PBXTextBookmark */ = { 400 | isa = PBXTextBookmark; 401 | fRef = 8BC21A8705D881FF001C2B42 /* Controller.h */; 402 | name = "Controller.h: 223"; 403 | rLen = 0; 404 | rLoc = 6168; 405 | rType = 0; 406 | vrLen = 2570; 407 | vrLoc = 4510; 408 | }; 409 | 7AE2E1D50E23C38D000233CD /* PBXTextBookmark */ = { 410 | isa = PBXTextBookmark; 411 | fRef = 8BC21A8805D881FF001C2B42 /* Controller.m */; 412 | name = "Controller.m: 1666"; 413 | rLen = 0; 414 | rLoc = 78760; 415 | rType = 0; 416 | vrLen = 2238; 417 | vrLoc = 111731; 418 | }; 419 | 7AF508300E169D9B0090CFC7 /* Khronos */ = { 420 | isa = PBXExecutable; 421 | activeArgIndices = ( 422 | ); 423 | argumentStrings = ( 424 | ); 425 | autoAttachOnCrash = 1; 426 | breakpointsEnabled = 0; 427 | configStateDict = { 428 | }; 429 | customDataFormattersEnabled = 1; 430 | debuggerPlugin = GDBDebugging; 431 | disassemblyDisplayState = 0; 432 | dylibVariantSuffix = ""; 433 | enableDebugStr = 1; 434 | environmentEntries = ( 435 | ); 436 | executableSystemSymbolLevel = 0; 437 | executableUserSymbolLevel = 0; 438 | libgmallocEnabled = 0; 439 | name = Khronos; 440 | savedGlobals = { 441 | }; 442 | sourceDirectories = ( 443 | ); 444 | variableFormatDictionary = { 445 | }; 446 | }; 447 | 7AF508350E169DBA0090CFC7 /* Source Control */ = { 448 | isa = PBXSourceControlManager; 449 | fallbackIsa = XCSourceControlManager; 450 | isSCMEnabled = 0; 451 | scmConfiguration = { 452 | }; 453 | }; 454 | 7AF508360E169DBA0090CFC7 /* Code sense */ = { 455 | isa = PBXCodeSenseManager; 456 | indexTemplatePath = ""; 457 | }; 458 | 7AF508400E1819560090CFC7 /* PBXTextBookmark */ = { 459 | isa = PBXTextBookmark; 460 | fRef = 29B97316FDCFA39411CA2CEA /* main.m */; 461 | name = "main.m: 1"; 462 | rLen = 0; 463 | rLoc = 0; 464 | rType = 0; 465 | vrLen = 104; 466 | vrLoc = 0; 467 | }; 468 | 7AF508410E1819560090CFC7 /* PBXTextBookmark */ = { 469 | isa = PBXTextBookmark; 470 | fRef = 8BC4A7EE05DBF1630022CDB4 /* dataHandler.m */; 471 | name = "dataHandler.m: 1"; 472 | rLen = 0; 473 | rLoc = 0; 474 | rType = 0; 475 | vrLen = 1978; 476 | vrLoc = 0; 477 | }; 478 | 7AF508440E1819560090CFC7 /* PBXTextBookmark */ = { 479 | isa = PBXTextBookmark; 480 | fRef = 8BEBC03205DAA11100534DBC /* tableGenerator.h */; 481 | name = "tableGenerator.h: 1"; 482 | rLen = 0; 483 | rLoc = 0; 484 | rType = 0; 485 | vrLen = 1097; 486 | vrLoc = 143; 487 | }; 488 | 7AF508450E1819560090CFC7 /* PBXTextBookmark */ = { 489 | isa = PBXTextBookmark; 490 | fRef = 8BC21A8805D881FF001C2B42 /* Controller.m */; 491 | name = "Controller.m: 1"; 492 | rLen = 0; 493 | rLoc = 0; 494 | rType = 0; 495 | vrLen = 541; 496 | vrLoc = 0; 497 | }; 498 | 7AF508460E1819560090CFC7 /* PBXTextBookmark */ = { 499 | isa = PBXTextBookmark; 500 | fRef = 29B97316FDCFA39411CA2CEA /* main.m */; 501 | name = "main.m: 1"; 502 | rLen = 0; 503 | rLoc = 0; 504 | rType = 0; 505 | vrLen = 104; 506 | vrLoc = 0; 507 | }; 508 | 7AF508480E1819560090CFC7 /* PBXTextBookmark */ = { 509 | isa = PBXTextBookmark; 510 | fRef = 8BC4A7EE05DBF1630022CDB4 /* dataHandler.m */; 511 | name = "dataHandler.m: 1"; 512 | rLen = 0; 513 | rLoc = 0; 514 | rType = 0; 515 | vrLen = 1978; 516 | vrLoc = 0; 517 | }; 518 | 7AF508610E181A270090CFC7 /* CUPreferenceController.h */ = { 519 | uiCtxt = { 520 | sepNavIntBoundsRect = "{{0, 0}, {530, 1274}}"; 521 | sepNavSelRange = "{2584, 0}"; 522 | sepNavVisRange = "{1548, 247}"; 523 | sepNavWindowFrame = "{{586, 8}, {644, 1145}}"; 524 | }; 525 | }; 526 | 7AF508620E181A270090CFC7 /* CUPreferenceController.m */ = { 527 | uiCtxt = { 528 | sepNavIntBoundsRect = "{{0, 0}, {744, 5572}}"; 529 | sepNavSelRange = "{11887, 0}"; 530 | sepNavVisRange = "{9864, 2546}"; 531 | sepNavWindowFrame = "{{936, 33}, {676, 1145}}"; 532 | }; 533 | }; 534 | 7AF5086D0E1820BE0090CFC7 /* PBXTextBookmark */ = { 535 | isa = PBXTextBookmark; 536 | fRef = 8BC21A8705D881FF001C2B42 /* Controller.h */; 537 | name = "Controller.h: 1"; 538 | rLen = 0; 539 | rLoc = 0; 540 | rType = 0; 541 | vrLen = 1258; 542 | vrLoc = 0; 543 | }; 544 | 7AF5086E0E1820BE0090CFC7 /* PBXTextBookmark */ = { 545 | isa = PBXTextBookmark; 546 | fRef = 7AF508610E181A270090CFC7 /* CUPreferenceController.h */; 547 | name = "CUPreferenceController.h: 1"; 548 | rLen = 0; 549 | rLoc = 0; 550 | rType = 0; 551 | vrLen = 230; 552 | vrLoc = 0; 553 | }; 554 | 7AF508700E1820BE0090CFC7 /* PBXTextBookmark */ = { 555 | isa = PBXTextBookmark; 556 | fRef = 7AF508620E181A270090CFC7 /* CUPreferenceController.m */; 557 | name = "CUPreferenceController.m: 1"; 558 | rLen = 0; 559 | rLoc = 0; 560 | rType = 0; 561 | vrLen = 230; 562 | vrLoc = 0; 563 | }; 564 | 7AF509470E1CC5650090CFC7 /* CUPreferenceController.m:264 */ = { 565 | isa = PBXFileBreakpoint; 566 | actions = ( 567 | ); 568 | breakpointStyle = 0; 569 | continueAfterActions = 0; 570 | countType = 0; 571 | delayBeforeContinue = 0; 572 | fileReference = 7AF508620E181A270090CFC7 /* CUPreferenceController.m */; 573 | functionName = "-changeClock:"; 574 | hitCount = 0; 575 | ignoreCount = 0; 576 | lineNumber = 264; 577 | location = Khronos; 578 | modificationTime = 236818948.037061; 579 | state = 2; 580 | }; 581 | 7AF509550E1CC61E0090CFC7 /* CUPreferenceController.m:264 */ = { 582 | isa = PBXFileBreakpoint; 583 | actions = ( 584 | ); 585 | breakpointStyle = 0; 586 | continueAfterActions = 0; 587 | countType = 0; 588 | delayBeforeContinue = 0; 589 | fileReference = 7AF508620E181A270090CFC7 /* CUPreferenceController.m */; 590 | functionName = "-changeClock:"; 591 | hitCount = 0; 592 | ignoreCount = 0; 593 | lineNumber = 264; 594 | location = Khronos; 595 | modificationTime = 236818948.037172; 596 | state = 2; 597 | }; 598 | 8B8C911805DAFB7200B25096 /* cuDateTime.h */ = { 599 | uiCtxt = { 600 | sepNavIntBoundsRect = "{{0, 0}, {530, 1022}}"; 601 | sepNavSelRange = "{0, 0}"; 602 | sepNavVisRange = "{0, 121}"; 603 | }; 604 | }; 605 | 8BC21A8705D881FF001C2B42 /* Controller.h */ = { 606 | uiCtxt = { 607 | sepNavIntBoundsRect = "{{0, 0}, {810, 3220}}"; 608 | sepNavSelRange = "{6168, 0}"; 609 | sepNavVisRange = "{4510, 2570}"; 610 | sepNavWindowFrame = "{{355, 33}, {641, 1145}}"; 611 | }; 612 | }; 613 | 8BC21A8805D881FF001C2B42 /* Controller.m */ = { 614 | uiCtxt = { 615 | sepNavIntBoundsRect = "{{0, 0}, {1285, 34342}}"; 616 | sepNavSelRange = "{78760, 0}"; 617 | sepNavVisRange = "{111731, 2238}"; 618 | sepNavWindowFrame = "{{558, 32}, {1344, 1145}}"; 619 | }; 620 | }; 621 | 8BC4A7ED05DBF1630022CDB4 /* dataHandler.h */ = { 622 | uiCtxt = { 623 | sepNavIntBoundsRect = "{{0, 0}, {691, 430}}"; 624 | sepNavSelRange = "{0, 0}"; 625 | sepNavVisRange = "{0, 786}"; 626 | sepNavWindowFrame = "{{6, 607}, {750, 558}}"; 627 | }; 628 | }; 629 | 8BC4A7EE05DBF1630022CDB4 /* dataHandler.m */ = { 630 | uiCtxt = { 631 | sepNavIntBoundsRect = "{{0, 0}, {1651, 6216}}"; 632 | sepNavSelRange = "{0, 0}"; 633 | sepNavVisRange = "{0, 2118}"; 634 | sepNavWindowFrame = "{{15, 28}, {1244, 1145}}"; 635 | }; 636 | }; 637 | 8BEBC03205DAA11100534DBC /* tableGenerator.h */ = { 638 | uiCtxt = { 639 | sepNavIntBoundsRect = "{{0, 0}, {554, 695}}"; 640 | sepNavSelRange = "{0, 0}"; 641 | sepNavVisRange = "{0, 1240}"; 642 | }; 643 | }; 644 | 8BEBC03305DAA11100534DBC /* tableGenerator.m */ = { 645 | uiCtxt = { 646 | sepNavIntBoundsRect = "{{0, 0}, {1285, 3486}}"; 647 | sepNavSelRange = "{0, 0}"; 648 | sepNavVisRange = "{0, 2761}"; 649 | sepNavWindowFrame = "{{15, 33}, {1344, 1145}}"; 650 | }; 651 | }; 652 | 8D1107260486CEB800E47090 /* Khronos */ = { 653 | activeExec = 0; 654 | executables = ( 655 | 7AF508300E169D9B0090CFC7 /* Khronos */, 656 | ); 657 | }; 658 | } 659 | -------------------------------------------------------------------------------- /Khronos.xcode/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 39; 7 | objects = { 8 | 080E96DDFE201D6D7F000001 = { 9 | children = ( 10 | 8BC21A8705D881FF001C2B42, 11 | 8BC21A8805D881FF001C2B42, 12 | 8B8C911805DAFB7200B25096, 13 | 8B8C911905DAFB7200B25096, 14 | 8BC4A7ED05DBF1630022CDB4, 15 | 8BC4A7EE05DBF1630022CDB4, 16 | 8BEBC03205DAA11100534DBC, 17 | 8BEBC03305DAA11100534DBC, 18 | ); 19 | isa = PBXGroup; 20 | name = Classes; 21 | refType = 4; 22 | sourceTree = ""; 23 | }; 24 | 089C165CFE840E0CC02AAC07 = { 25 | children = ( 26 | 089C165DFE840E0CC02AAC07, 27 | ); 28 | isa = PBXVariantGroup; 29 | name = InfoPlist.strings; 30 | refType = 4; 31 | sourceTree = ""; 32 | }; 33 | 089C165DFE840E0CC02AAC07 = { 34 | fileEncoding = 10; 35 | isa = PBXFileReference; 36 | lastKnownFileType = text.plist.strings; 37 | name = English; 38 | path = English.lproj/InfoPlist.strings; 39 | refType = 4; 40 | sourceTree = ""; 41 | }; 42 | //080 43 | //081 44 | //082 45 | //083 46 | //084 47 | //100 48 | //101 49 | //102 50 | //103 51 | //104 52 | 1058C7A0FEA54F0111CA2CBB = { 53 | children = ( 54 | 1058C7A1FEA54F0111CA2CBB, 55 | ); 56 | isa = PBXGroup; 57 | name = "Linked Frameworks"; 58 | refType = 4; 59 | sourceTree = ""; 60 | }; 61 | 1058C7A1FEA54F0111CA2CBB = { 62 | isa = PBXFileReference; 63 | lastKnownFileType = wrapper.framework; 64 | name = Cocoa.framework; 65 | path = /System/Library/Frameworks/Cocoa.framework; 66 | refType = 0; 67 | sourceTree = ""; 68 | }; 69 | 1058C7A2FEA54F0111CA2CBB = { 70 | children = ( 71 | 29B97325FDCFA39411CA2CEA, 72 | 29B97324FDCFA39411CA2CEA, 73 | ); 74 | isa = PBXGroup; 75 | name = "Other Frameworks"; 76 | refType = 4; 77 | sourceTree = ""; 78 | }; 79 | //100 80 | //101 81 | //102 82 | //103 83 | //104 84 | //190 85 | //191 86 | //192 87 | //193 88 | //194 89 | 19C28FACFE9D520D11CA2CBB = { 90 | children = ( 91 | 8D1107320486CEB800E47090, 92 | ); 93 | isa = PBXGroup; 94 | name = Products; 95 | refType = 4; 96 | sourceTree = ""; 97 | }; 98 | //190 99 | //191 100 | //192 101 | //193 102 | //194 103 | //290 104 | //291 105 | //292 106 | //293 107 | //294 108 | 29B97313FDCFA39411CA2CEA = { 109 | buildSettings = { 110 | }; 111 | buildStyles = ( 112 | 4A9504CCFFE6A4B311CA0CBA, 113 | 4A9504CDFFE6A4B311CA0CBA, 114 | ); 115 | hasScannedForEncodings = 1; 116 | isa = PBXProject; 117 | mainGroup = 29B97314FDCFA39411CA2CEA; 118 | projectDirPath = ""; 119 | targets = ( 120 | 8D1107260486CEB800E47090, 121 | ); 122 | }; 123 | 29B97314FDCFA39411CA2CEA = { 124 | children = ( 125 | 080E96DDFE201D6D7F000001, 126 | 29B97315FDCFA39411CA2CEA, 127 | 29B97317FDCFA39411CA2CEA, 128 | 29B97323FDCFA39411CA2CEA, 129 | 19C28FACFE9D520D11CA2CBB, 130 | ); 131 | isa = PBXGroup; 132 | name = Khronos; 133 | path = ""; 134 | refType = 4; 135 | sourceTree = ""; 136 | }; 137 | 29B97315FDCFA39411CA2CEA = { 138 | children = ( 139 | 32CA4F630368D1EE00C91783, 140 | 29B97316FDCFA39411CA2CEA, 141 | ); 142 | isa = PBXGroup; 143 | name = "Other Sources"; 144 | path = ""; 145 | refType = 4; 146 | sourceTree = ""; 147 | }; 148 | 29B97316FDCFA39411CA2CEA = { 149 | fileEncoding = 30; 150 | isa = PBXFileReference; 151 | lastKnownFileType = sourcecode.c.objc; 152 | path = main.m; 153 | refType = 4; 154 | sourceTree = ""; 155 | }; 156 | 29B97317FDCFA39411CA2CEA = { 157 | children = ( 158 | 8B05E99205D9A18A00228C57, 159 | 8B1E332A05D8992F000E3A53, 160 | 8BEC38CA05D9512D00533678, 161 | 8D1107310486CEB800E47090, 162 | 089C165CFE840E0CC02AAC07, 163 | 29B97318FDCFA39411CA2CEA, 164 | ); 165 | isa = PBXGroup; 166 | name = Resources; 167 | path = ""; 168 | refType = 4; 169 | sourceTree = ""; 170 | }; 171 | 29B97318FDCFA39411CA2CEA = { 172 | children = ( 173 | 29B97319FDCFA39411CA2CEA, 174 | ); 175 | isa = PBXVariantGroup; 176 | name = MainMenu.nib; 177 | path = ""; 178 | refType = 4; 179 | sourceTree = ""; 180 | }; 181 | 29B97319FDCFA39411CA2CEA = { 182 | isa = PBXFileReference; 183 | lastKnownFileType = wrapper.nib; 184 | name = English; 185 | path = English.lproj/MainMenu.nib; 186 | refType = 4; 187 | sourceTree = ""; 188 | }; 189 | 29B97323FDCFA39411CA2CEA = { 190 | children = ( 191 | 1058C7A0FEA54F0111CA2CBB, 192 | 1058C7A2FEA54F0111CA2CBB, 193 | ); 194 | isa = PBXGroup; 195 | name = Frameworks; 196 | path = ""; 197 | refType = 4; 198 | sourceTree = ""; 199 | }; 200 | 29B97324FDCFA39411CA2CEA = { 201 | isa = PBXFileReference; 202 | lastKnownFileType = wrapper.framework; 203 | name = AppKit.framework; 204 | path = /System/Library/Frameworks/AppKit.framework; 205 | refType = 0; 206 | sourceTree = ""; 207 | }; 208 | 29B97325FDCFA39411CA2CEA = { 209 | isa = PBXFileReference; 210 | lastKnownFileType = wrapper.framework; 211 | name = Foundation.framework; 212 | path = /System/Library/Frameworks/Foundation.framework; 213 | refType = 0; 214 | sourceTree = ""; 215 | }; 216 | //290 217 | //291 218 | //292 219 | //293 220 | //294 221 | //320 222 | //321 223 | //322 224 | //323 225 | //324 226 | 32CA4F630368D1EE00C91783 = { 227 | fileEncoding = 4; 228 | isa = PBXFileReference; 229 | lastKnownFileType = sourcecode.c.h; 230 | path = Khronos_Prefix.pch; 231 | refType = 4; 232 | sourceTree = ""; 233 | }; 234 | //320 235 | //321 236 | //322 237 | //323 238 | //324 239 | //4A0 240 | //4A1 241 | //4A2 242 | //4A3 243 | //4A4 244 | 4A9504CCFFE6A4B311CA0CBA = { 245 | buildSettings = { 246 | COPY_PHASE_STRIP = NO; 247 | DEBUGGING_SYMBOLS = YES; 248 | GCC_DYNAMIC_NO_PIC = NO; 249 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 250 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 251 | GCC_OPTIMIZATION_LEVEL = 0; 252 | OPTIMIZATION_CFLAGS = "-O0"; 253 | ZERO_LINK = YES; 254 | }; 255 | isa = PBXBuildStyle; 256 | name = Development; 257 | }; 258 | 4A9504CDFFE6A4B311CA0CBA = { 259 | buildSettings = { 260 | COPY_PHASE_STRIP = YES; 261 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 262 | ZERO_LINK = NO; 263 | }; 264 | isa = PBXBuildStyle; 265 | name = Deployment; 266 | }; 267 | //4A0 268 | //4A1 269 | //4A2 270 | //4A3 271 | //4A4 272 | //8B0 273 | //8B1 274 | //8B2 275 | //8B3 276 | //8B4 277 | 8B05E99205D9A18A00228C57 = { 278 | isa = PBXFileReference; 279 | lastKnownFileType = image.icns; 280 | path = khronos.icns; 281 | refType = 4; 282 | sourceTree = ""; 283 | }; 284 | 8B05E99305D9A18A00228C57 = { 285 | fileRef = 8B05E99205D9A18A00228C57; 286 | isa = PBXBuildFile; 287 | settings = { 288 | }; 289 | }; 290 | 8B1E332A05D8992F000E3A53 = { 291 | children = ( 292 | 8B5F2DCA05E33CF600501878, 293 | 8BD4F72C05E20112003ECE09, 294 | 8BE4262505E0BE750019708C, 295 | 8BC18A4605DDB1B100C152EB, 296 | 8BC18A4705DDB1B100C152EB, 297 | 8BC18A4805DDB1B100C152EB, 298 | 8BC18A4905DDB1B100C152EB, 299 | 8BC18A4A05DDB1B100C152EB, 300 | 8B5A77B605DC7172003BD710, 301 | 8B5A777005DC6F9D003BD710, 302 | 8B5A777105DC6F9D003BD710, 303 | 8B5A777205DC6F9D003BD710, 304 | 8B5A777305DC6F9D003BD710, 305 | 8B217FC505DC64CF008C95F4, 306 | 8B217FC605DC64CF008C95F4, 307 | 8B217FC705DC64CF008C95F4, 308 | 8B1E334105D8993C000E3A53, 309 | 8B1E334205D8993C000E3A53, 310 | 8B1E334305D8993C000E3A53, 311 | 8B1E334405D8993C000E3A53, 312 | ); 313 | isa = PBXGroup; 314 | name = Graphics; 315 | refType = 4; 316 | sourceTree = ""; 317 | }; 318 | 8B1E334105D8993C000E3A53 = { 319 | isa = PBXFileReference; 320 | lastKnownFileType = image.gif; 321 | name = edit.gif; 322 | path = Graphics/edit.gif; 323 | refType = 4; 324 | sourceTree = ""; 325 | }; 326 | 8B1E334205D8993C000E3A53 = { 327 | isa = PBXFileReference; 328 | lastKnownFileType = image.gif; 329 | name = minus.gif; 330 | path = Graphics/minus.gif; 331 | refType = 4; 332 | sourceTree = ""; 333 | }; 334 | 8B1E334305D8993C000E3A53 = { 335 | isa = PBXFileReference; 336 | lastKnownFileType = image.gif; 337 | name = plus.gif; 338 | path = Graphics/plus.gif; 339 | refType = 4; 340 | sourceTree = ""; 341 | }; 342 | 8B1E334405D8993C000E3A53 = { 343 | isa = PBXFileReference; 344 | lastKnownFileType = image.gif; 345 | name = showSessions.gif; 346 | path = Graphics/showSessions.gif; 347 | refType = 4; 348 | sourceTree = ""; 349 | }; 350 | 8B1E334A05D8993C000E3A53 = { 351 | fileRef = 8B1E334105D8993C000E3A53; 352 | isa = PBXBuildFile; 353 | settings = { 354 | }; 355 | }; 356 | 8B1E334B05D8993C000E3A53 = { 357 | fileRef = 8B1E334205D8993C000E3A53; 358 | isa = PBXBuildFile; 359 | settings = { 360 | }; 361 | }; 362 | 8B1E334C05D8993C000E3A53 = { 363 | fileRef = 8B1E334305D8993C000E3A53; 364 | isa = PBXBuildFile; 365 | settings = { 366 | }; 367 | }; 368 | 8B1E334D05D8993C000E3A53 = { 369 | fileRef = 8B1E334405D8993C000E3A53; 370 | isa = PBXBuildFile; 371 | settings = { 372 | }; 373 | }; 374 | 8B217FC505DC64CF008C95F4 = { 375 | isa = PBXFileReference; 376 | lastKnownFileType = image.png; 377 | name = jobActive.png; 378 | path = Graphics/jobActive.png; 379 | refType = 4; 380 | sourceTree = ""; 381 | }; 382 | 8B217FC605DC64CF008C95F4 = { 383 | isa = PBXFileReference; 384 | lastKnownFileType = image.png; 385 | name = jobInactive.png; 386 | path = Graphics/jobInactive.png; 387 | refType = 4; 388 | sourceTree = ""; 389 | }; 390 | 8B217FC705DC64CF008C95F4 = { 391 | isa = PBXFileReference; 392 | lastKnownFileType = image.png; 393 | name = jobPause.png; 394 | path = Graphics/jobPause.png; 395 | refType = 4; 396 | sourceTree = ""; 397 | }; 398 | 8B217FC805DC64CF008C95F4 = { 399 | fileRef = 8B217FC505DC64CF008C95F4; 400 | isa = PBXBuildFile; 401 | settings = { 402 | }; 403 | }; 404 | 8B217FC905DC64CF008C95F4 = { 405 | fileRef = 8B217FC605DC64CF008C95F4; 406 | isa = PBXBuildFile; 407 | settings = { 408 | }; 409 | }; 410 | 8B217FCA05DC64CF008C95F4 = { 411 | fileRef = 8B217FC705DC64CF008C95F4; 412 | isa = PBXBuildFile; 413 | settings = { 414 | }; 415 | }; 416 | 8B5A777005DC6F9D003BD710 = { 417 | isa = PBXFileReference; 418 | lastKnownFileType = image.png; 419 | name = stst_pause.png; 420 | path = Graphics/stst_pause.png; 421 | refType = 4; 422 | sourceTree = ""; 423 | }; 424 | 8B5A777105DC6F9D003BD710 = { 425 | isa = PBXFileReference; 426 | lastKnownFileType = image.png; 427 | name = stst_pause2.png; 428 | path = Graphics/stst_pause2.png; 429 | refType = 4; 430 | sourceTree = ""; 431 | }; 432 | 8B5A777205DC6F9D003BD710 = { 433 | isa = PBXFileReference; 434 | lastKnownFileType = image.png; 435 | name = stst_start.png; 436 | path = Graphics/stst_start.png; 437 | refType = 4; 438 | sourceTree = ""; 439 | }; 440 | 8B5A777305DC6F9D003BD710 = { 441 | isa = PBXFileReference; 442 | lastKnownFileType = image.png; 443 | name = stst_stop.png; 444 | path = Graphics/stst_stop.png; 445 | refType = 4; 446 | sourceTree = ""; 447 | }; 448 | 8B5A777405DC6F9D003BD710 = { 449 | fileRef = 8B5A777005DC6F9D003BD710; 450 | isa = PBXBuildFile; 451 | settings = { 452 | }; 453 | }; 454 | 8B5A777505DC6F9D003BD710 = { 455 | fileRef = 8B5A777105DC6F9D003BD710; 456 | isa = PBXBuildFile; 457 | settings = { 458 | }; 459 | }; 460 | 8B5A777605DC6F9D003BD710 = { 461 | fileRef = 8B5A777205DC6F9D003BD710; 462 | isa = PBXBuildFile; 463 | settings = { 464 | }; 465 | }; 466 | 8B5A777705DC6F9D003BD710 = { 467 | fileRef = 8B5A777305DC6F9D003BD710; 468 | isa = PBXBuildFile; 469 | settings = { 470 | }; 471 | }; 472 | 8B5A77B605DC7172003BD710 = { 473 | isa = PBXFileReference; 474 | lastKnownFileType = image.png; 475 | name = stst_null.png; 476 | path = Graphics/stst_null.png; 477 | refType = 4; 478 | sourceTree = ""; 479 | }; 480 | 8B5A77B705DC7172003BD710 = { 481 | fileRef = 8B5A77B605DC7172003BD710; 482 | isa = PBXBuildFile; 483 | settings = { 484 | }; 485 | }; 486 | 8B5F2DCA05E33CF600501878 = { 487 | isa = PBXFileReference; 488 | lastKnownFileType = image.png; 489 | name = stst_nullPauseMB.png; 490 | path = Graphics/stst_nullPauseMB.png; 491 | refType = 4; 492 | sourceTree = ""; 493 | }; 494 | 8B5F2DCB05E33CF600501878 = { 495 | fileRef = 8B5F2DCA05E33CF600501878; 496 | isa = PBXBuildFile; 497 | settings = { 498 | }; 499 | }; 500 | 8B8C911805DAFB7200B25096 = { 501 | fileEncoding = 30; 502 | isa = PBXFileReference; 503 | lastKnownFileType = sourcecode.c.h; 504 | path = cuDateTime.h; 505 | refType = 4; 506 | sourceTree = ""; 507 | }; 508 | 8B8C911905DAFB7200B25096 = { 509 | fileEncoding = 30; 510 | isa = PBXFileReference; 511 | lastKnownFileType = sourcecode.c.objc; 512 | path = cuDateTime.m; 513 | refType = 4; 514 | sourceTree = ""; 515 | }; 516 | 8B8C911A05DAFB7200B25096 = { 517 | fileRef = 8B8C911805DAFB7200B25096; 518 | isa = PBXBuildFile; 519 | settings = { 520 | }; 521 | }; 522 | 8B8C911B05DAFB7200B25096 = { 523 | fileRef = 8B8C911905DAFB7200B25096; 524 | isa = PBXBuildFile; 525 | settings = { 526 | }; 527 | }; 528 | 8BC18A4605DDB1B100C152EB = { 529 | isa = PBXFileReference; 530 | lastKnownFileType = image.png; 531 | name = stst_nullMB.png; 532 | path = Graphics/stst_nullMB.png; 533 | refType = 4; 534 | sourceTree = ""; 535 | }; 536 | 8BC18A4705DDB1B100C152EB = { 537 | isa = PBXFileReference; 538 | lastKnownFileType = image.png; 539 | name = stst_pause2MB.png; 540 | path = Graphics/stst_pause2MB.png; 541 | refType = 4; 542 | sourceTree = ""; 543 | }; 544 | 8BC18A4805DDB1B100C152EB = { 545 | isa = PBXFileReference; 546 | lastKnownFileType = image.png; 547 | name = stst_playMB.png; 548 | path = Graphics/stst_playMB.png; 549 | refType = 4; 550 | sourceTree = ""; 551 | }; 552 | 8BC18A4905DDB1B100C152EB = { 553 | isa = PBXFileReference; 554 | lastKnownFileType = image.png; 555 | name = stst_startMB.png; 556 | path = Graphics/stst_startMB.png; 557 | refType = 4; 558 | sourceTree = ""; 559 | }; 560 | 8BC18A4A05DDB1B100C152EB = { 561 | isa = PBXFileReference; 562 | lastKnownFileType = image.png; 563 | name = stst_stopMB.png; 564 | path = Graphics/stst_stopMB.png; 565 | refType = 4; 566 | sourceTree = ""; 567 | }; 568 | 8BC18A4B05DDB1B100C152EB = { 569 | fileRef = 8BC18A4605DDB1B100C152EB; 570 | isa = PBXBuildFile; 571 | settings = { 572 | }; 573 | }; 574 | 8BC18A4C05DDB1B100C152EB = { 575 | fileRef = 8BC18A4705DDB1B100C152EB; 576 | isa = PBXBuildFile; 577 | settings = { 578 | }; 579 | }; 580 | 8BC18A4D05DDB1B100C152EB = { 581 | fileRef = 8BC18A4805DDB1B100C152EB; 582 | isa = PBXBuildFile; 583 | settings = { 584 | }; 585 | }; 586 | 8BC18A4E05DDB1B100C152EB = { 587 | fileRef = 8BC18A4905DDB1B100C152EB; 588 | isa = PBXBuildFile; 589 | settings = { 590 | }; 591 | }; 592 | 8BC18A4F05DDB1B100C152EB = { 593 | fileRef = 8BC18A4A05DDB1B100C152EB; 594 | isa = PBXBuildFile; 595 | settings = { 596 | }; 597 | }; 598 | 8BC21A8705D881FF001C2B42 = { 599 | fileEncoding = 30; 600 | isa = PBXFileReference; 601 | lastKnownFileType = sourcecode.c.h; 602 | path = Controller.h; 603 | refType = 4; 604 | sourceTree = ""; 605 | }; 606 | 8BC21A8805D881FF001C2B42 = { 607 | fileEncoding = 30; 608 | isa = PBXFileReference; 609 | lastKnownFileType = sourcecode.c.objc; 610 | path = Controller.m; 611 | refType = 4; 612 | sourceTree = ""; 613 | }; 614 | 8BC21A8905D881FF001C2B42 = { 615 | fileRef = 8BC21A8705D881FF001C2B42; 616 | isa = PBXBuildFile; 617 | settings = { 618 | }; 619 | }; 620 | 8BC21A8A05D881FF001C2B42 = { 621 | fileRef = 8BC21A8805D881FF001C2B42; 622 | isa = PBXBuildFile; 623 | settings = { 624 | }; 625 | }; 626 | 8BC4A7ED05DBF1630022CDB4 = { 627 | fileEncoding = 4; 628 | isa = PBXFileReference; 629 | lastKnownFileType = sourcecode.c.h; 630 | path = dataHandler.h; 631 | refType = 4; 632 | sourceTree = ""; 633 | }; 634 | 8BC4A7EE05DBF1630022CDB4 = { 635 | fileEncoding = 4; 636 | isa = PBXFileReference; 637 | lastKnownFileType = sourcecode.c.objc; 638 | path = dataHandler.m; 639 | refType = 4; 640 | sourceTree = ""; 641 | }; 642 | 8BC4A7EF05DBF1630022CDB4 = { 643 | fileRef = 8BC4A7ED05DBF1630022CDB4; 644 | isa = PBXBuildFile; 645 | settings = { 646 | }; 647 | }; 648 | 8BC4A7F005DBF1630022CDB4 = { 649 | fileRef = 8BC4A7EE05DBF1630022CDB4; 650 | isa = PBXBuildFile; 651 | settings = { 652 | }; 653 | }; 654 | 8BD4F72C05E20112003ECE09 = { 655 | isa = PBXFileReference; 656 | lastKnownFileType = image.png; 657 | path = MBjobSelector3Alt.png; 658 | refType = 4; 659 | sourceTree = ""; 660 | }; 661 | 8BD4F72D05E20112003ECE09 = { 662 | fileRef = 8BD4F72C05E20112003ECE09; 663 | isa = PBXBuildFile; 664 | settings = { 665 | }; 666 | }; 667 | 8BE4262505E0BE750019708C = { 668 | isa = PBXFileReference; 669 | lastKnownFileType = image.png; 670 | name = MBjobSelector3.png; 671 | path = Graphics/MBjobSelector3.png; 672 | refType = 4; 673 | sourceTree = ""; 674 | }; 675 | 8BE4262605E0BE750019708C = { 676 | fileRef = 8BE4262505E0BE750019708C; 677 | isa = PBXBuildFile; 678 | settings = { 679 | }; 680 | }; 681 | 8BEBC03205DAA11100534DBC = { 682 | fileEncoding = 4; 683 | isa = PBXFileReference; 684 | lastKnownFileType = sourcecode.c.h; 685 | path = tableGenerator.h; 686 | refType = 4; 687 | sourceTree = ""; 688 | }; 689 | 8BEBC03305DAA11100534DBC = { 690 | fileEncoding = 4; 691 | isa = PBXFileReference; 692 | lastKnownFileType = sourcecode.c.objc; 693 | path = tableGenerator.m; 694 | refType = 4; 695 | sourceTree = ""; 696 | }; 697 | 8BEBC03405DAA11100534DBC = { 698 | fileRef = 8BEBC03205DAA11100534DBC; 699 | isa = PBXBuildFile; 700 | settings = { 701 | }; 702 | }; 703 | 8BEBC03505DAA11100534DBC = { 704 | fileRef = 8BEBC03305DAA11100534DBC; 705 | isa = PBXBuildFile; 706 | settings = { 707 | }; 708 | }; 709 | 8BEC38CA05D9512D00533678 = { 710 | fileEncoding = 4; 711 | isa = PBXFileReference; 712 | lastKnownFileType = text; 713 | path = prefs.txt; 714 | refType = 4; 715 | sourceTree = ""; 716 | }; 717 | 8BEC38CB05D9512D00533678 = { 718 | fileRef = 8BEC38CA05D9512D00533678; 719 | isa = PBXBuildFile; 720 | settings = { 721 | }; 722 | }; 723 | //8B0 724 | //8B1 725 | //8B2 726 | //8B3 727 | //8B4 728 | //8D0 729 | //8D1 730 | //8D2 731 | //8D3 732 | //8D4 733 | 8D1107260486CEB800E47090 = { 734 | buildPhases = ( 735 | 8D1107270486CEB800E47090, 736 | 8D1107290486CEB800E47090, 737 | 8D11072C0486CEB800E47090, 738 | 8D11072E0486CEB800E47090, 739 | ); 740 | buildRules = ( 741 | ); 742 | buildSettings = { 743 | FRAMEWORK_SEARCH_PATHS = ""; 744 | GCC_ENABLE_TRIGRAPHS = NO; 745 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO; 746 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 747 | GCC_PREFIX_HEADER = Khronos_Prefix.pch; 748 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; 749 | GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; 750 | GCC_WARN_UNKNOWN_PRAGMAS = NO; 751 | HEADER_SEARCH_PATHS = ""; 752 | INFOPLIST_FILE = Info.plist; 753 | INSTALL_PATH = "$(HOME)/Applications"; 754 | LIBRARY_SEARCH_PATHS = ""; 755 | OTHER_CFLAGS = ""; 756 | OTHER_LDFLAGS = ""; 757 | PRODUCT_NAME = Khronos; 758 | SECTORDER_FLAGS = ""; 759 | WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; 760 | WRAPPER_EXTENSION = app; 761 | }; 762 | dependencies = ( 763 | ); 764 | isa = PBXNativeTarget; 765 | name = Khronos; 766 | productInstallPath = "$(HOME)/Applications"; 767 | productName = Khronos; 768 | productReference = 8D1107320486CEB800E47090; 769 | productType = "com.apple.product-type.application"; 770 | }; 771 | 8D1107270486CEB800E47090 = { 772 | buildActionMask = 2147483647; 773 | files = ( 774 | 8D1107280486CEB800E47090, 775 | 8BC21A8905D881FF001C2B42, 776 | 8BEBC03405DAA11100534DBC, 777 | 8B8C911A05DAFB7200B25096, 778 | 8BC4A7EF05DBF1630022CDB4, 779 | ); 780 | isa = PBXHeadersBuildPhase; 781 | runOnlyForDeploymentPostprocessing = 0; 782 | }; 783 | 8D1107280486CEB800E47090 = { 784 | fileRef = 32CA4F630368D1EE00C91783; 785 | isa = PBXBuildFile; 786 | settings = { 787 | }; 788 | }; 789 | 8D1107290486CEB800E47090 = { 790 | buildActionMask = 2147483647; 791 | files = ( 792 | 8D11072A0486CEB800E47090, 793 | 8D11072B0486CEB800E47090, 794 | 8B1E334A05D8993C000E3A53, 795 | 8B1E334B05D8993C000E3A53, 796 | 8B1E334C05D8993C000E3A53, 797 | 8B1E334D05D8993C000E3A53, 798 | 8BEC38CB05D9512D00533678, 799 | 8B05E99305D9A18A00228C57, 800 | 8B217FC805DC64CF008C95F4, 801 | 8B217FC905DC64CF008C95F4, 802 | 8B217FCA05DC64CF008C95F4, 803 | 8B5A777405DC6F9D003BD710, 804 | 8B5A777505DC6F9D003BD710, 805 | 8B5A777605DC6F9D003BD710, 806 | 8B5A777705DC6F9D003BD710, 807 | 8B5A77B705DC7172003BD710, 808 | 8BC18A4B05DDB1B100C152EB, 809 | 8BC18A4C05DDB1B100C152EB, 810 | 8BC18A4D05DDB1B100C152EB, 811 | 8BC18A4E05DDB1B100C152EB, 812 | 8BC18A4F05DDB1B100C152EB, 813 | 8BE4262605E0BE750019708C, 814 | 8BD4F72D05E20112003ECE09, 815 | 8B5F2DCB05E33CF600501878, 816 | ); 817 | isa = PBXResourcesBuildPhase; 818 | runOnlyForDeploymentPostprocessing = 0; 819 | }; 820 | 8D11072A0486CEB800E47090 = { 821 | fileRef = 29B97318FDCFA39411CA2CEA; 822 | isa = PBXBuildFile; 823 | settings = { 824 | }; 825 | }; 826 | 8D11072B0486CEB800E47090 = { 827 | fileRef = 089C165CFE840E0CC02AAC07; 828 | isa = PBXBuildFile; 829 | settings = { 830 | }; 831 | }; 832 | 8D11072C0486CEB800E47090 = { 833 | buildActionMask = 2147483647; 834 | files = ( 835 | 8D11072D0486CEB800E47090, 836 | 8BC21A8A05D881FF001C2B42, 837 | 8BEBC03505DAA11100534DBC, 838 | 8B8C911B05DAFB7200B25096, 839 | 8BC4A7F005DBF1630022CDB4, 840 | ); 841 | isa = PBXSourcesBuildPhase; 842 | runOnlyForDeploymentPostprocessing = 0; 843 | }; 844 | 8D11072D0486CEB800E47090 = { 845 | fileRef = 29B97316FDCFA39411CA2CEA; 846 | isa = PBXBuildFile; 847 | settings = { 848 | ATTRIBUTES = ( 849 | ); 850 | }; 851 | }; 852 | 8D11072E0486CEB800E47090 = { 853 | buildActionMask = 2147483647; 854 | files = ( 855 | 8D11072F0486CEB800E47090, 856 | ); 857 | isa = PBXFrameworksBuildPhase; 858 | runOnlyForDeploymentPostprocessing = 0; 859 | }; 860 | 8D11072F0486CEB800E47090 = { 861 | fileRef = 1058C7A1FEA54F0111CA2CBB; 862 | isa = PBXBuildFile; 863 | settings = { 864 | }; 865 | }; 866 | 8D1107310486CEB800E47090 = { 867 | fileEncoding = 4; 868 | isa = PBXFileReference; 869 | lastKnownFileType = text.plist; 870 | path = Info.plist; 871 | refType = 4; 872 | sourceTree = ""; 873 | }; 874 | 8D1107320486CEB800E47090 = { 875 | explicitFileType = wrapper.application; 876 | includeInIndex = 0; 877 | isa = PBXFileReference; 878 | path = Khronos.app; 879 | refType = 3; 880 | sourceTree = BUILT_PRODUCTS_DIR; 881 | }; 882 | }; 883 | rootObject = 29B97313FDCFA39411CA2CEA; 884 | } 885 | -------------------------------------------------------------------------------- /cuDateTime.m: -------------------------------------------------------------------------------- 1 | #import "cuDateTime.h" 2 | 3 | @implementation cuDateTime 4 | //Init Methods 5 | - (cuDateTime *)init 6 | { 7 | self = [super init]; 8 | 9 | [self setDataWithStrings:@"00/00/0000" time:@"00:00:00"]; 10 | 11 | return self; 12 | } 13 | 14 | - (cuDateTime *)initWithCurrentDateAndTime 15 | { 16 | self = [super init]; 17 | 18 | NSCalendarDate *tempCalendarDate = [NSCalendarDate calendarDate]; 19 | 20 | month = [tempCalendarDate monthOfYear]; 21 | day = [tempCalendarDate dayOfMonth]; 22 | year = [tempCalendarDate yearOfCommonEra]; 23 | 24 | hour = [tempCalendarDate hourOfDay]; 25 | minute = [tempCalendarDate minuteOfHour]; 26 | second = [tempCalendarDate secondOfMinute]; 27 | 28 | return self; 29 | } 30 | 31 | - (cuDateTime *)initWithStrings:(NSString *)dateString time:(NSString *)timeString 32 | { 33 | self = [super init]; 34 | 35 | [self setDataWithStrings:dateString time:timeString]; 36 | 37 | return self; 38 | } 39 | 40 | - (cuDateTime *)initWithStrings:(NSString *)dateString time:(NSString *)timeString timeFormat:(int)timeFormat 41 | { 42 | self = [super init]; 43 | 44 | //1 - regular 45 | //2 - twelve hour 46 | //3 - regular, no seconds 47 | //4 - twelve hour, no seconds 48 | 49 | NSMutableString *newTimeString = [[[NSMutableString alloc] init] autorelease]; 50 | [newTimeString setString:timeString]; 51 | 52 | if (timeFormat == 1) 53 | { 54 | [self setDataWithStrings:dateString time:timeString]; 55 | } 56 | if (timeFormat == 2) 57 | { 58 | [self setTimeWithTwelveHourString:newTimeString]; 59 | [self setDateWithString:dateString]; 60 | } 61 | if (timeFormat == 3) 62 | { 63 | [newTimeString appendString:@":00"]; 64 | [self setDataWithStrings:dateString time:newTimeString]; 65 | } 66 | if (timeFormat == 4) 67 | { 68 | [newTimeString insertString:@":00" atIndex:[newTimeString length] - 3]; 69 | [self setTimeWithTwelveHourString:newTimeString]; 70 | [self setDateWithString:dateString]; 71 | } 72 | 73 | return self; 74 | } 75 | 76 | - (cuDateTime *)initWithTimeString:(NSString *)timeString 77 | { 78 | self = [super init]; 79 | 80 | [self setTimeWithString:timeString]; 81 | 82 | return self; 83 | } 84 | 85 | - (cuDateTime *)initWithTwelveHourTimeString:(NSString*)timeString 86 | { 87 | self = [super init]; 88 | 89 | [self setTimeWithTwelveHourString:timeString]; 90 | 91 | return self; 92 | } 93 | 94 | //Getting Strings 95 | - (NSString *)getDateString 96 | { 97 | NSMutableString *tempDateString = [[[NSMutableString alloc] init] autorelease]; 98 | 99 | [tempDateString appendString:[[NSNumber numberWithInt:month] stringValue]]; 100 | [tempDateString appendString:@"/"]; 101 | [tempDateString appendString:[[NSNumber numberWithInt:day] stringValue]]; 102 | [tempDateString appendString:@"/"]; 103 | [tempDateString appendString:[[NSNumber numberWithInt:year] stringValue]]; 104 | 105 | return tempDateString; 106 | } 107 | 108 | - (NSString *)getTimeStringFor:(int)minutes 109 | { 110 | if( minutes == 1 ) return [self getTimeString:NO]; 111 | if( minutes == 15 ) return [self getFormattedTimeString:@"quarter"]; 112 | if( minutes == 30 ) return [self getFormattedTimeString:@"half"]; 113 | if( minutes == 60 ) return [self getFormattedTimeString:@"hour"]; 114 | return [self getTimeString]; 115 | } 116 | 117 | - (NSString *)getTimeString 118 | { 119 | NSMutableString *tempTimeString = [[[NSMutableString alloc] init] autorelease]; 120 | 121 | [tempTimeString appendString:[[NSNumber numberWithInt:hour] stringValue]]; 122 | [tempTimeString appendString:@":"]; 123 | if (minute < 10) [tempTimeString appendString:@"0"]; 124 | [tempTimeString appendString:[[NSNumber numberWithInt:minute] stringValue]]; 125 | [tempTimeString appendString:@":"]; 126 | if (second < 10) [tempTimeString appendString:@"0"]; 127 | [tempTimeString appendString:[[NSNumber numberWithInt:second] stringValue]]; 128 | 129 | return tempTimeString; 130 | } 131 | 132 | - (NSString *)getTimeString:(BOOL)withSeconds 133 | { 134 | NSMutableString *tempTimeString = [[[NSMutableString alloc] init] autorelease]; 135 | 136 | [tempTimeString appendString:[[NSNumber numberWithInt:hour] stringValue]]; 137 | [tempTimeString appendString:@":"]; 138 | if (minute < 10) [tempTimeString appendString:@"0"]; 139 | [tempTimeString appendString:[[NSNumber numberWithInt:minute] stringValue]]; 140 | 141 | if (withSeconds) 142 | { 143 | [tempTimeString appendString:@":"]; 144 | if (second < 10) [tempTimeString appendString:@"0"]; 145 | [tempTimeString appendString:[[NSNumber numberWithInt:second] stringValue]]; 146 | } 147 | 148 | return tempTimeString; 149 | } 150 | 151 | - (NSString *)getFormattedTimeString:(NSString *)formatter 152 | { 153 | NSMutableString *tempTimeString = [[[NSMutableString alloc] init] autorelease]; 154 | 155 | [tempTimeString appendString:[[NSNumber numberWithInt:hour] stringValue]]; 156 | 157 | if (![formatter isEqualTo:@"hour"]) 158 | { 159 | [tempTimeString appendString:@":"]; 160 | 161 | if ([formatter isEqualTo:@"quarter"]) 162 | { 163 | if (minute < 15) [tempTimeString appendString:@"00"]; 164 | else [tempTimeString appendString:[[NSNumber numberWithInt:(minute / 15) * 15] stringValue]]; 165 | } 166 | else if ([formatter isEqualTo:@"half"]) 167 | { 168 | if (minute < 30) [tempTimeString appendString:@"00"]; 169 | else [tempTimeString appendString:[[NSNumber numberWithInt:(minute / 30) * 30] stringValue]]; 170 | } 171 | } 172 | else 173 | [tempTimeString appendString:@"h"]; 174 | 175 | return tempTimeString; 176 | } 177 | 178 | - (NSString *)getTwelveHourTimeString 179 | { 180 | NSMutableString *tempTimeString = [[[NSMutableString alloc] init] autorelease]; 181 | BOOL isPM = NO; 182 | 183 | if (hour > 12) 184 | { 185 | [tempTimeString appendString:[[NSNumber numberWithInt:hour - 12] stringValue]]; 186 | isPM = YES; 187 | } 188 | else 189 | [tempTimeString appendString:[[NSNumber numberWithInt:hour] stringValue]]; 190 | 191 | [tempTimeString appendString:@":"]; 192 | if (minute < 10) [tempTimeString appendString:@"0"]; 193 | [tempTimeString appendString:[[NSNumber numberWithInt:minute] stringValue]]; 194 | [tempTimeString appendString:@":"]; 195 | if (second < 10) [tempTimeString appendString:@"0"]; 196 | [tempTimeString appendString:[[NSNumber numberWithInt:second] stringValue]]; 197 | 198 | if (isPM) 199 | [tempTimeString appendString:@" pm"]; 200 | else 201 | [tempTimeString appendString:@" am"]; 202 | 203 | return tempTimeString; 204 | } 205 | 206 | - (NSString *)getTwelveHourTimeString:(BOOL)withSeconds 207 | { 208 | NSMutableString *tempTimeString = [[[NSMutableString alloc] init] autorelease]; 209 | BOOL isPM = NO; 210 | 211 | if (hour > 12) 212 | { 213 | [tempTimeString appendString:[[NSNumber numberWithInt:hour - 12] stringValue]]; 214 | isPM = YES; 215 | } 216 | else 217 | [tempTimeString appendString:[[NSNumber numberWithInt:hour] stringValue]]; 218 | 219 | [tempTimeString appendString:@":"]; 220 | if (minute < 10) [tempTimeString appendString:@"0"]; 221 | [tempTimeString appendString:[[NSNumber numberWithInt:minute] stringValue]]; 222 | 223 | if (withSeconds) 224 | { 225 | [tempTimeString appendString:@":"]; 226 | if (second < 10) [tempTimeString appendString:@"0"]; 227 | [tempTimeString appendString:[[NSNumber numberWithInt:second] stringValue]]; 228 | } 229 | 230 | if (isPM) 231 | [tempTimeString appendString:@" pm"]; 232 | else 233 | [tempTimeString appendString:@" am"]; 234 | 235 | return tempTimeString; 236 | } 237 | 238 | - (NSString *)getFormattedTwelveHourTimeString:(NSString *)formatter 239 | { 240 | NSMutableString *tempTimeString = [[[NSMutableString alloc] init] autorelease]; 241 | BOOL isPM = NO; 242 | 243 | if (hour > 12) 244 | { 245 | [tempTimeString appendString:[[NSNumber numberWithInt:hour - 12] stringValue]]; 246 | isPM = YES; 247 | } 248 | else 249 | [tempTimeString appendString:[[NSNumber numberWithInt:hour] stringValue]]; 250 | 251 | if (![formatter isEqualTo:@"hour"]) 252 | { 253 | [tempTimeString appendString:@":"]; 254 | 255 | if ([formatter isEqualTo:@"quarter"]) 256 | { 257 | if (minute < 15) [tempTimeString appendString:@"00"]; 258 | else [tempTimeString appendString:[[NSNumber numberWithInt:(minute / 15) * 15] stringValue]]; 259 | } 260 | else if ([formatter isEqualTo:@"half"]) 261 | { 262 | if (minute < 30) [tempTimeString appendString:@"00"]; 263 | else [tempTimeString appendString:[[NSNumber numberWithInt:(minute / 30) * 30] stringValue]]; 264 | } 265 | } 266 | else 267 | [tempTimeString appendString:@"h"]; 268 | 269 | if (isPM) 270 | [tempTimeString appendString:@" pm"]; 271 | else 272 | [tempTimeString appendString:@" am"]; 273 | 274 | return tempTimeString; 275 | } 276 | 277 | //Setting Data 278 | - (void)setValues:(cuDateTime *)secondDateTime 279 | { 280 | year = [secondDateTime getYear]; 281 | month = [secondDateTime getMonth]; 282 | day = [secondDateTime getDay]; 283 | hour = [secondDateTime getHour]; 284 | minute = [secondDateTime getMinute]; 285 | second = [secondDateTime getSecond]; 286 | } 287 | 288 | - (void)setDataWithInts:(int)theYear month:(int)theMonth day:(int)theDay hour:(int)theHour minute:(int)theMinute second:(int)theSecond 289 | { 290 | year = theYear; 291 | month = theMonth; 292 | day = theDay; 293 | hour = theHour; 294 | minute = theMinute; 295 | second = theSecond; 296 | } 297 | - (void)setDataWithStrings:(NSString *)dateString time:(NSString *)timeString 298 | { 299 | int i = 0; 300 | int count = [dateString length]; 301 | int firstDateSeparater = -1; 302 | int secondDateSeparater = -1; 303 | 304 | while (i < count) 305 | { 306 | if ([dateString characterAtIndex:i] > 57 || [dateString characterAtIndex:i] < 48) 307 | { 308 | if (firstDateSeparater == -1) firstDateSeparater = i; 309 | else if (secondDateSeparater == -1) secondDateSeparater = i; 310 | } 311 | 312 | i++; 313 | } 314 | 315 | month = [[dateString substringToIndex:firstDateSeparater] intValue]; 316 | day = [[dateString substringWithRange:NSMakeRange(firstDateSeparater + 1, secondDateSeparater - firstDateSeparater - 1)] intValue]; 317 | year = [[dateString substringFromIndex:secondDateSeparater + 1] intValue]; 318 | 319 | int j = 0; 320 | int timeCount = [timeString length]; 321 | int firstColon = -1; 322 | int secondColon = -1; 323 | 324 | while (j < timeCount) 325 | { 326 | if ([timeString characterAtIndex:j] == ':') 327 | { 328 | if (firstColon == -1) firstColon = j; 329 | else if (secondColon == -1) secondColon = j; 330 | } 331 | 332 | j++; 333 | } 334 | 335 | hour = [[timeString substringToIndex:firstColon] intValue]; 336 | minute = [[timeString substringWithRange:NSMakeRange(firstColon + 1, secondColon - firstColon - 1)] intValue]; 337 | second = [[timeString substringFromIndex:secondColon + 1] intValue]; 338 | } 339 | 340 | - (void)setDateWithString:(NSString *)dateString 341 | { 342 | int i = 0; 343 | int count = [dateString length]; 344 | int firstDateSeparater = -1; 345 | int secondDateSeparater = -1; 346 | 347 | while (i < count) 348 | { 349 | if ([dateString characterAtIndex:i] > 57 || [dateString characterAtIndex:i] < 48) 350 | { 351 | if (firstDateSeparater == -1) firstDateSeparater = i; 352 | else if (secondDateSeparater == -1) secondDateSeparater = i; 353 | } 354 | 355 | i++; 356 | } 357 | 358 | month = [[dateString substringToIndex:firstDateSeparater] intValue]; 359 | day = [[dateString substringWithRange:NSMakeRange(firstDateSeparater + 1, secondDateSeparater - firstDateSeparater - 1)] intValue]; 360 | year = [[dateString substringFromIndex:secondDateSeparater + 1] intValue]; 361 | } 362 | 363 | - (void)setTimeWithString:(NSString *)timeString 364 | { 365 | int j = 0; 366 | int timeCount = [timeString length]; 367 | int firstColon = -1; 368 | int secondColon = -1; 369 | 370 | while (j < timeCount) 371 | { 372 | if ([timeString characterAtIndex:j] == ':') 373 | { 374 | if (firstColon == -1) firstColon = j; 375 | else if (secondColon == -1) secondColon = j; 376 | } 377 | 378 | j++; 379 | } 380 | 381 | hour = [[timeString substringToIndex:firstColon] intValue]; 382 | minute = [[timeString substringWithRange:NSMakeRange(firstColon + 1, secondColon - firstColon - 1)] intValue]; 383 | second = [[timeString substringFromIndex:secondColon + 1] intValue]; 384 | } 385 | 386 | - (void)setTimeWithTwelveHourString:(NSString *)timeString 387 | { 388 | int j = 0; 389 | int timeCount = [timeString length]; 390 | int firstColon = -1; 391 | int secondColon = -1; 392 | NSString *amPM; 393 | 394 | while (j < timeCount) 395 | { 396 | if ([timeString characterAtIndex:j] == ':') 397 | { 398 | if (firstColon == -1) firstColon = j; 399 | else if (secondColon == -1) secondColon = j; 400 | } 401 | 402 | j++; 403 | } 404 | 405 | hour = [[timeString substringToIndex:firstColon] intValue]; 406 | minute = [[timeString substringWithRange:NSMakeRange(firstColon + 1, secondColon - firstColon - 1)] intValue]; 407 | second = [[timeString substringWithRange:NSMakeRange(secondColon + 1, 2)] intValue]; 408 | 409 | amPM = [timeString substringFromIndex:secondColon + 4]; 410 | if ([amPM isEqualTo:@"pm"] || [amPM isEqualTo:@"PM"] || [amPM isEqualTo:@"pM"] || [amPM isEqualTo:@"PM"]) hour += 12; 411 | } 412 | 413 | //Getting Data 414 | - (int)getYear 415 | { 416 | return year; 417 | } 418 | 419 | - (int)getMonth 420 | { 421 | return month; 422 | } 423 | 424 | - (int)getDay 425 | { 426 | return day; 427 | } 428 | 429 | - (int)getHour 430 | { 431 | return hour; 432 | } 433 | 434 | - (int)getMinute 435 | { 436 | return minute; 437 | } 438 | 439 | - (int)getSecond 440 | { 441 | return second; 442 | } 443 | 444 | //Math 445 | - (NSComparisonResult)compare:(cuDateTime *)secondTime 446 | { 447 | if (year > [secondTime getYear]) 448 | return NSOrderedAscending; 449 | else if (year >= [secondTime getYear] && month > [secondTime getMonth]) 450 | return NSOrderedAscending; 451 | else if (year >= [secondTime getYear] && month >= [secondTime getMonth] && day > [secondTime getDay]) 452 | return NSOrderedAscending; 453 | else if (year >= [secondTime getYear] && month >= [secondTime getMonth] && day >= [secondTime getDay] && hour > [secondTime getHour]) 454 | return NSOrderedAscending; 455 | else if (year >= [secondTime getYear] && month >= [secondTime getMonth] && day >= [secondTime getDay] && hour >= [secondTime getHour] 456 | && minute > [secondTime getMinute]) 457 | return NSOrderedAscending; 458 | else if (year >= [secondTime getYear] && month >= [secondTime getMonth] && day >= [secondTime getDay] && hour >= [secondTime getHour] 459 | && minute >= [secondTime getMinute] && second > [secondTime getSecond]) 460 | return NSOrderedAscending; 461 | else if (year == [secondTime getYear] && month == [secondTime getMonth] && day == [secondTime getDay] && hour == [secondTime getHour] 462 | && minute == [secondTime getMinute] && second == [secondTime getSecond]) 463 | return NSOrderedSame; 464 | else return NSOrderedDescending; 465 | } 466 | 467 | - (void)updateToCurrent 468 | { 469 | NSCalendarDate *tempCalendarDate = [NSCalendarDate calendarDate]; 470 | 471 | month = [tempCalendarDate monthOfYear]; 472 | day = [tempCalendarDate dayOfMonth]; 473 | year = [tempCalendarDate yearOfCommonEra]; 474 | 475 | hour = [tempCalendarDate hourOfDay]; 476 | minute = [tempCalendarDate minuteOfHour]; 477 | second = [tempCalendarDate secondOfMinute]; 478 | } 479 | 480 | - (cuDateTime *)getTimeInterval:(cuDateTime *)secondTime 481 | { 482 | cuDateTime *timeInterval = [[[cuDateTime alloc] init] autorelease]; 483 | 484 | BOOL selfIsGreater = NO; 485 | int newYear = year; 486 | int newMonth = month; 487 | int newDay = day; 488 | int newHour = hour; 489 | int newMinute = minute; 490 | int newSecond = second; 491 | 492 | int dayOfYearSelf = 0; 493 | int dayOfYearSecond = 0; 494 | int dayOfYearList[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; 495 | 496 | if (year > [secondTime getYear]) 497 | selfIsGreater = YES; 498 | if (year >= [secondTime getYear] && month > [secondTime getMonth]) 499 | selfIsGreater = YES; 500 | if (year >= [secondTime getYear] && month >= [secondTime getMonth] && day > [secondTime getDay]) 501 | selfIsGreater = YES; 502 | if (year >= [secondTime getYear] && month >= [secondTime getMonth] && day >= [secondTime getDay] && hour > [secondTime getHour]) 503 | selfIsGreater = YES; 504 | if (year >= [secondTime getYear] && month >= [secondTime getMonth] && day >= [secondTime getDay] && 505 | hour >= [secondTime getHour] && minute > [secondTime getMinute]) 506 | selfIsGreater = YES; 507 | if (year >= [secondTime getYear] && month >= [secondTime getMonth] && day >= [secondTime getDay] && 508 | hour >= [secondTime getHour] && minute >= [secondTime getMinute] && second > [secondTime getSecond]) 509 | selfIsGreater = YES; 510 | 511 | dayOfYearSelf = dayOfYearList[newMonth - 1] + newDay; 512 | if (newYear % 4 == 0 && dayOfYearSelf > 59) dayOfYearSelf++; 513 | 514 | dayOfYearSecond = dayOfYearList[[secondTime getMonth] - 1] + [secondTime getDay]; 515 | if ([secondTime getYear] % 4 == 0 && dayOfYearSecond > 59) dayOfYearSecond++; 516 | 517 | if (selfIsGreater) 518 | { 519 | newYear -= [secondTime getYear]; 520 | 521 | dayOfYearSelf += 365 * newYear; 522 | dayOfYearSelf += (newYear % 4); 523 | 524 | dayOfYearSelf -= dayOfYearSecond; 525 | 526 | newSecond -= [secondTime getSecond]; 527 | if (newSecond < 0) 528 | { 529 | newMinute--; 530 | newSecond += 60; 531 | } 532 | 533 | newMinute -= [secondTime getMinute]; 534 | if (newMinute < 0) 535 | { 536 | newHour--; 537 | newMinute += 60; 538 | } 539 | 540 | newHour -= [secondTime getHour]; 541 | if (newHour < 0) 542 | { 543 | dayOfYearSelf--; 544 | newHour += 24; 545 | } 546 | 547 | newHour += dayOfYearSelf * 24; 548 | 549 | [timeInterval setDataWithInts:0 month:0 day:0 hour:newHour minute:newMinute second:newSecond]; 550 | } 551 | else 552 | { 553 | int secondSecond = [secondTime getSecond]; 554 | int secondMinute = [secondTime getMinute]; 555 | int secondHour = [secondTime getHour]; 556 | 557 | newYear = [secondTime getYear] - newYear; 558 | 559 | dayOfYearSecond += 365 * newYear; 560 | dayOfYearSelf += (newYear % 4); 561 | 562 | dayOfYearSecond -= dayOfYearSelf; 563 | 564 | secondSecond -= newSecond; 565 | if (secondSecond < 0) 566 | { 567 | secondMinute--; 568 | secondSecond += 60; 569 | } 570 | 571 | secondMinute -= newMinute; 572 | if (secondMinute < 0) 573 | { 574 | secondHour--; 575 | secondMinute += 60; 576 | } 577 | 578 | secondHour -= newHour; 579 | if (secondHour < 0) 580 | { 581 | dayOfYearSecond--; 582 | secondHour += 24; 583 | } 584 | 585 | secondHour += 24 * dayOfYearSecond; 586 | 587 | [timeInterval setDataWithInts:0 month:0 day:0 hour:secondHour minute:secondMinute second:secondSecond]; 588 | } 589 | 590 | return timeInterval; 591 | } 592 | 593 | - (cuDateTime *)addInterval:(cuDateTime *)timeToAdd 594 | { 595 | cuDateTime *newTimeInterval = [[[cuDateTime alloc] init] autorelease]; 596 | 597 | int newHour = hour; 598 | int newMinute = minute; 599 | int newSecond = second; 600 | 601 | newHour += [timeToAdd getHour]; 602 | newMinute += [timeToAdd getMinute]; 603 | newSecond += [timeToAdd getSecond]; 604 | 605 | if (newSecond > 59) 606 | { 607 | newMinute++; 608 | newSecond -= 60; 609 | } 610 | if (newMinute > 59) 611 | { 612 | newHour++; 613 | newMinute -= 60; 614 | } 615 | 616 | [newTimeInterval setDataWithInts:0 month:0 day:0 hour:newHour minute:newMinute second:newSecond]; 617 | 618 | return newTimeInterval; 619 | } 620 | 621 | - (cuDateTime *)subtractInterval:(cuDateTime *)timeToSubtract 622 | { 623 | cuDateTime *newTimeInterval = [[[cuDateTime alloc] init] autorelease]; 624 | 625 | int newHour = hour; 626 | int newMinute = minute; 627 | int newSecond = second; 628 | 629 | newHour -= [timeToSubtract getHour]; 630 | newMinute -= [timeToSubtract getMinute]; 631 | newSecond -= [timeToSubtract getSecond]; 632 | 633 | if (newSecond < 0) 634 | { 635 | newMinute--; 636 | newSecond += 60; 637 | } 638 | if (newMinute < 0) 639 | { 640 | newHour--; 641 | newMinute += 60; 642 | } 643 | 644 | [newTimeInterval setDataWithInts:0 month:0 day:0 hour:newHour minute:newMinute second:newSecond]; 645 | 646 | return newTimeInterval; 647 | } 648 | 649 | - (double)calculateCharges:(double)hourlyRate format:(NSString *)formatter 650 | { 651 | int newHour = hour; 652 | int newMinute = minute; 653 | int newSecond = second; 654 | 655 | if (![formatter isEqualTo:@"second"]) newSecond = 0; 656 | if ([formatter isEqualTo:@"quarter"]) newMinute = (newMinute / 15) * 15; 657 | if ([formatter isEqualTo:@"half"]) newMinute = (newMinute / 30) * 30; 658 | if ([formatter isEqualTo:@"hour"]) newMinute = 0; 659 | 660 | double charge = newHour * hourlyRate; 661 | charge += newMinute * hourlyRate / 60; 662 | charge += newSecond * hourlyRate / 3600; 663 | 664 | return charge; 665 | } 666 | 667 | - (void)addDays:(int)howMany 668 | { 669 | day += howMany; 670 | } 671 | 672 | //Checking Strings for Init Methods 673 | + (BOOL)checkStringForDate:(NSString *)theString 674 | { 675 | BOOL testBool = YES; 676 | 677 | int i = 0; 678 | int count = [theString length]; 679 | int firstSeparater = -1; 680 | int secondSeparater = -1; 681 | 682 | while (i < count) 683 | { 684 | if ([theString characterAtIndex:i] < 48 || [theString characterAtIndex:i] > 57) 685 | { 686 | if (firstSeparater == -1) firstSeparater = i; 687 | else if (secondSeparater == -1) secondSeparater = i; 688 | else testBool = NO; 689 | } 690 | 691 | i++; 692 | } 693 | 694 | if (firstSeparater != -1 && secondSeparater != -1) 695 | { 696 | int proposedMonth = [[theString substringToIndex:firstSeparater] intValue]; 697 | int proposedDay = [[theString substringWithRange:NSMakeRange(firstSeparater + 1, secondSeparater - firstSeparater - 1)] intValue]; 698 | int proposedYear = [[theString substringFromIndex:secondSeparater + 1] intValue]; 699 | int daysInMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 700 | 701 | if (proposedMonth > 12) testBool = NO; 702 | 703 | if (proposedDay > daysInMonth[proposedMonth - 1] && proposedMonth != 2) testBool = NO; 704 | else if (proposedDay > 28 && proposedYear % 4 != 0 && proposedMonth == 2) testBool = NO; 705 | else if (proposedDay > 29 && proposedYear % 4 == 0 && proposedMonth == 2) testBool = NO; 706 | } 707 | else 708 | testBool = NO; 709 | 710 | return testBool; 711 | } 712 | 713 | + (BOOL)checkStringForTime:(NSString *)theString 714 | { 715 | BOOL testBool = YES; 716 | 717 | int i = 0; 718 | int count = [theString length]; 719 | int firstColon = -1; 720 | int secondColon = -1; 721 | 722 | while (i < count) 723 | { 724 | if ([theString characterAtIndex:i] == ':' && firstColon == -1) firstColon = i; 725 | else if ([theString characterAtIndex:i] == ':' && secondColon == -1) secondColon = i; 726 | else if ([theString characterAtIndex:i] == ':' && secondColon != -1) testBool = NO; 727 | else if ([theString characterAtIndex:i] > 57 || [theString characterAtIndex:i] < 48) testBool = NO; 728 | 729 | i++; 730 | } 731 | 732 | if (secondColon - firstColon != 3) testBool = NO; 733 | if (firstColon == -1 || secondColon == -1) testBool = NO; 734 | 735 | return testBool; 736 | } 737 | 738 | + (BOOL)checkStringForTwelveHourTime:(NSString *)theString 739 | { 740 | BOOL testBool = YES; 741 | 742 | int i = 0; 743 | int count = [theString length]; 744 | int firstColon = -1; 745 | int secondColon = -1; 746 | 747 | while (i < count) 748 | { 749 | if ([theString characterAtIndex:i] == ':' && firstColon == -1) firstColon = i; 750 | else if ([theString characterAtIndex:i] == ':' && secondColon == -1) secondColon = i; 751 | else if ([theString characterAtIndex:i] == ':' && secondColon != -1) testBool = NO; 752 | else if ([theString characterAtIndex:i] > 57 || [theString characterAtIndex:i] < 48) 753 | { 754 | if (i < count - 3) testBool = NO; 755 | } 756 | 757 | i++; 758 | } 759 | 760 | if (secondColon - firstColon != 3) testBool = NO; 761 | if (firstColon == -1 || secondColon == -1) testBool = NO; 762 | if (![[theString substringFromIndex:count - 2] isEqualTo:@"am"] && ![[theString substringFromIndex:count - 3] isEqualTo:@"AM"] && 763 | ![[theString substringFromIndex:count - 2] isEqualTo:@"aM"] && ![[theString substringFromIndex:count - 3] isEqualTo:@"Am"] && 764 | ![[theString substringFromIndex:count - 2] isEqualTo:@"pm"] && ![[theString substringFromIndex:count - 3] isEqualTo:@"PM"] && 765 | ![[theString substringFromIndex:count - 2] isEqualTo:@"pM"] && ![[theString substringFromIndex:count - 3] isEqualTo:@"Pm"]) 766 | testBool = NO; 767 | 768 | return testBool; 769 | } 770 | 771 | + (BOOL)checkStringForTimeNoSeconds:(NSString *)theString 772 | { 773 | BOOL testBool = YES; 774 | 775 | int i = 0; 776 | int count = [theString length]; 777 | int firstColon = -1; 778 | 779 | while (i < count) 780 | { 781 | if ([theString characterAtIndex:i] == ':' && firstColon == -1) firstColon = i; 782 | else if ([theString characterAtIndex:i] == ':' && firstColon != -1) testBool = NO; 783 | else if ([theString characterAtIndex:i] > 57 || [theString characterAtIndex:i] < 48) testBool = NO; 784 | 785 | i++; 786 | } 787 | 788 | if (count - firstColon != 3) testBool = NO; 789 | if (firstColon == -1) testBool = NO; 790 | 791 | return testBool; 792 | } 793 | 794 | + (BOOL)checkStringForTwelveHourTimeNoSeconds:(NSString *)theString 795 | { 796 | BOOL testBool = YES; 797 | 798 | int i = 0; 799 | int count = [theString length]; 800 | int firstColon = -1; 801 | 802 | while (i < count) 803 | { 804 | if ([theString characterAtIndex:i] == ':' && firstColon == -1) firstColon = i; 805 | else if ([theString characterAtIndex:i] == ':' && firstColon != -1) testBool = NO; 806 | else if ([theString characterAtIndex:i] > 57 || [theString characterAtIndex:i] < 48) 807 | { 808 | if (i < count - 3) testBool = NO; 809 | } 810 | 811 | i++; 812 | } 813 | 814 | if (count - 3 - firstColon != 3) testBool = NO; 815 | if (firstColon == -1) testBool = NO; 816 | if (![[theString substringFromIndex:count - 2] isEqualTo:@"am"] && ![[theString substringFromIndex:count - 3] isEqualTo:@"AM"] && 817 | ![[theString substringFromIndex:count - 2] isEqualTo:@"aM"] && ![[theString substringFromIndex:count - 3] isEqualTo:@"Am"] && 818 | ![[theString substringFromIndex:count - 2] isEqualTo:@"pm"] && ![[theString substringFromIndex:count - 3] isEqualTo:@"PM"] && 819 | ![[theString substringFromIndex:count - 2] isEqualTo:@"pM"] && ![[theString substringFromIndex:count - 3] isEqualTo:@"Pm"]) 820 | testBool = NO; 821 | 822 | return testBool; 823 | } 824 | @end --------------------------------------------------------------------------------