+- (void)setBlingTime:(NSDate*)date
+{
+ NSMutableDictionary *globalPrefs;
+ [df synchronize];
+ globalPrefs = [[df persistentDomainForName:@".GlobalPreferences"] mutableCopy];
+ if (date) {
+ [globalPrefs setObject:date forKey:@"ITMTTrialStart"];
+ } else {
+ [globalPrefs removeObjectForKey:@"ITMTTrialStart"];
+ }
+ [df setPersistentDomain:globalPrefs forName:@".GlobalPreferences"];
+ [df synchronize];
+ [globalPrefs release];
+}
+
+- (NSDate*)getBlingTime
+{
+ [df synchronize];
+ return [[df persistentDomainForName:@".GlobalPreferences"] objectForKey:@"ITMTTrialStart"];
+}
+
+- (void)blingTime
+{
+ NSDate *now = [NSDate date];
+ if (![self blingBling]) {
+ if ( (! [self getBlingTime] ) || ([now timeIntervalSinceDate:[self getBlingTime]] < 0) ) {
+ [self setBlingTime:now];
+ }
+ if ( ([now timeIntervalSinceDate:[self getBlingTime]] >= 604800) && (blinged != YES) ) {
+ blinged = YES;
+ [statusItem setEnabled:NO];
+ [self clearHotKeys];
+ if ([refreshTimer isValid]) {
+ [refreshTimer 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];
+ }
+}
+
+- (void)blingNow
+{
+ [bling showPanel];
+}
+
+- (BOOL)blingBling
+{
+ if ( ! ([bling checkDone] == 2475) ) {
+ return NO;
+ } else {
+ return YES;
+ }
+}
+