diff --git a/Mac/Controller.h b/Mac/Controller.h index fc39233..fd30b85 100644 --- a/Mac/Controller.h +++ b/Mac/Controller.h @@ -25,6 +25,7 @@ IBOutlet NSWindow *conversationViewWindow; WebView *profileView; NSWindow *profileViewWindow; + NSPanel *openProfileWindow; NSWindow *loginViewWindow; NSTextField *loginEntityTextField; NSProgressIndicator *loginActivityIndicator; @@ -33,6 +34,7 @@ ViewDelegate *viewDelegate; WebView *oauthView; AccessToken *accessToken; + NSTextField *showProfileTextField; } @@ -44,6 +46,7 @@ @property (assign) IBOutlet NSWindow *conversationViewWindow; @property (assign) IBOutlet WebView *profileView; @property (assign) IBOutlet NSWindow *profileViewWindow; +@property (assign) IBOutlet NSPanel *openProfileWindow; @property (assign) IBOutlet NSWindow *loginViewWindow; @property (assign) IBOutlet NSTextField *loginEntityTextField; @@ -53,6 +56,7 @@ @property (retain, nonatomic) IBOutlet ViewDelegate *viewDelegate; @property (retain, nonatomic) WebView *oauthView; @property (retain, nonatomic) AccessToken *accessToken; +@property (assign) IBOutlet NSTextField *showProfileTextField; - (void)initOauth; @@ -68,6 +72,7 @@ - (void)notificateUserAboutMention:(NSString *)text fromName:(NSString *)name withPostId:(NSString *)postId andEntity:(NSString *)entity; - (void)openURL:(NSString *)url; +- (IBAction)showProfile:(id)sender; - (void)setString:(NSString *)string forKey:(NSString *)aKey; - (void)setSecret:(NSString *)string; diff --git a/Mac/Controller.m b/Mac/Controller.m index 24d217f..6788090 100644 --- a/Mac/Controller.m +++ b/Mac/Controller.m @@ -12,6 +12,8 @@ #import "NSData+Base64.h" @implementation Controller +@synthesize showProfileTextField; +@synthesize openProfileWindow; @synthesize loginViewWindow; @synthesize loginEntityTextField; @synthesize loginActivityIndicator; @@ -407,6 +409,19 @@ { [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]]; } + +- (IBAction)showProfile:(id)sender +{ + NSString *entity = [self.showProfileTextField stringValue]; + if ([entity rangeOfString:@"."].location != NSNotFound && ([entity hasPrefix:@"http://"] || [entity hasPrefix:@"https://"])) { + NSString *func = [NSString stringWithFormat:@"tentia_instance.showProfileForEntity('%@')", entity]; + [profileView stringByEvaluatingJavaScriptFromString:func]; + [profileViewWindow makeKeyAndOrderFront:self]; + [openProfileWindow performClose:self]; + } +} + + /* - (void)storeAccessToken:(NSString *)_accessToken secret:(NSString *)secret userId:(NSString *)userId andScreenName:(NSString *)screenName { diff --git a/Mac/English.lproj/MainMenu.xib b/Mac/English.lproj/MainMenu.xib index 5e3541c..241ecc7 100644 --- a/Mac/English.lproj/MainMenu.xib +++ b/Mac/English.lproj/MainMenu.xib @@ -233,6 +233,15 @@ + + + Open Profile ... + p + 1048576 + 2147483647 + + + YES @@ -1137,7 +1146,7 @@ _NS:9 YES - + 6 System textBackgroundColor @@ -1146,7 +1155,7 @@ MQA - + 6 System textColor @@ -1178,7 +1187,7 @@ _NS:1535 - + 6 System controlColor @@ -1187,7 +1196,7 @@ MC42NjY2NjY2NjY3AA - + 6 System controlTextColor @@ -1202,6 +1211,7 @@ {{391, 46}, {75, 32}} + _NS:9 YES @@ -1246,6 +1256,100 @@ YES + + 19 + 2 + {{559, 746}, {373, 116}} + -461896704 + Open Profile ... + NSPanel + + + + + 256 + + YES + + + 268 + {{17, 79}, {192, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Open the profile of the entity: + + _NS:1535 + + + + + NO + + + + 268 + {{20, 49}, {333, 22}} + + + + _NS:9 + YES + + -1804599231 + 272630784 + + + https://example.tent.is + _NS:9 + + YES + + + + NO + + + + 268 + {{285, 13}, {74, 32}} + + + + _NS:9 + YES + + 67108864 + 134217728 + Open + + _NS:9 + + -2038284288 + 129 + + + 200 + 25 + + NO + + + {373, 116} + + + + _NS:21 + + {{0, 0}, {2560, 1418}} + {10000000000000, 10000000000000} + NO + @@ -1730,6 +1834,38 @@ 666 + + + showProfileTextField + + + + 678 + + + + showProfile: + + + + 680 + + + + showProfile: + + + + 681 + + + + openProfileWindow + + + + 682 + makeKeyAndOrderFront: @@ -1802,6 +1938,14 @@ 661 + + + makeKeyAndOrderFront: + + + + 676 + @@ -1882,6 +2026,7 @@ + @@ -2611,6 +2756,73 @@ + + 667 + + + + + 668 + + + YES + + + + + + 669 + + + YES + + + + + + + + 670 + + + YES + + + + + + 671 + + + + + 672 + + + YES + + + + + + 673 + + + + + 674 + + + YES + + + + + + 675 + + + @@ -2735,6 +2947,16 @@ 659.IBPluginDependency 660.IBPluginDependency 664.IBPluginDependency + 667.IBPluginDependency + 668.IBPluginDependency + 668.NSWindowTemplate.visibleAtLaunch + 669.IBPluginDependency + 670.IBPluginDependency + 671.IBPluginDependency + 672.IBPluginDependency + 673.IBPluginDependency + 674.IBPluginDependency + 675.IBPluginDependency 72.IBPluginDependency 73.IBPluginDependency 79.IBPluginDependency @@ -2864,6 +3086,16 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2882,7 +3114,7 @@ - 666 + 682 @@ -2897,9 +3129,7 @@ clearCache: login: logout: - openNewMessageWindow: - sendTweet: - showConversationForPostId:andEntity: + showProfile: YES @@ -2907,8 +3137,6 @@ id id id - id - NSString @@ -2918,9 +3146,7 @@ clearCache: login: logout: - openNewMessageWindow: - sendTweet: - showConversationForPostId:andEntity: + showProfile: YES @@ -2937,17 +3163,9 @@ id - openNewMessageWindow: + showProfile: id - - sendTweet: - id - - - showConversationForPostId:andEntity: - NSString - @@ -2965,6 +3183,7 @@ mentionsViewWindow profileView profileViewWindow + showProfileTextField timelineView timelineViewWindow viewDelegate @@ -2982,6 +3201,7 @@ NSWindow WebView NSWindow + NSTextField WebView NSWindow ViewDelegate @@ -3002,6 +3222,7 @@ mentionsViewWindow profileView profileViewWindow + showProfileTextField timelineView timelineViewWindow viewDelegate @@ -3052,6 +3273,10 @@ profileViewWindow NSWindow + + showProfileTextField + NSTextField + timelineView WebView