Commits

Anonymous committed 6de072e

Hooking up the preferences window to the corresponding menu items

  • Participants
  • Parent commits b69f9ef

Comments (0)

Files changed (3)

File English.lproj/MainMenu.xib

 					</object>
 					<int key="connectionID">549</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">showPreferencesPanel:</string>
+						<reference key="source" ref="651359800"/>
+						<reference key="destination" ref="609285721"/>
+					</object>
+					<int key="connectionID">550</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">displayAccountsList:</string>
+						<reference key="source" ref="651359800"/>
+						<reference key="destination" ref="51467641"/>
+					</object>
+					<int key="connectionID">551</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
 					<string>544.IBPluginDependency</string>
 					<string>545.IBPluginDependency</string>
 					<string>546.IBPluginDependency</string>
-					<string>547.IBPluginDependency</string>
 					<string>56.IBPluginDependency</string>
 					<string>56.ImportedFromIB2</string>
 					<string>57.IBEditorWindowLastContentRect</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
 					<string>{{342, 310}, {229, 203}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
-					<string>{{472, 123}, {196, 263}}</string>
+					<string>{{398, 250}, {196, 263}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
 					<string>{{155, 774}, {199, 203}}</string>
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">549</int>
+			<int key="maxID">551</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
 					<string key="className">AppController</string>
 					<string key="superclassName">NSObject</string>
 					<object class="NSMutableDictionary" key="actions">
-						<string key="NS.key.0">performOpenURL:</string>
-						<string key="NS.object.0">id</string>
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>displayAccountsList:</string>
+							<string>performOpenURL:</string>
+							<string>showPreferencesPanel:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+						</object>
 					</object>
 					<object class="IBClassDescriptionSource" key="sourceIdentifier">
 						<string key="majorKey">IBProjectSource</string>
 					<reference key="sourceIdentifier" ref="473051448"/>
 				</object>
 				<object class="IBPartialClassDescription">
+					<string key="className">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">BWToolkitFramework.framework/Headers/NSView+BWAdditions.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
 					<string key="className">NSWindow</string>
 					<object class="IBClassDescriptionSource" key="sourceIdentifier">
 						<string key="majorKey">IBFrameworkSource</string>
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
+					<string key="className">NSWindow</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">BWToolkitFramework.framework/Headers/NSWindow+BWAdditions.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
 					<string key="className">NSWindowController</string>
 					<string key="superclassName">NSResponder</string>
 					<object class="NSMutableDictionary" key="actions">

File Source/AppController.h

 
 #import <Cocoa/Cocoa.h>
 
+@class PreferencesWindowController;
+
 @interface AppController : NSObject < NSApplicationDelegate > {
+    PreferencesWindowController *preferences;
 }
 
+@property (readwrite, retain) PreferencesWindowController *preferences;
 
 - (IBAction) performOpenURL: (id) sender;
 
+- (IBAction) displayAccountsList: (id) sender;
+- (IBAction) showPreferencesPanel: (id) sender;
+
 @end

File Source/AppController.m

 #import "ServerWindowController.h"
 #import "OpenURLController.h"
 #import "ConnectionController.h"
+#import "PreferencesWindowController.h"
 
 #import "PFMoveApplication.h"
 
 
 @implementation AppController
 
+@synthesize preferences;
 
+- (PreferencesWindowController *) preferences;
+{
+    if (nil == preferences) {
+        preferences = [[PreferencesWindowController alloc] init];
+    }
+    return preferences;
+}
 
 - (void) applicationWillFinishLaunching:(NSNotification *)notification
 {
     }];
 }
 
+- (IBAction) displayAccountsList: (id) sender;
+{
+    [self showPreferencesPanel: sender];
+}
+
+- (IBAction) showPreferencesPanel: (id) sender;
+{
+    [[self preferences] showWindow: sender];
+}
+
 @end