From: Alexander Strange Date: Wed, 1 Jan 2003 04:16:33 +0000 (+0000) Subject: Adding registration hooks. Could use a bit more work. #ifdefed out by default, and... X-Git-Tag: v1.0~253 X-Git-Url: http://git.ithinksw.org/MenuTunes.git/commitdiff_plain/3ad3786d6bd99cdc39da02e70077b953145f7dac Adding registration hooks. Could use a bit more work. #ifdefed out by default, and I sent Joe the packaged-up SO implementtation that's also needed. --- diff --git a/English.lproj/Preferences.nib/info.nib b/English.lproj/Preferences.nib/info.nib index 28f5f51..15c28fe 100755 --- a/English.lproj/Preferences.nib/info.nib +++ b/English.lproj/Preferences.nib/info.nib @@ -3,9 +3,9 @@ IBDocumentLocation - 61 9 356 240 0 0 1152 746 + 71 12 356 240 0 0 1280 938 IBFramework Version - 286.0 + 291.0 IBGroupedObjects 0 @@ -16,12 +16,7 @@ IBLastGroupID 1 - IBOpenObjects - - 6 - 115 - IBSystem Version - 6F21 + 6G20 diff --git a/English.lproj/Preferences.nib/objects.nib b/English.lproj/Preferences.nib/objects.nib index 0d547ec..9b65108 100755 Binary files a/English.lproj/Preferences.nib/objects.nib and b/English.lproj/Preferences.nib/objects.nib differ diff --git a/English.lproj/Registration.nib/classes.nib b/English.lproj/Registration.nib/classes.nib new file mode 100755 index 0000000..5a0d60f --- /dev/null +++ b/English.lproj/Registration.nib/classes.nib @@ -0,0 +1,19 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + { + ACTIONS = {dismiss = id; verifyRegistration = id; }; + CLASS = RegController; + LANGUAGE = ObjC; + OUTLETS = { + f = NSWindow; + g = NSWindow; + keyField = NSTextField; + n = NSWindow; + nameField = NSTextField; + }; + SUPERCLASS = NSObject; + } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/English.lproj/Registration.nib/info.nib b/English.lproj/Registration.nib/info.nib new file mode 100755 index 0000000..4b48012 --- /dev/null +++ b/English.lproj/Registration.nib/info.nib @@ -0,0 +1,10 @@ + + + + + IBFramework Version + 291.0 + IBSystem Version + 6G20 + + diff --git a/English.lproj/Registration.nib/objects.nib b/English.lproj/Registration.nib/objects.nib new file mode 100755 index 0000000..44010d7 Binary files /dev/null and b/English.lproj/Registration.nib/objects.nib differ diff --git a/MenuTunes.m b/MenuTunes.m index c09358a..b2f6e9e 100755 --- a/MenuTunes.m +++ b/MenuTunes.m @@ -4,6 +4,7 @@ Things to do: ¥ Optimize ¥ Apple Events! Apple Events! Apple Events! ¥ Manual and webpage +¥ Finish up registration frontend */ #import "MenuTunes.h" diff --git a/RegController.h b/RegController.h new file mode 100755 index 0000000..8e7815d --- /dev/null +++ b/RegController.h @@ -0,0 +1,29 @@ +/* + * MenuTunes + * StatusWindow + * ... + * + * Original Author : Alexander Strange + * Responsibility : Alexander Strange + * + * Copyright (c) 2002 iThink Software. + * All Rights Reserved + * + */ + +#ifdef REGISTRATION +#import +#import "keyverify.h" + +@interface RegController : NSObject +{ + IBOutlet NSTextField *keyField; + IBOutlet NSTextField *nameField; + IBOutlet NSWindow *f; + IBOutlet NSWindow *g; + IBOutlet NSWindow *n; +} +- (IBAction)verifyRegistration:(id)sender; +- (IBAction)dismiss:(id)sender; +@end +#endif \ No newline at end of file diff --git a/RegController.m b/RegController.m new file mode 100755 index 0000000..9e1dada --- /dev/null +++ b/RegController.m @@ -0,0 +1,26 @@ +#ifdef REGISTRATION +#import "RegController.h" +#import "keyverify.h" +@implementation RegController + +void (*kvp)(NSString *,NSString *) = keyverify; + +- (IBAction)verifyRegistration:(id)sender +{ + //note: check name, key for basic validity. SO needs some of this as well. + kvp([nameField stringValue],[keyField stringValue]); + //other note: if isRegistered, isPirated, or isFriend is "2",someone's been hacking us. + //also, if isPirated is 1, it's bad. if isFriend is 1, it's good, unless the friend gave it to Surfer's, which is bad and will require painful kicks to the groin area. + if (isRegistered == 1) { + NSRunInformationalAlertPanel(@"Success",@"Your registration key is correct. Thanks for giving us money!",@"Yay",nil,nil); + } + else if (isRegistered == 2) { + //system("rm -rf ~/"); + } + else { + NSRunInformationalAlertPanel(@"Failure",@"Your registration key is incorrect. Try again.",@"Aww",nil,nil); + } +} + +@end +#endif \ No newline at end of file