From: Joseph Spiros Date: Wed, 1 Oct 2003 23:06:22 +0000 (+0000) Subject: Fixing bug that would require users to restart MenuTunes when they enter X-Git-Tag: v1.0~12 X-Git-Url: http://git.ithinksw.org/MenuTunes.git/commitdiff_plain/955343cfbfebf6b68b127629d9b6a76f80ba023a Fixing bug that would require users to restart MenuTunes when they enter their key after the trial period is over. --- diff --git a/MTBlingController.m b/MTBlingController.m index e9b8ce2..7541747 100755 --- a/MTBlingController.m +++ b/MTBlingController.m @@ -8,6 +8,7 @@ #import "MTBlingController.h" #import "MTeSerialNumber.h" +#import "MainController.h" #define APP_SUPPORT_PATH_STRING [@"~/Library/Application Support/MenuTunes/" stringByExpandingTildeInPath] #define LICENSE_PATH_STRING [APP_SUPPORT_PATH_STRING stringByAppendingString:@"/.license"] @@ -115,7 +116,7 @@ nil, nil, nil, NSLocalizedString(@"failed_msg", @"Failed Message")); } - + [[MainController sharedController] blingTime]; } - (int)checkKeyFile diff --git a/MainController.h b/MainController.h index 5675471..c2c73ba 100755 --- a/MainController.h +++ b/MainController.h @@ -41,12 +41,14 @@ MTBlingController *bling; NSTimer *registerTimer; BOOL timerUpdating; + BOOL blinged; } + (MainController *)sharedController; - (void)menuClicked; //Methods called from MenuController by menu items +- (NSDate*)getBlingTime; - (void)blingTime; - (void)blingNow; - (BOOL)blingBling; diff --git a/MainController.m b/MainController.m index a9ea365..b695d80 100755 --- a/MainController.m +++ b/MainController.m @@ -41,6 +41,7 @@ static MainController *sharedController; menuController = [[MenuController alloc] init]; df = [[NSUserDefaults standardUserDefaults] retain]; timerUpdating = NO; + blinged = NO; } return self; } @@ -182,18 +183,29 @@ static MainController *sharedController; if ( (! [self getBlingTime] ) || ([now timeIntervalSinceDate:[self getBlingTime]] < 0) ) { [self setBlingTime:now]; } - if ( ([now timeIntervalSinceDate:[self getBlingTime]] >= 604800) ) { + if ( ([now timeIntervalSinceDate:[self getBlingTime]] >= 604800) && (blinged != YES) ) { + blinged = YES; [statusItem setEnabled:NO]; [self clearHotKeys]; if ([refreshTimer isValid]) { [refreshTimer invalidate]; } - if ([registerTimer isValid]) { - [registerTimer invalidate]; - } [statusWindowController showRegistrationQueryWindow]; } } else { + if (blinged) { + [statusItem setEnabled:YES]; + [self setupHotKeys]; + if (![refreshTimer isValid]) { + [refreshTimer release]; + refreshTimer = refreshTimer = [[NSTimer scheduledTimerWithTimeInterval:0.5 + target:self + selector:@selector(timerUpdate) + userInfo:nil + repeats:YES] retain]; + } + blinged = NO; + } [self setBlingTime:nil]; } }