summaryrefslogtreecommitdiffstats
path: root/macosx/HBPreferencesController.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2008-04-30 13:41:45 +0000
committerritsuka <[email protected]>2008-04-30 13:41:45 +0000
commit69b6aabe79e998b69450a77b223d3253f4db3ed3 (patch)
tree02213970a7d29e70828fb63adbf4e675f8986a94 /macosx/HBPreferencesController.m
parent1fb35b03be03367c930be567995d91679b53199c (diff)
MacGUI: Clean up HBPreferencesController, remove an unused method, and use standard icons for the General and Advanced panel.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1450 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBPreferencesController.m')
-rw-r--r--macosx/HBPreferencesController.m29
1 files changed, 10 insertions, 19 deletions
diff --git a/macosx/HBPreferencesController.m b/macosx/HBPreferencesController.m
index cb2cd1990..6aa4b16ce 100644
--- a/macosx/HBPreferencesController.m
+++ b/macosx/HBPreferencesController.m
@@ -19,7 +19,7 @@
* no getter/setter code is needed in this file (unless more complicated
* preference settings are added that cannot be handled with Cocoa bindings).
*/
-
+
@interface HBPreferencesController (Private)
- (void) setPrefView: (id) sender;
@@ -35,7 +35,7 @@
+ (void)registerUserDefaults
{
NSString *desktopDirectory = [@"~/Desktop" stringByExpandingTildeInPath];
-
+
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
@"YES", @"CheckForUpdates",
@"English", @"DefaultLanguage",
@@ -63,7 +63,7 @@
{
NSAssert([self window], @"[HBPreferencesController init] window outlet is not connected in Preferences.nib");
}
- return self;
+ return self;
}
- (void) awakeFromNib
@@ -74,7 +74,7 @@
[toolbar setDisplayMode: NSToolbarDisplayModeIconAndLabel];
[toolbar setSizeMode: NSToolbarSizeModeRegular];
[[self window] setToolbar: toolbar];
-
+
[toolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
[self setPrefView:nil];
}
@@ -88,7 +88,7 @@
if ([ident isEqualToString: TOOLBAR_GENERAL])
{
[item setLabel: NSLocalizedString(@"General", "General")];
- [item setImage: [NSImage imageNamed: @"pref-general"]];
+ [item setImage: [NSImage imageNamed: @"NSPreferencesGeneral"]];
[item setTarget: self];
[item setAction: @selector(setPrefView:)];
[item setAutovalidates: NO];
@@ -112,7 +112,7 @@
else if ([ident isEqualToString: TOOLBAR_ADVANCED])
{
[item setLabel: NSLocalizedString(@"Advanced", "Advanced")];
- [item setImage: [NSImage imageNamed: @"pref-advanced"]];
+ [item setImage: [NSImage imageNamed: @"NSAdvanced"]];
[item setTarget: self];
[item setAction: @selector(setPrefView:)];
[item setAutovalidates: NO];
@@ -142,15 +142,6 @@
TOOLBAR_AUDIO, TOOLBAR_ADVANCED, nil];
}
-/**
- * Closes the window and stops modal state. Any changes made in field editor
- * are saved by [NSWindow endEditingFor:] before closing the window.
- */
-- (IBAction)close:(id)sender
-{
- //[self makeFirstResponder: nil];
-}
-
@end
@implementation HBPreferencesController (Private)
@@ -169,21 +160,21 @@
view = fAdvancedView;
else;
}
-
+
NSWindow * window = [self window];
if ([window contentView] == view)
return;
-
+
NSRect windowRect = [window frame];
float difference = ([view frame].size.height - [[window contentView] frame].size.height) * [window userSpaceScaleFactor];
windowRect.origin.y -= difference;
windowRect.size.height += difference;
-
+
[view setHidden: YES];
[window setContentView: view];
[window setFrame: windowRect display: YES animate: YES];
[view setHidden: NO];
-
+
//set title label
if (sender)
[window setTitle: [sender label]];