summaryrefslogtreecommitdiffstats
path: root/macosx/PrefsController.m
diff options
context:
space:
mode:
authorhandbrake <[email protected]>2006-01-14 13:40:38 +0000
committerhandbrake <[email protected]>2006-01-14 13:40:38 +0000
commit56bb6ce496b475944bb9577c7586e84be1cb831e (patch)
tree7720c135a160a34f22ce8f1f911f350e18207eaa /macosx/PrefsController.m
parentd35a2a23fe450c88925128b9db7c63a5f1ed395d (diff)
HandBrake 0.7.0
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@16 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/PrefsController.m')
-rw-r--r--macosx/PrefsController.m47
1 files changed, 47 insertions, 0 deletions
diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m
new file mode 100644
index 000000000..8e7c865e2
--- /dev/null
+++ b/macosx/PrefsController.m
@@ -0,0 +1,47 @@
+#import "PrefsController.h"
+
+@implementation PrefsController
+
+- (void) awakeFromNib
+{
+ NSUserDefaults * defaults;
+ NSDictionary * appDefaults;
+
+ /* Unless the user specified otherwise, default is to check
+ for update */
+ defaults = [NSUserDefaults standardUserDefaults];
+ appDefaults = [NSDictionary dictionaryWithObject:@"YES"
+ forKey:@"CheckForUpdates"];
+ [defaults registerDefaults: appDefaults];
+
+ /* Check or uncheck according to the preferences */
+ [fUpdateCheck setState: [defaults boolForKey:@"CheckForUpdates"] ?
+ NSOnState : NSOffState];
+}
+
+- (IBAction) OpenPanel: (id) sender;
+{
+ [NSApp runModalForWindow: fPanel];
+}
+
+- (IBAction) ClosePanel: (id) sender;
+{
+ [NSApp stopModal];
+ [fPanel orderOut: sender];
+}
+
+- (IBAction) CheckChanged: (id) sender
+{
+ NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
+
+ if( [fUpdateCheck state] == NSOnState )
+ {
+ [defaults setObject:@"YES" forKey:@"CheckForUpdates"];
+ }
+ else
+ {
+ [defaults setObject:@"NO" forKey:@"CheckForUpdates"];
+ }
+}
+
+@end