Permalink
Browse files

finished test client for what I need it to do

  • Loading branch information...
1 parent 01a7839 commit bdda15a5cc9c110471df165b3ae8bc0d94aa35bb Owen Evans committed Feb 23, 2009
@@ -265,6 +265,26 @@
<int key="NSPeriodicInterval">25</int>
</object>
</object>
+ <object class="NSButton" id="310199765">
+ <reference key="NSNextResponder" ref="560574705"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{334, 12}, {96, 32}}</string>
+ <reference key="NSSuperview" ref="560574705"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="746171221">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">Next</string>
+ <reference key="NSSupport" ref="312662123"/>
+ <reference key="NSControlView" ref="310199765"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
</object>
<string key="NSFrameSize">{434, 338}</string>
<reference key="NSSuperview"/>
@@ -338,6 +358,14 @@
</object>
<int key="connectionID">41</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">goToOAuthRequest:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="310199765"/>
+ </object>
+ <int key="connectionID">44</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -384,6 +412,7 @@
<reference ref="339457297"/>
<reference ref="197016136"/>
<reference ref="670357858"/>
+ <reference ref="310199765"/>
</object>
<reference key="parent" ref="1002"/>
</object>
@@ -541,6 +570,20 @@
<reference key="object" ref="498242188"/>
<reference key="parent" ref="670357858"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">42</int>
+ <reference key="object" ref="310199765"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="746171221"/>
+ </object>
+ <reference key="parent" ref="560574705"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">43</int>
+ <reference key="object" ref="746171221"/>
+ <reference key="parent" ref="310199765"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -570,6 +613,8 @@
<string>36.IBPluginDependency</string>
<string>39.IBPluginDependency</string>
<string>40.IBPluginDependency</string>
+ <string>42.IBPluginDependency</string>
+ <string>43.IBPluginDependency</string>
<string>6.IBPluginDependency</string>
<string>7.IBPluginDependency</string>
<string>8.IBPluginDependency</string>
@@ -604,6 +649,8 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -626,7 +673,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">41</int>
+ <int key="maxID">44</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -639,6 +686,7 @@
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>getAccessToken:</string>
+ <string>goToOAuthRequest:</string>
<string>goToRequestToken:</string>
<string>validateAccessToken:</string>
</object>
@@ -647,6 +695,7 @@
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
@@ -23,4 +23,5 @@
-(void)accessTokenTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data;
-(IBAction) validateAccessToken:(id)sender;
-(IBAction) goToRequestToken:(id)sender;
+-(IBAction) goToOAuthRequest:(id)sender;
@end
@@ -77,6 +77,8 @@ -(void) accessTokenTicket: (OAServiceTicket *) ticket
NSLog(@"Got Ticket Key %@ and secret %@",[accessToken key],[accessToken secret]);
[accessTokenKey setStringValue:[accessToken key]];
[accessTokenSecret setStringValue:[accessToken secret]];
+ [parent setSharedValue:[accessToken key] forKey:OACAccessTokenKey];
+ [parent setSharedValue:[accessToken secret] forKey:OACAccessTokenSecret];
}
else
{
@@ -104,4 +106,9 @@ -(IBAction) goToRequestToken:(id)sender
[parent setViewName:@"GetRequestToken"];
}
+-(IBAction) goToOAuthRequest:(id)sender
+{
+ [parent setViewName:@"OAuthRequest"];
+
+}
@end
@@ -13,9 +13,12 @@ extern NSString * const OACConsumerKey;
extern NSString * const OACConsumerSecret;
extern NSString * const OACRequestTokenKey;
extern NSString * const OACRequestTokenSecret;
+extern NSString * const OACAccessTokenKey;
+extern NSString * const OACAccessTokenSecret;
extern NSString * const OACRequestTokenUrl;
extern NSString * const OACRequestTokenAuthUrl;
extern NSString * const OACAccessTokenUrl;
+extern NSString * const OACLastRequestUrl;
@interface ApplicationController : NSObject {
PreferenceController *preferenceController;
@@ -12,9 +12,12 @@
NSString * const OACConsumerSecret = @"ConsumerSecret";
NSString * const OACRequestTokenKey = @"RequestTokenKey";
NSString * const OACRequestTokenSecret = @"RequestTokenSecret";
+NSString * const OACAccessTokenKey =@"AccessTokenKey";
+NSString * const OACAccessTokenSecret = @"AccessTokenSecret";
NSString * const OACRequestTokenUrl = @"RequestTokenURL";
NSString * const OACRequestTokenAuthUrl = @"RequestTokenAuthURL";
NSString * const OACAccessTokenUrl = @"AccessTokenURL";
+NSString * const OACLastRequestUrl = @"LastRequestURL";
@implementation ApplicationController
@@ -33,7 +36,7 @@ +(void) initialize
[defaultValues setObject:requestTokenAuthUrl forKey:OACRequestTokenAuthUrl];
[defaultValues setObject:consumerKey forKey:OACConsumerKey];
[defaultValues setObject:consumerSecret forKey:OACConsumerSecret];
-
+ [defaultValues setObject:@"" forKey:OACLastRequestUrl];
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues];
}
@@ -9,7 +9,7 @@
#import "MyDocument.h"
#import "RequestTokenViewController.h"
#import "AccessTokenViewController.h"
-
+#import "OAuthRequestController.h"
@implementation MyDocument
- (id)init
@@ -25,7 +25,7 @@ - (id)init
[vc1 setManagedObjectContext:[self managedObjectContext]];
[vc1 setParent:self];
[viewControllers addObject:vc1];
-
+ [vc1 release];
ManagingViewController *vc2 = [[AccessTokenViewController alloc]init];
@@ -34,7 +34,11 @@ - (id)init
[viewControllers addObject:vc2];
[vc2 release];
- [vc1 release];
+ ManagingViewController *vc3 = [[OAuthRequestController alloc]init];
+ [vc3 setManagedObjectContext:[self managedObjectContext]];
+ [vc3 setParent:self];
+ [viewControllers addObject:vc3];
+ [vc3 release];
}
return self;
}
@@ -99,6 +103,11 @@ -(void) setViewName:(NSString *) viewName
[self displayViewController:vc];
}
+ if([viewName isEqualToString:@"OAuthRequest"])
+ {
+ ManagingViewController *vc = [viewControllers objectAtIndex:2];
+ [self displayViewController:vc];
+ }
}
-(id) getSharedValue:(NSString *)key
Oops, something went wrong.

0 comments on commit bdda15a

Please sign in to comment.