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.6 by asvitkine, 2010-08-22T19:33:25Z

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines