2 // ESShowContactInfoPromptController.m
5 // Created by Evan Schoenberg on 1/8/06.
8 #import "ESShowContactInfoPromptController.h"
9 #import "AIContactInfoWindowController.h"
10 #import <Adium/AIListContact.h>
12 #define SHOW_CONTACT_INFO_PROMPT_NIB @"ShowContactInfoPrompt"
13 #define GET_INFO AILocalizedString(@"Get Info",nil)
15 static ESShowContactInfoPromptController *sharedShowInfoPromptInstance = nil;
18 * @class ESShowContactInfoPromptController
19 * @brief Controller for the Show Contact Info prompt, which allows one to get info on an arbitrary contact
21 @implementation ESShowContactInfoPromptController
24 * @brief Return our shared instance
25 * @result The shared instance
29 return sharedShowInfoPromptInstance;
33 * @brief Create the shared instance
34 * @result The shared instance
36 + (id)createSharedInstance
38 sharedShowInfoPromptInstance = [[self alloc] initWithWindowNibName:SHOW_CONTACT_INFO_PROMPT_NIB];
40 return sharedShowInfoPromptInstance;
44 * @brief Destroy the shared instance
46 + (void)destroySharedInstance
48 [sharedShowInfoPromptInstance autorelease]; sharedShowInfoPromptInstance = nil;
52 * @brief Window did load
56 [super windowDidLoad];
58 [label_using setLocalizedString:AILocalizedString(@"Using:",nil)];
59 [label_contact setLocalizedString:AILocalizedString(@"Contact:",nil)];
61 [button_okay setLocalizedString:GET_INFO];
62 [[self window] setTitle:GET_INFO];
66 * @brief Show info for the desired contact
68 - (IBAction)okay:(id)sender
70 AIListContact *contact;
72 if ((contact = [self contactFromTextField])) {
73 [AIContactInfoWindowController showInfoWindowForListObject:contact];
76 [[self class] closeSharedInstance];