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 @@
+
@@ -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