AIHyperlinks universal building
[adiumx.git] / Source / ESAnnouncerSpeakTextAlertDetailPane.m
blobe32da4b05b564f7bf0e49c1bdde139b5f87cf9da
1 /* 
2  * Adium is the legal property of its developers, whose names are listed in the copyright file included
3  * with this source distribution.
4  * 
5  * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
6  * General Public License as published by the Free Software Foundation; either version 2 of the License,
7  * or (at your option) any later version.
8  * 
9  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
10  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
11  * Public License for more details.
12  * 
13  * You should have received a copy of the GNU General Public License along with this program; if not,
14  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
15  */
17 #import "ESAnnouncerSpeakTextAlertDetailPane.h"
18 #import "ESAnnouncerPlugin.h"
19 #import <Adium/AILocalizationTextField.h>
21 /*!
22  * @class ESAnnouncerSpeakTextAlertDetailPane
23  * @brief Speak Text details pane
24  */
25 @implementation ESAnnouncerSpeakTextAlertDetailPane
27 /*!
28  * @brief Nib name
29  */
30 - (NSString *)nibName{
31     return(@"AnnouncerSpeakTextContactAlert");    
34 /*!
35  * @brief View loaded
36  */
37 - (void)viewDidLoad
39         [super viewDidLoad];
40         
41         [textView_textToSpeakLabel setLocalizedString:AILocalizedString(@"Text To Speak:",nil)];
42         [box_substitutions setTitle:AILocalizedString(@"Substitutions:",nil)];
43         [textView_substitutions setStringValue:AILocalizedString(@"\%n - User name\n\%a - User alias\n\%m - Message\n\%t - Time",nil)];
46 /*!
47  * @brief Configure for the action
48  */
49 - (void)configureForActionDetails:(NSDictionary *)inDetails listObject:(AIListObject *)inObject
51         NSString *textToSpeak = [inDetails objectForKey:KEY_ANNOUNCER_TEXT_TO_SPEAK];
52         [textView_textToSpeak setString:(textToSpeak ? textToSpeak : @"")];
54         [super configureForActionDetails:inDetails listObject:inObject];
57 /*!
58  * @brief Return our current configuration
59  */
60 - (NSDictionary *)actionDetails
62         NSString                        *textToSpeak;
63         NSMutableDictionary     *actionDetails = [NSMutableDictionary dictionary];
64         
65         textToSpeak  = [[[textView_textToSpeak string] copy] autorelease];
66         
67         if(textToSpeak){
68                 [actionDetails setObject:textToSpeak
69                                                   forKey:KEY_ANNOUNCER_TEXT_TO_SPEAK];
70         }
72         return([self actionDetailsFromDict:actionDetails]);
74         
75 /*!
76  * @brief Key on which to store our defaults
77  */
78 - (NSString *)defaultDetailsKey
80         return @"DefaultSpeakTextDetails";
83 @end