Skip to content

Commit

Permalink
Added the welcome popup on first launch, and updated LICENSE.
Browse files Browse the repository at this point in the history
  • Loading branch information
chpwn committed Dec 23, 2009
1 parent 2a0a54a commit 454285c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,5 +1,5 @@
ProSwitcher, an application switcher for iPhone OS
Copyright (C) 2009 Ryan Petrich
Copyright (C) 2009 Ryan Petrich and Grant Paul

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down
18 changes: 18 additions & 0 deletions PSWViewController.m
Expand Up @@ -405,6 +405,23 @@ static void PreferenceChangedCallback(CFNotificationCenterRef center, void *obse
CHSuper1(SBUIController, restoreIconList, unknown);
}

CHMethod0(void, SBUIController, finishLaunching)
{
NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:PSWPreferencesFilePath];

BOOL value = [[plistDict objectForKey:@"PSWAlert"] boolValue];
if (!value) {
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Welcome to ProSwitcher" message:@"To change settings or to setup launching in *any* app, go to the Settings app. Otherwise, tap the ProSwitcher icon to activate.\n\nProSwitcher is (c) 2009 Ryan Petrich and Grant Paul, released under the LGPL." delegate:self cancelButtonTitle:nil otherButtonTitles:@"Continue", nil] autorelease];
[alert show];

[plistDict setObject:[NSNumber numberWithBool:YES] forKey:@"PSWAlert"];
[plistDict writeToFile:PSWPreferencesFilePath atomically:YES];
}
[plistDict release];

CHSuper0(SBUIController, finishLaunching);
}

#pragma mark SpringBoard
CHMethod0(void, SpringBoard, _handleMenuButtonEvent)
{
Expand Down Expand Up @@ -523,6 +540,7 @@ static CGAffineTransform TransformRectToRect(CGRect sourceRect, CGRect targetRec
CHLoadLateClass(SBUIController);
CHHook1(SBUIController, restoreIconList);
CHHook3(SBUIController, animateApplicationActivation, animateDefaultImage, scatterIcons);
CHHook0(SBUIController, finishLaunching);
CHLoadLateClass(SBApplicationController);
CHLoadLateClass(SBIconModel);
CHLoadLateClass(SpringBoard);
Expand Down

0 comments on commit 454285c

Please sign in to comment.