New: the highest first launch version is saved.

The effect is that each minor point release (3.1 -> 3.2) will cause the help to display the first time it is launched, so that the user is encouraged to find out what is new.
This commit is contained in:
Aparajita Fishman
2013-04-24 18:41:26 -04:00
parent 2104c838bd
commit 949af39041
3 changed files with 16 additions and 3 deletions
+14 -3
View File
@@ -66,9 +66,19 @@ AppController *SharedAppControllerInstance = nil;
self.statusMenu.delegate = self;
self.helpTextView.textContainerInset = NSMakeSize(10.0, 10.0);
if ([[NSUserDefaults standardUserDefaults] boolForKey:kDefaultFirstLaunch])
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
double firstLaunchVersion = [defaults doubleForKey:kDefaultFirstLaunchVersion];
// Note: the scanner will only get the major.minor version numbers, which is what we want.
NSScanner *scanner = [NSScanner scannerWithString:[self bundleVersion]];
double appVersion = 0.0;
[scanner scanDouble:&appVersion];
if ([defaults boolForKey:kDefaultFirstLaunch] || appVersion > firstLaunchVersion)
{
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:kDefaultFirstLaunch];
[defaults setBool:NO forKey:kDefaultFirstLaunch];
[defaults setDouble:appVersion forKey:kDefaultFirstLaunchVersion];
[self openHelp:self];
}
@@ -96,6 +106,7 @@ AppController *SharedAppControllerInstance = nil;
NSDictionary *appDefaults = @{
kDefaultLastEventId: [NSNumber numberWithUnsignedLongLong:kFSEventStreamEventIdSinceNow],
kDefaultFirstLaunch: @YES,
kDefaultFirstLaunchVersion: @2.0,
kDefaultXCCAPIMode: [NSNumber numberWithInt:kXCCAPIModeAuto],
kDefaultXCCReactMode: @YES,
kDefaultXCCReopenLastProject: @YES,
@@ -348,7 +359,7 @@ AppController *SharedAppControllerInstance = nil;
- (NSString *)bundleVersion
{
return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
}
@end
+1
View File
@@ -13,6 +13,7 @@
extern NSString * const kDefaultLastEventId;
extern NSString * const kDefaultFirstLaunch;
extern NSString * const kDefaultFirstLaunchVersion;
extern NSString * const kDefaultXCCAPIMode;
extern NSString * const kDefaultXCCReactMode;
extern NSString * const kDefaultXCCReopenLastProject;
+1
View File
@@ -11,6 +11,7 @@
NSString * const kDefaultLastEventId = @"lastEventId";
NSString * const kDefaultFirstLaunch = @"FirstLaunch";
NSString * const kDefaultFirstLaunchVersion = @"firstLaunchVersion";
NSString * const kDefaultXCCAPIMode = @"XCCAPIMode";
NSString * const kDefaultXCCReactMode = @"XCCReactMode";
NSString * const kDefaultXCCReopenLastProject = @"XCCReopenLastProject";