Fixing some more registration bugs...
authorJoseph Spiros <joseph.spiros@ithinksw.com>
Wed, 1 Oct 2003 21:50:42 +0000 (21:50 +0000)
committerJoseph Spiros <joseph.spiros@ithinksw.com>
Wed, 1 Oct 2003 21:50:42 +0000 (21:50 +0000)
MTBlingController.m
MainController.m
MenuController.m

index d270412..638a2f1 100755 (executable)
@@ -82,7 +82,7 @@
                                                                    name:o
                                                                   extra:nil
                                                               publisher:@"04611"] autorelease];
                                                                    name:o
                                                                   extra:nil
                                                               publisher:@"04611"] autorelease];
-    if ( [s isValid] == ITeSerialNumberIsValid && ( [[s infoDictionary] objectForKey:@"appIdentifier"] == @"MT" ) ) {
+    if ( ([s isValid] == ITeSerialNumberIsValid) && ( [[[s infoDictionary] objectForKey:@"appIdentifier"] isEqualToString:@"MT"] ) ) {
     
         NSFileManager *fm = [NSFileManager defaultManager];
         
     
         NSFileManager *fm = [NSFileManager defaultManager];
         
     MTeSerialNumber *k = [[[MTeSerialNumber alloc] initWithContentsOfFile:p
                                                                     extra:@""
                                                                 publisher:@"04611"] autorelease];
     MTeSerialNumber *k = [[[MTeSerialNumber alloc] initWithContentsOfFile:p
                                                                     extra:@""
                                                                 publisher:@"04611"] autorelease];
-    if ( k && [k isValid] == ITeSerialNumberIsValid && ( [[k infoDictionary] objectForKey:@"appIdentifier"] == @"MT" )) {
+    if ( k && ([k isValid] == ITeSerialNumberIsValid) && ( [[[k infoDictionary] objectForKey:@"appIdentifier"] isEqualToString:@"MT"] )) {
         return 7465;
     } else {
         [[NSFileManager defaultManager] removeFileAtPath:p handler:nil];
         return 7465;
     } else {
         [[NSFileManager defaultManager] removeFileAtPath:p handler:nil];
index 5f25c09..a9ea365 100755 (executable)
@@ -159,7 +159,11 @@ static MainController *sharedController;
     NSMutableDictionary *globalPrefs;
     [df synchronize];
     globalPrefs = [[df persistentDomainForName:@".GlobalPreferences"] mutableCopy];
     NSMutableDictionary *globalPrefs;
     [df synchronize];
     globalPrefs = [[df persistentDomainForName:@".GlobalPreferences"] mutableCopy];
-    [globalPrefs setObject:date forKey:@"ITMTTrialStart"];
+    if (date) {
+        [globalPrefs setObject:date forKey:@"ITMTTrialStart"];
+    } else {
+        [globalPrefs removeObjectForKey:@"ITMTTrialStart"];
+    }
     [df setPersistentDomain:globalPrefs forName:@".GlobalPreferences"];
     [df synchronize];
     [globalPrefs release];
     [df setPersistentDomain:globalPrefs forName:@".GlobalPreferences"];
     [df synchronize];
     [globalPrefs release];
@@ -174,19 +178,23 @@ static MainController *sharedController;
 - (void)blingTime
 {
     NSDate *now = [NSDate date];
 - (void)blingTime
 {
     NSDate *now = [NSDate date];
-    if ( (! [self getBlingTime] ) || ([now timeIntervalSinceDate:[self getBlingTime]] < 0) ) {
-        [self setBlingTime:now];
-    }
-    if ( ([now timeIntervalSinceDate:[self getBlingTime]] >= 604800) ) {
-        [statusItem setEnabled:NO];
-        [self clearHotKeys];
-        if ([refreshTimer isValid]) {
-        [refreshTimer invalidate];
+    if (![self blingBling]) {
+        if ( (! [self getBlingTime] ) || ([now timeIntervalSinceDate:[self getBlingTime]] < 0) ) {
+            [self setBlingTime:now];
         }
         }
-        if ([registerTimer isValid]) {
-        [registerTimer invalidate];
+        if ( ([now timeIntervalSinceDate:[self getBlingTime]] >= 604800) ) {
+            [statusItem setEnabled:NO];
+            [self clearHotKeys];
+            if ([refreshTimer isValid]) {
+                [refreshTimer invalidate];
+            }
+            if ([registerTimer isValid]) {
+                [registerTimer invalidate];
+            }
+            [statusWindowController showRegistrationQueryWindow];
         }
         }
-        [statusWindowController showRegistrationQueryWindow];
+    } else {
+        [self setBlingTime:nil];
     }
 }
 
     }
 }
 
index 4b56594..774d062 100755 (executable)
             [tempItem setTag:MTMenuPreferencesItem];
             [tempItem setTarget:self];
         } else if ([nextObject isEqualToString:@"quit"]) {
             [tempItem setTag:MTMenuPreferencesItem];
             [tempItem setTarget:self];
         } else if ([nextObject isEqualToString:@"quit"]) {
-            ITDebugLog(@"Add \"Quit\" menu item.");
             if ([[MainController sharedController] blingBling] == NO) {
                 ITDebugLog(@"Add \"Register MenuTunes...\" menu item.");
                 tempItem = [menu addItemWithTitle:NSLocalizedString(@"register", @"Register MenuTunes...") action:@selector(performMainMenuAction:) keyEquivalent:@""];
                 [tempItem setTag:MTMenuRegisterItem];
                 [tempItem setTarget:self];
             }
             if ([[MainController sharedController] blingBling] == NO) {
                 ITDebugLog(@"Add \"Register MenuTunes...\" menu item.");
                 tempItem = [menu addItemWithTitle:NSLocalizedString(@"register", @"Register MenuTunes...") action:@selector(performMainMenuAction:) keyEquivalent:@""];
                 [tempItem setTag:MTMenuRegisterItem];
                 [tempItem setTarget:self];
             }
+            ITDebugLog(@"Add \"Quit\" menu item.");
             tempItem = [menu addItemWithTitle:NSLocalizedString(@"quit", @"Quit")
                     action:@selector(performMainMenuAction:)
                     keyEquivalent:@""];
             tempItem = [menu addItemWithTitle:NSLocalizedString(@"quit", @"Quit")
                     action:@selector(performMainMenuAction:)
                     keyEquivalent:@""];