The accounts menu now distinguishes accounts which are on a service compatible with...
[adiumx.git] / Source / ESShowContactInfoPromptController.m
blob60eab5424b700807dc6432c9ccda328ec8fdc92a
1 //
2 //  ESShowContactInfoPromptController.m
3 //  Adium
4 //
5 //  Created by Evan Schoenberg on 1/8/06.
6 //
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;
17 /*!
18  * @class ESShowContactInfoPromptController
19  * @brief Controller for the Show Contact Info prompt, which allows one to get info on an arbitrary contact
20  */
21 @implementation ESShowContactInfoPromptController
23 /*!
24  * @brief Return our shared instance
25  * @result The shared instance
26  */
27 + (id)sharedInstance 
29         return sharedShowInfoPromptInstance;
32 /*!
33  * @brief Create the shared instance
34  * @result The shared instance
35  */
36 + (id)createSharedInstance 
38         sharedShowInfoPromptInstance = [[self alloc] initWithWindowNibName:SHOW_CONTACT_INFO_PROMPT_NIB];
39         
40         return sharedShowInfoPromptInstance;
43 /*!
44  * @brief Destroy the shared instance
45  */
46 + (void)destroySharedInstance 
48         [sharedShowInfoPromptInstance autorelease]; sharedShowInfoPromptInstance = nil;
51 /*!
52  * @brief Window did load
53  */
54 - (void)windowDidLoad
56         [super windowDidLoad];
57         
58         [label_using setLocalizedString:AILocalizedString(@"Using:","Label in front of an account drop-down selector to determine what account to use")];
59         [label_contact setLocalizedString:AILocalizedString(@"Contact:",nil)];
61         [button_okay setLocalizedString:GET_INFO];
62         [[self window] setTitle:GET_INFO];
65 /*!
66  * @brief Show info for the desired contact
67  */
68 - (IBAction)okay:(id)sender
70         AIListContact   *contact;
72         if ((contact = [self contactFromTextField])) {
73                 [super okay:sender];
75                 [AIContactInfoWindowController showInfoWindowForListObject:contact];
77                 //Close the prompt
78         [[self class] closeSharedInstance];
79     }
82 - (NSString *)lastAccountIDKey
84         return @"ShowContactInfo";
87 @end