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.5 by asvitkine, 2010-07-27T02:55:09Z

# Line 24 | Line 24
24  
25   #include "sysdeps.h"
26  
27 < #include <Cocoa/Cocoa.h>
27 > // The _UINT64 define is needed to guard against a typedef mismatch with Snow Leopard headers.
28 > #define _UINT64
29  
30 < #include "PrefsEditor.h"
30 > #include <Cocoa/Cocoa.h>
31 > #include "VMSettingsController.h"
32  
33   @interface SheepShaverMain : NSObject
34          NSArray *nibObjects;
# Line 38 | Line 40
40  
41   - (NSArray*) loadPrefsNibFile
42   {
43 <        NSNib *nib = [[NSNib alloc] initWithNibNamed:@"MainMenu" bundle:nil];
43 >        NSNib *nib = [[NSNib alloc] initWithNibNamed:@"VMSettingsWindow" bundle:nil];
44          NSArray *objects = nil;
45  
46 <        if (![nib instantiateNibWithOwner:self topLevelObjects:&objects]) {
46 >        if (![nib instantiateNibWithOwner:[VMSettingsController sharedInstance] topLevelObjects:&objects]) {
47                  NSLog(@"Could not load Prefs NIB file!\n");
48                  return nil;
49          }
# Line 76 | Line 78
78  
79   - (void) openPreferences:(id)sender
80   {
81 +        NSAutoreleasePool *pool;
82 +
83          if (nibObjects == nil) {
84                  nibObjects = [self loadPrefsNibFile];
85                  if (nibObjects == nil)
# Line 83 | Line 87
87                  [nibObjects retain];
88          }
89  
90 +        pool = [[NSAutoreleasePool alloc] init];
91 +        [[VMSettingsController sharedInstance] setupGUI];
92          [NSApp runModalForWindow:prefsWindow];
93 +        [pool release];
94   }
95  
96   @end
# Line 94 | Line 101
101  
102   void prefs_init(void)
103   {
104 +        NSAutoreleasePool *pool;
105          NSMenu *appMenu;
106          NSMenuItem *menuItem;
107  
108 +        pool = [[NSAutoreleasePool alloc] init];
109 +
110          appMenu = [[[NSApp mainMenu] itemAtIndex:0] submenu];
111          menuItem = [[NSMenuItem alloc] initWithTitle:@"Preferences..." action:@selector(openPreferences:) keyEquivalent:@","];
112          [appMenu insertItem:menuItem atIndex:2];
# Line 104 | Line 114 | void prefs_init(void)
114          [menuItem release];
115          
116          [NSApp setDelegate:[[SheepShaverMain alloc] init]];
117 +
118 +        [pool release];
119   }
120  
121  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines