#import "PreferencesController.h"
-#import "MenuTunes.h"
+#import "MainController.h"
#import "HotKeyCenter.h"
@implementation PreferencesController
-- (id)initWithMenuTunes:(MenuTunes *)tunes;
+- (id)initWithMenuTunes:(MainController *)tunes;
{
if ( (self = [super init]) ) {
int i;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
mt = [tunes retain];
- [mt registerDefaultsIfNeeded];
+ [mt registerDefaults];
- //Load the nib
- [NSBundle loadNibNamed:@"Preferences" owner:self];
-
- //Show our window
- [window setLevel:NSStatusWindowLevel];
- [window center];
- [window makeKeyAndOrderFront:nil];
+ [NSBundle loadNibNamed:@"Preferences" owner:self]; //Load the nib
//Set the table view cells up
[imgCell setImageScaling:NSScaleNone];
[allTableView registerForDraggedTypes:[NSArray arrayWithObjects:@"MenuTableViewPboardType", @"AllTableViewPboardType", nil]];
//Set the list of items you can have.
- availableItems = [[NSMutableArray alloc] initWithObjects:@"Current Track Info", @"Upcoming Songs", @"Playlists", @"EQ Presets", @"Play/Pause", @"Next Track", @"Previous Track", @"Fast Forward", @"Rewind", @"<separator>", nil];
+ availableItems = [[NSMutableArray alloc] initWithObjects:@"Current Track Info", @"Upcoming Songs", @"Playlists", @"EQ Presets", @"Song Rating", @"Play/Pause", @"Next Track", @"Previous Track", @"Fast Forward", @"Rewind", @"<separator>", nil];
//Get our preferred menu
myItems = [[[NSUserDefaults standardUserDefaults] arrayForKey:@"menu"] mutableCopy];
}
//Items that show should a submenu image
- submenuItems = [[NSArray alloc] initWithObjects:@"Upcoming Songs", @"Playlists", @"EQ Presets", nil];
+ submenuItems = [[NSArray alloc] initWithObjects:@"Upcoming Songs", @"Playlists", @"EQ Presets", @"Song Rating", nil];
//Fill in the number of songs in advance to show field
[songsInAdvance setIntValue:[defaults integerForKey:@"SongsInAdvance"]];
}
}
}
+
+ //Show our window
+ [window setLevel:NSStatusWindowLevel];
+ [window center];
+ [window makeKeyAndOrderFront:nil];
+ [window setDelegate:self];
}
return self;
}
[defaults setInteger:5 forKey:@"SongsInAdvance"];
}
- {
+ /*{
NSArray *apps = [[NSWorkspace sharedWorkspace] launchedApplications];
int i;
[mt rebuildMenu];
}
}
- }
+ }*/
[mt clearHotKeys];
}
[keyComboField setStringValue:string];
}
+//
+//
+
+- (void)windowWillClose:(NSNotification *)note
+{
+ [mt closePreferences];
+}
+
//
//
// Table View Datasource Methods