Status windows with buttons now scale properly.
authorKent Sutherland <ksuther@ithinksw.com>
Fri, 13 Feb 2004 00:08:27 +0000 (00:08 +0000)
committerKent Sutherland <ksuther@ithinksw.com>
Fri, 13 Feb 2004 00:08:27 +0000 (00:08 +0000)
Trials that are expired now get extended by 3 days.

MTBlingController.m
MainController.m
StatusWindow.m

index 8e9af92..a09be61 100755 (executable)
     if ( ! window ) {
         window = [MTShizzleWindow sharedWindowForSender:self];
     }
     if ( ! window ) {
         window = [MTShizzleWindow sharedWindowForSender:self];
     }
-
+    [NSApp activateIgnoringOtherApps:YES];
     [window center];
     [window center];
-    [window makeKeyAndOrderFront:nil];
+    [window orderFrontRegardless];
+    [window makeKeyWindow];
 //  [window setLevel:NSStatusWindowLevel];
 }
 
 //  [window setLevel:NSStatusWindowLevel];
 }
 
index bf3bda3..a543288 100755 (executable)
@@ -214,8 +214,10 @@ static MainController *sharedController;
     globalPrefs = [[df persistentDomainForName:@".GlobalPreferences"] mutableCopy];
     if (date) {
         [globalPrefs setObject:date forKey:@"ITMTTrialStart"];
     globalPrefs = [[df persistentDomainForName:@".GlobalPreferences"] mutableCopy];
     if (date) {
         [globalPrefs setObject:date forKey:@"ITMTTrialStart"];
+        [globalPrefs setObject:[NSNumber numberWithInt:1200] forKey:@"ITMTTrialVers"];
     } else {
         [globalPrefs removeObjectForKey:@"ITMTTrialStart"];
     } else {
         [globalPrefs removeObjectForKey:@"ITMTTrialStart"];
+        [globalPrefs removeObjectForKey:@"ITMTTrialVers"];
     }
     [df setPersistentDomain:globalPrefs forName:@".GlobalPreferences"];
     [df synchronize];
     }
     [df setPersistentDomain:globalPrefs forName:@".GlobalPreferences"];
     [df synchronize];
@@ -234,7 +236,20 @@ static MainController *sharedController;
     if (![self blingBling]) {
         if ( (! [self getBlingTime] ) || ([now timeIntervalSinceDate:[self getBlingTime]] < 0) ) {
             [self setBlingTime:now];
     if (![self blingBling]) {
         if ( (! [self getBlingTime] ) || ([now timeIntervalSinceDate:[self getBlingTime]] < 0) ) {
             [self setBlingTime:now];
+        } else if ([[[df persistentDomainForName:@".GlobalPreferences"] objectForKey:@"ITMTTrialVers"] intValue] < 1200) {
+            if ([now timeIntervalSinceDate:[self getBlingTime]] >= 345600) {
+                [self setBlingTime:[now addTimeInterval:-259200]];
+            } else {
+                NSMutableDictionary *globalPrefs;
+                [df synchronize];
+                globalPrefs = [[df persistentDomainForName:@".GlobalPreferences"] mutableCopy];
+                [globalPrefs setObject:[NSNumber numberWithInt:1200] forKey:@"ITMTTrialVers"];
+                [df setPersistentDomain:globalPrefs forName:@".GlobalPreferences"];
+                [df synchronize];
+                [globalPrefs release];
+            }
         }
         }
+        
         if ( ([now timeIntervalSinceDate:[self getBlingTime]] >= 604800) && (blinged != YES) ) {
             blinged = YES;
             [statusItem setEnabled:NO];
         if ( ([now timeIntervalSinceDate:[self getBlingTime]] >= 604800) && (blinged != YES) ) {
             blinged = YES;
             [statusItem setEnabled:NO];
index 8e88f47..ef0f878 100755 (executable)
 {
     if ( ! _locked ) {
 
 {
     if ( ! _locked ) {
 
+        float         divisor       = 1.0;
         float         textWidth     = 0.0;
         float         textHeight    = 0.0;
         float         okWidth       = 0.0;
         float         textWidth     = 0.0;
         float         textHeight    = 0.0;
         float         okWidth       = 0.0;
         NSArray      *lines         = [message componentsSeparatedByString:@"\n"];
         id                       oneLine       = nil;
         NSEnumerator *lineEnum      = [lines objectEnumerator];
         NSArray      *lines         = [message componentsSeparatedByString:@"\n"];
         id                       oneLine       = nil;
         NSEnumerator *lineEnum      = [lines objectEnumerator];
+        float         baseFontSize  = 18.0;
         ITTextField  *textField;
         ITButton     *okButton;
         ITButton     *cancelButton;
         NSColor      *textColor     = [NSColor whiteColor];
         ITTextField  *textField;
         ITButton     *okButton;
         ITButton     *cancelButton;
         NSColor      *textColor     = [NSColor whiteColor];
-        NSFont       *font          = [NSFont fontWithName:@"Lucida Grande Bold" size:18];
-        NSDictionary *attr          = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName];
-        NSFont       *buttonFont    = [NSFont fontWithName:@"Lucida Grande Bold" size:14];
-        NSDictionary *buttonAttr    = [NSDictionary dictionaryWithObjectsAndKeys:
+        NSFont       *font;
+        NSDictionary *attr;
+        NSFont       *buttonFont;
+        NSDictionary *buttonAttr;
+        
+        if ( _sizing == ITTransientStatusWindowSmall ) {
+            divisor = SMALL_DIVISOR;
+        } else if ( _sizing == ITTransientStatusWindowMini ) {
+            divisor = MINI_DIVISOR;
+        }
+        
+        font = [NSFont fontWithName:@"Lucida Grande Bold" size:(baseFontSize / divisor)];
+        attr = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName];
+        buttonFont = [NSFont fontWithName:@"Lucida Grande Bold" size:(14 / divisor)];
+        buttonAttr = [NSDictionary dictionaryWithObjectsAndKeys:
             buttonFont , NSFontAttributeName,
             textColor  , NSForegroundColorAttributeName, 
             nil];
             buttonFont , NSFontAttributeName,
             textColor  , NSForegroundColorAttributeName, 
             nil];