Put NSAutoreleasePool usage around other distributed notification observer methods
[adiumx.git] / Source / CBGrowlAlertDetailPane.m
blob4701dd6ec7da802c721e9c9af6af8f498e66bd97
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 "CBGrowlAlertDetailPane.h"
18 #import "NEHGrowlPlugin.h"
20 /*!
21  * @class CBGrowlAlertDetailPane
22  * @brief Provide and manage custom controls for configuring the Growl contact alert
23  *
24  * The only control currently provided is the ability to make a Growl notification sticky (i.e. does not disappear until
25  * the user dismisses it).
26  */
27 @implementation CBGrowlAlertDetailPane
29 /*!
30  * @brief Returns the name of our pane
31  *
32  * Since this is a detail pain, we return @"".
33  */
34 - (NSString *)label
35
36         return @"";
39 /*!
40  * @brief Returns the name of the Nib to load
41  */
42 - (NSString *)nibName
44         return @"GrowlAlert";
47 /*!
48  * @brief Configure the detail view, and set up our localized controls
49  */
50 - (void)viewDidLoad
52         [super viewDidLoad];
53         
54         [checkBox_sticky setLocalizedString:AILocalizedString(@"Sticky","Growl contact alert label")];
57 /*!
58  * @brief Load the state of our controls
59  */
60 - (void)configureForActionDetails:(NSDictionary *)inDetails listObject:(AIListObject *)inObject
62         [checkBox_sticky setState:([[inDetails objectForKey:KEY_GROWL_ALERT_STICKY] boolValue] ? NSOnState : NSOffState)];
65 /*!
66  * @brief Return the state of our controls
67  */
68 - (NSDictionary *)actionDetails
70         return [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:([checkBox_sticky state] == NSOnState)]
71                                                                            forKey:KEY_GROWL_ALERT_STICKY];
74 /*!
75  * @brief Called when any of our controls change
76  */
77 - (IBAction)changePreference:(id)sender
79         [self detailsForHeaderChanged];
82 @end