-- (void) applicationDidFinishLaunching:(id)unused {
- window_ = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
- [window_ makeKeyAndVisible];
-
- plist_ = [[NSString stringWithFormat:@"%@/Library/Preferences/com.saurik.WinterBoard.plist",
- NSHomeDirectory()
- ] retain];
-
- settings_ = [[NSMutableDictionary alloc] initWithContentsOfFile:plist_];
- if (settings_ == nil)
- settings_ = [[NSMutableDictionary alloc] initWithCapacity:16];
-
- themesArray_ = [settings_ objectForKey:@"Themes"];
- if (themesArray_ == nil) {
- if (NSString *theme = [settings_ objectForKey:@"Theme"]) {
- themesArray_ = [[NSArray arrayWithObject:[[NSDictionary dictionaryWithObjectsAndKeys:
- theme, @"Name",
- [NSNumber numberWithBool:YES], @"Active",
- nil] mutableCopy]] mutableCopy];
-
- [settings_ removeObjectForKey:@"Theme"];
- }
-
- if (themesArray_ == nil)
- themesArray_ = [NSMutableArray arrayWithCapacity:16];
- [settings_ setObject:themesArray_ forKey:@"Themes"];
+- (id) topViewController {
+ if ([[PSRootController class] instancesRespondToSelector:@selector(topViewController)]) {
+ return [super topViewController];
+ } else {
+ return [super lastController];