* 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;
+ (void)registerUserDefaults
{
NSString *desktopDirectory = [@"~/Desktop" stringByExpandingTildeInPath];
-
+
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
@"YES", @"CheckForUpdates",
@"English", @"DefaultLanguage",
{
NSAssert([self window], @"[HBPreferencesController init] window outlet is not connected in Preferences.nib");
}
- return self;
+ return self;
}
- (void) awakeFromNib
[toolbar setDisplayMode: NSToolbarDisplayModeIconAndLabel];
[toolbar setSizeMode: NSToolbarSizeModeRegular];
[[self window] setToolbar: toolbar];
-
+
[toolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
[self setPrefView:nil];
}
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];
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];
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)
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]];
A2D7AD670C998AD30082CA33 /* ActivityWindow.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2D7AD5E0C998AD30082CA33 /* ActivityWindow.tiff */; };
A2D7AD680C998AD30082CA33 /* AddToQueue.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2D7AD5F0C998AD30082CA33 /* AddToQueue.tiff */; };
A2D7AD690C998AD30082CA33 /* Drawer.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2D7AD600C998AD30082CA33 /* Drawer.tiff */; };
- A2D7AD6A0C998AD30082CA33 /* pref-advanced.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2D7AD610C998AD30082CA33 /* pref-advanced.tiff */; };
A2D7AD6B0C998AD30082CA33 /* pref-audio.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2D7AD620C998AD30082CA33 /* pref-audio.tiff */; };
- A2D7AD6C0C998AD30082CA33 /* pref-general.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2D7AD630C998AD30082CA33 /* pref-general.tiff */; };
A2D7AD6D0C998AD30082CA33 /* pref-picture.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2D7AD640C998AD30082CA33 /* pref-picture.tiff */; };
A2D7AD6E0C998AD30082CA33 /* Queue.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2D7AD650C998AD30082CA33 /* Queue.tiff */; };
A2D7AD6F0C998AD30082CA33 /* Source.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2D7AD660C998AD30082CA33 /* Source.tiff */; };
A2D7AD5E0C998AD30082CA33 /* ActivityWindow.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = ActivityWindow.tiff; sourceTree = "<group>"; };
A2D7AD5F0C998AD30082CA33 /* AddToQueue.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = AddToQueue.tiff; sourceTree = "<group>"; };
A2D7AD600C998AD30082CA33 /* Drawer.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Drawer.tiff; sourceTree = "<group>"; };
- A2D7AD610C998AD30082CA33 /* pref-advanced.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "pref-advanced.tiff"; sourceTree = "<group>"; };
A2D7AD620C998AD30082CA33 /* pref-audio.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "pref-audio.tiff"; sourceTree = "<group>"; };
- A2D7AD630C998AD30082CA33 /* pref-general.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "pref-general.tiff"; sourceTree = "<group>"; };
A2D7AD640C998AD30082CA33 /* pref-picture.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "pref-picture.tiff"; sourceTree = "<group>"; };
A2D7AD650C998AD30082CA33 /* Queue.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Queue.tiff; sourceTree = "<group>"; };
A2D7AD660C998AD30082CA33 /* Source.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Source.tiff; sourceTree = "<group>"; };
A2D7AD650C998AD30082CA33 /* Queue.tiff */,
A2D7AD5E0C998AD30082CA33 /* ActivityWindow.tiff */,
A2D7AD600C998AD30082CA33 /* Drawer.tiff */,
- A2D7AD630C998AD30082CA33 /* pref-general.tiff */,
- A2D7AD610C998AD30082CA33 /* pref-advanced.tiff */,
A2D7AD620C998AD30082CA33 /* pref-audio.tiff */,
A2D7AD640C998AD30082CA33 /* pref-picture.tiff */,
A9DE40430C959834008A5440 /* minus-8.png */,
A2D7AD670C998AD30082CA33 /* ActivityWindow.tiff in Resources */,
A2D7AD680C998AD30082CA33 /* AddToQueue.tiff in Resources */,
A2D7AD690C998AD30082CA33 /* Drawer.tiff in Resources */,
- A2D7AD6A0C998AD30082CA33 /* pref-advanced.tiff in Resources */,
A2D7AD6B0C998AD30082CA33 /* pref-audio.tiff in Resources */,
- A2D7AD6C0C998AD30082CA33 /* pref-general.tiff in Resources */,
A2D7AD6D0C998AD30082CA33 /* pref-picture.tiff in Resources */,
A2D7AD6E0C998AD30082CA33 /* Queue.tiff in Resources */,
A2D7AD6F0C998AD30082CA33 /* Source.tiff in Resources */,