Adding registration hooks. Could use a bit more work. #ifdefed out by default, and...
authorAlexander Strange <astrange@ithinksw.com>
Wed, 1 Jan 2003 04:16:33 +0000 (04:16 +0000)
committerAlexander Strange <astrange@ithinksw.com>
Wed, 1 Jan 2003 04:16:33 +0000 (04:16 +0000)
English.lproj/Preferences.nib/info.nib
English.lproj/Preferences.nib/objects.nib
English.lproj/Registration.nib/classes.nib [new file with mode: 0755]
English.lproj/Registration.nib/info.nib [new file with mode: 0755]
English.lproj/Registration.nib/objects.nib [new file with mode: 0755]
MenuTunes.m
RegController.h [new file with mode: 0755]
RegController.m [new file with mode: 0755]

index 28f5f51..15c28fe 100755 (executable)
@@ -3,9 +3,9 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>61 9 356 240 0 0 1152 746 </string>
+       <string>71 12 356 240 0 0 1280 938 </string>
        <key>IBFramework Version</key>
-       <string>286.0</string>
+       <string>291.0</string>
        <key>IBGroupedObjects</key>
        <dict>
                <key>0</key>
        </dict>
        <key>IBLastGroupID</key>
        <string>1</string>
-       <key>IBOpenObjects</key>
-       <array>
-               <integer>6</integer>
-               <integer>115</integer>
-       </array>
        <key>IBSystem Version</key>
-       <string>6F21</string>
+       <string>6G20</string>
 </dict>
 </plist>
index 0d547ec..9b65108 100755 (executable)
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 (executable)
index 0000000..5a0d60f
--- /dev/null
@@ -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 (executable)
index 0000000..4b48012
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>IBFramework Version</key>
+       <string>291.0</string>
+       <key>IBSystem Version</key>
+       <string>6G20</string>
+</dict>
+</plist>
diff --git a/English.lproj/Registration.nib/objects.nib b/English.lproj/Registration.nib/objects.nib
new file mode 100755 (executable)
index 0000000..44010d7
Binary files /dev/null and b/English.lproj/Registration.nib/objects.nib differ
index c09358a..b2f6e9e 100755 (executable)
@@ -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 (executable)
index 0000000..8e7815d
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ *     MenuTunes
+ *  StatusWindow
+ *    ...
+ *
+ *  Original Author : Alexander Strange <astrange@ithinksw.com>
+ *   Responsibility : Alexander Strange <astrange@ithinksw.com>
+ *
+ *  Copyright (c) 2002 iThink Software.
+ *  All Rights Reserved
+ *
+ */
+
+#ifdef REGISTRATION
+#import <Cocoa/Cocoa.h>
+#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 (executable)
index 0000000..9e1dada
--- /dev/null
@@ -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