Created
November 23, 2011 12:58
-
-
Save pilky/1388608 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)sendDetails { | |
if ([self _shouldShowPrompt]) { | |
[permissionPromptController showWindow:self]; | |
} else { | |
[submitter submitDetails]; | |
} | |
} | |
- (BOOL)_shouldShowPrompt { | |
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; | |
//Do we have a URL set? | |
if (![[NSBundle mainBundle] objectForInfoDictionaryKey:TWSProfileURL]) | |
return NO; | |
//If sparkle exists, has it done its setup yet? | |
if ([[NSBundle mainBundle] objectForInfoDictionaryKey:@"SUFeedURL"]) { | |
if (![defaults boolForKey:@"SUHasLaunchedBefore"]) | |
return NO; | |
} | |
//Have we launched before | |
if (![defaults boolForKey:TWSHasLaunchedBefore]) { | |
[defaults setBool:YES forKey:TWSHasLaunchedBefore]; | |
return NO; | |
} | |
//Have we already asked the question? | |
if ([defaults objectForKey:TWSSendSystemProfile]) | |
return NO; | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment