X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/26e7dbbdfdddcb98beb83c19a83b8e35416821ff..a822d608c6739b4c2cd2c39187a78ca461d4d6d4:/PreferencesController.m diff --git a/PreferencesController.m b/PreferencesController.m index 8acaab7..82b7f82 100755 --- a/PreferencesController.m +++ b/PreferencesController.m @@ -1,10 +1,10 @@ #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; @@ -12,16 +12,11 @@ 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]; - //Set the table view cells up [imgCell setImageScaling:NSScaleNone]; [[menuTableView tableColumnWithIdentifier:@"submenu"] setDataCell:imgCell]; @@ -111,6 +106,12 @@ } } } + + //Show our window + [window setLevel:NSStatusWindowLevel]; + [window center]; + [window makeKeyAndOrderFront:nil]; + [window setDelegate:self]; } return self; } @@ -209,7 +210,7 @@ [defaults setInteger:5 forKey:@"SongsInAdvance"]; } - { + /*{ NSArray *apps = [[NSWorkspace sharedWorkspace] launchedApplications]; int i; @@ -219,7 +220,7 @@ [mt rebuildMenu]; } } - } + }*/ [mt clearHotKeys]; } @@ -391,6 +392,14 @@ [keyComboField setStringValue:string]; } +// +// + +- (void)windowWillClose:(NSNotification *)note +{ + [mt closePreferences]; +} + // // // Table View Datasource Methods