Changeset 331


Ignore:
Timestamp:
08/06/07 21:55:03 (17 years ago)
Author:
Nicholas Riley
Message:

AntiRSI.[hm]: Reset all timers on session reset. Display hours in session time correctly. Use Myriad only if available.

MainMenu.nib: Use Helvetica Neue if Myriad is unavailable. Fix initial first responder in preferences window.

Location:
trunk/Cocoa/AntiRSI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cocoa/AntiRSI/AntiRSI.h

    r330 r331  
    126126- (void)tick:(NSTimer *)timer;
    127127
     128// reset all timers
     129- (void)resetTimers;
     130
    128131// draw the dock icon
    129132- (void)drawDockImage;
  • trunk/Cocoa/AntiRSI/AntiRSI.m

    r330 r331  
    114114// end of bindings
    115115
    116 - (void)awakeFromNib
    117 {
    118         // want transparancy
    119         [NSColor setIgnoresAlpha:NO];
    120        
    121         // initial colors
    122         elapsed = [[NSColor colorWithCalibratedRed:0.3 green:0.3 blue:0.9 alpha:0.95] retain];
    123         taking = [[NSColor colorWithCalibratedRed:0.3 green:0.9 blue:0.3 alpha:0.90] retain];
    124         background = [NSColor colorWithCalibratedRed:0.9 green:0.9 blue:0.9 alpha:0.7];
    125        
    126         //initial values
    127         micro_pause_period = 4*60;
    128         micro_pause_duration = 13;
    129         work_break_period = 50*60;
    130         work_break_duration = 8*60;
    131         sample_interval = 1;
    132        
    133         // set current state
    134         state = s_normal;
    135        
     116- (void)resetTimers;
     117{
    136118        // set timers to 0
    137119        micro_pause_t = 0;
     
    141123        work_break_taking_cached_t = 0;
    142124        work_break_taking_cached_date = 0;
     125    session_t = 0;
     126}
     127
     128- (void)awakeFromNib
     129{
     130        // want transparancy
     131        [NSColor setIgnoresAlpha:NO];
     132       
     133        // initial colors
     134        elapsed = [[NSColor colorWithCalibratedRed:0.3 green:0.3 blue:0.9 alpha:0.95] retain];
     135        taking = [[NSColor colorWithCalibratedRed:0.3 green:0.9 blue:0.3 alpha:0.90] retain];
     136        background = [NSColor colorWithCalibratedRed:0.9 green:0.9 blue:0.9 alpha:0.7];
     137       
     138        //initial values
     139        micro_pause_period = 4*60;
     140        micro_pause_duration = 13;
     141        work_break_period = 50*60;
     142        work_break_duration = 8*60;
     143        sample_interval = 1;
     144       
     145        // set current state
     146        state = s_normal;
     147    [self resetTimers];
    143148       
    144149        // initialize dock image
     
    161166        [main_window setContentView:view];
    162167    [progress setEnabled:NO];
     168    NSFont *myriad = [NSFont fontWithName: @"Myriad" size: 40];
     169    if (myriad) [status setFont: myriad];
    163170       
    164171        // initialze history filter
     
    523530- (NSString *)sessionTimeString;
    524531{
    525     return [NSString stringWithFormat:@"Session: %d:%02d:%02d", (int)session_t / 3600, (int)session_t / 60, lrint(session_t) % 60];
     532    return [NSString stringWithFormat:@"Session: %d:%02d:%02d", (int)session_t / 3600,
     533        ((int)session_t / 60) % 60, lrint(session_t) % 60];
    526534}
    527535
     
    616624        [self endBreak];
    617625    }
    618     session_t = 0;
     626    [self resetTimers];
    619627}
    620628
  • trunk/Cocoa/AntiRSI/English.lproj/MainMenu.nib/info.nib

    r330 r331  
    2121        <array>
    2222                <integer>21</integer>
     23                <integer>259</integer>
    2324        </array>
    2425        <key>IBSystem Version</key>
Note: See TracChangeset for help on using the changeset viewer.