@interface MainController(Private)
- (ITMTRemote *)loadRemote;
-- (void)timerUpdate;
- (void)setLatestSongIdentifier:(NSString *)newIdentifier;
- (void)applicationLaunched:(NSNotification *)note;
- (void)applicationTerminated:(NSNotification *)note;
globalPrefs = [[df persistentDomainForName:@".GlobalPreferences"] mutableCopy];
if (date) {
[globalPrefs setObject:date forKey:@"ITMTTrialStart"];
- [globalPrefs setObject:[NSNumber numberWithInt:1200] forKey:@"ITMTTrialVers"];
+ [globalPrefs setObject:[NSNumber numberWithInt:MT_CURRENT_VERSION] forKey:@"ITMTTrialVers"];
} else {
[globalPrefs removeObjectForKey:@"ITMTTrialStart"];
[globalPrefs removeObjectForKey:@"ITMTTrialVers"];
if (![self blingBling]) {
if ( (! [self getBlingTime] ) || ([now timeIntervalSinceDate:[self getBlingTime]] < 0) ) {
[self setBlingTime:now];
- } else if ([[[df persistentDomainForName:@".GlobalPreferences"] objectForKey:@"ITMTTrialVers"] intValue] < 1200) {
+ } else if ([[[df persistentDomainForName:@".GlobalPreferences"] objectForKey:@"ITMTTrialVers"] intValue] < MT_CURRENT_VERSION) {
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"];
+ [globalPrefs setObject:[NSNumber numberWithInt:MT_CURRENT_VERSION] forKey:@"ITMTTrialVers"];
[df setPersistentDomain:globalPrefs forName:@".GlobalPreferences"];
[df synchronize];
[globalPrefs release];
NSArray *scripts = [[NSFileManager defaultManager] directoryContentsAtPath:[NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/MenuTunes/Scripts"]];
NSEnumerator *scriptsEnum = [scripts objectEnumerator];
NSString *nextScript;
+ ITDebugLog(@"Running AppleScripts for song change.");
while ( (nextScript = [scriptsEnum nextObject]) ) {
NSDictionary *error;
NSAppleScript *currentScript = [[NSAppleScript alloc] initWithContentsOfURL:[NSURL fileURLWithPath:[[NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/MenuTunes/Scripts"] stringByAppendingPathComponent:nextScript]] error:&error];
+ NSLog(@"Running script: %@", nextScript);
if (!currentScript || ![currentScript executeAndReturnError:nil]) {
ITDebugLog(@"Error running script %@.", nextScript);
}
[super dealloc];
}
-@end
\ No newline at end of file
+@end