ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/MacOSX/prefs_macosx.mm
(Generate patch)

Comparing SheepShaver/src/MacOSX/prefs_macosx.mm (file contents):
Revision 1.1 by asvitkine, 2007-07-28T15:46:17Z vs.
Revision 1.4 by asvitkine, 2010-01-02T22:08:51Z

# Line 25 | Line 25
25   #include "sysdeps.h"
26  
27   #include <Cocoa/Cocoa.h>
28 <
29 < #include "PrefsEditor.h"
28 > #include "VMSettingsController.h"
29  
30   @interface SheepShaverMain : NSObject
31          NSArray *nibObjects;
# Line 38 | Line 37
37  
38   - (NSArray*) loadPrefsNibFile
39   {
40 <        NSNib *nib = [[NSNib alloc] initWithNibNamed:@"MainMenu" bundle:nil];
40 >        NSNib *nib = [[NSNib alloc] initWithNibNamed:@"VMSettingsWindow" bundle:nil];
41          NSArray *objects = nil;
42  
43 <        if (![nib instantiateNibWithOwner:self topLevelObjects:&objects]) {
43 >        if (![nib instantiateNibWithOwner:[VMSettingsController sharedInstance] topLevelObjects:&objects]) {
44                  NSLog(@"Could not load Prefs NIB file!\n");
45                  return nil;
46          }
# Line 76 | Line 75
75  
76   - (void) openPreferences:(id)sender
77   {
78 +        NSAutoreleasePool *pool;
79 +
80          if (nibObjects == nil) {
81                  nibObjects = [self loadPrefsNibFile];
82                  if (nibObjects == nil)
# Line 83 | Line 84
84                  [nibObjects retain];
85          }
86  
87 +        pool = [[NSAutoreleasePool alloc] init];
88 +        [[VMSettingsController sharedInstance] setupGUI];
89          [NSApp runModalForWindow:prefsWindow];
90 +        [pool release];
91   }
92  
93   @end
# Line 94 | Line 98
98  
99   void prefs_init(void)
100   {
101 +        NSAutoreleasePool *pool;
102          NSMenu *appMenu;
103          NSMenuItem *menuItem;
104  
105 +        pool = [[NSAutoreleasePool alloc] init];
106 +
107          appMenu = [[[NSApp mainMenu] itemAtIndex:0] submenu];
108          menuItem = [[NSMenuItem alloc] initWithTitle:@"Preferences..." action:@selector(openPreferences:) keyEquivalent:@","];
109          [appMenu insertItem:menuItem atIndex:2];
# Line 104 | Line 111 | void prefs_init(void)
111          [menuItem release];
112          
113          [NSApp setDelegate:[[SheepShaverMain alloc] init]];
114 +
115 +        [pool release];
116   }
117  
118  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines