2009-08-05 08:59:46 +00:00
|
|
|
/*
|
2010-01-01 20:11:34 +00:00
|
|
|
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
2009-08-05 08:59:46 +00:00
|
|
|
|
|
|
|
This software is licensed under the "HS" License as described in the "LICENSE" file,
|
|
|
|
which should be included with this package. The terms are also available at
|
|
|
|
http://www.hardcoded.net/licenses/hs_license
|
|
|
|
*/
|
|
|
|
|
2009-06-01 09:55:11 +00:00
|
|
|
#import "AppDelegate.h"
|
|
|
|
#import "ProgressController.h"
|
|
|
|
#import "RegistrationInterface.h"
|
|
|
|
#import "Utils.h"
|
|
|
|
#import "Consts.h"
|
|
|
|
|
|
|
|
@implementation AppDelegateBase
|
|
|
|
- (id)init
|
|
|
|
{
|
|
|
|
self = [super init];
|
|
|
|
_appName = @"";
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)unlockApp:(id)sender
|
|
|
|
{
|
|
|
|
if ([[self py] isRegistered])
|
|
|
|
return;
|
|
|
|
RegistrationInterface *ri = [[RegistrationInterface alloc] initWithApp:[self py] name:_appName limitDescription:LIMIT_DESC];
|
|
|
|
if ([ri enterCode] == NSOKButton)
|
|
|
|
{
|
2009-10-30 14:40:17 +00:00
|
|
|
NSString *menuTitle = [NSString stringWithFormat:@"Thanks for buying %@!",_appName];
|
2009-06-01 09:55:11 +00:00
|
|
|
[unlockMenuItem setTitle:menuTitle];
|
|
|
|
}
|
|
|
|
[ri release];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (PyDupeGuruBase *)py { return py; }
|
|
|
|
- (RecentDirectories *)recentDirectories { return recentDirectories; }
|
2009-11-02 15:16:34 +00:00
|
|
|
- (DetailsPanelBase *)detailsPanel { return nil; } // Virtual
|
2009-10-30 14:40:17 +00:00
|
|
|
|
|
|
|
/* Delegate */
|
|
|
|
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
|
|
|
{
|
|
|
|
[[ProgressController mainProgressController] setWorker:py];
|
|
|
|
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
|
|
|
//Restore Columns
|
|
|
|
NSArray *columnsOrder = [ud arrayForKey:@"columnsOrder"];
|
|
|
|
NSDictionary *columnsWidth = [ud dictionaryForKey:@"columnsWidth"];
|
|
|
|
if ([columnsOrder count])
|
|
|
|
[result restoreColumnsPosition:columnsOrder widths:columnsWidth];
|
|
|
|
else
|
|
|
|
[result resetColumnsToDefault:nil];
|
|
|
|
//Reg stuff
|
|
|
|
if ([RegistrationInterface showNagWithApp:[self py] name:_appName limitDescription:LIMIT_DESC])
|
|
|
|
[unlockMenuItem setTitle:[NSString stringWithFormat:@"Thanks for buying %@!",_appName]];
|
|
|
|
//Restore results
|
|
|
|
[py loadIgnoreList];
|
|
|
|
[py loadResults];
|
|
|
|
}
|
2009-06-01 09:55:11 +00:00
|
|
|
@end
|