Update the icon in the personal preferences if it's changed elsewhere (the contact...
[adiumx.git] / Source / ESShowContactInfoPromptController.m
blob21f238221c89409ee5649266c7b4a808a0d23dec
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:",nil)];
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                 [AIContactInfoWindowController showInfoWindowForListObject:contact];
75                 //Close the prompt
76         [[self class] closeSharedInstance];
77     }
80 @end