2 * Adium is the legal property of its developers, whose names are listed in the copyright file included
3 * with this source distribution.
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.
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.
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.
17 #import "ESAnnouncerSpeakTextAlertDetailPane.h"
18 #import "ESAnnouncerPlugin.h"
19 #import <Adium/AILocalizationTextField.h>
22 * @class ESAnnouncerSpeakTextAlertDetailPane
23 * @brief Speak Text details pane
25 @implementation ESAnnouncerSpeakTextAlertDetailPane
30 - (NSString *)nibName{
31 return @"AnnouncerSpeakTextContactAlert";
41 [textView_textToSpeakLabel setLocalizedString:AILocalizedString(@"Text To Speak:",nil)];
42 [box_substitutions setTitle:AILocalizedString(@"Substitutions:","Title above the box in the Speak Text action's detail pane. The box contains keywords such as \%a and what they will become when spoken such as User Alias.")];
44 [textView_substitutions setStringValue:
45 [NSString stringWithFormat:@"%@ - %@\n%@ - %@\n%@ - %@\n%@ - %@",
46 @"%n", AILocalizedString(@"User name", "Speak Text action keyword: user name"),
47 @"%a", AILocalizedString(@"User alias", "Speak Text action keyword: user alias"),
48 @"%m", AILocalizedString(@"Message", "Speak Text action keyword: message"),
49 @"%t", AILocalizedString(@"Time", "Speak Text action keyword: time")]];
53 * @brief Configure for the action
55 - (void)configureForActionDetails:(NSDictionary *)inDetails listObject:(AIListObject *)inObject
57 NSString *textToSpeak = [inDetails objectForKey:KEY_ANNOUNCER_TEXT_TO_SPEAK];
58 [textView_textToSpeak setString:(textToSpeak ? textToSpeak : @"")];
60 [super configureForActionDetails:inDetails listObject:inObject];
64 * @brief Return our current configuration
66 - (NSDictionary *)actionDetails
68 NSString *textToSpeak;
69 NSMutableDictionary *actionDetails = [NSMutableDictionary dictionary];
71 textToSpeak = [[[textView_textToSpeak string] copy] autorelease];
74 [actionDetails setObject:textToSpeak
75 forKey:KEY_ANNOUNCER_TEXT_TO_SPEAK];
78 return [self actionDetailsFromDict:actionDetails];
82 * @brief Key on which to store our defaults
84 - (NSString *)defaultDetailsKey
86 return @"DefaultSpeakTextDetails";