From d2004303249662f905cfd3c4266537de9c895e5a Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 9 Jul 2008 13:05:14 -0400 Subject: [PATCH] Adding an empty preferences window and controller. Hooking up the Preferences menu item. * English.lproj/MainMenu.xib: Hooking up the Preferences menu item * English.lproj/Preferences.xib: New file * Source/PreferencesController.m+h: New files * Source/AppDelegate.m+h: Adding an ivar for the PreferencesController (showPreferences:): New method * MacGDBp.xcodeproj: Project updates for new files --- English.lproj/MainMenu.xib | 24 ++-- English.lproj/Preferences.xib | 187 ++++++++++++++++++++++++++++++ MacGDBp.xcodeproj/project.pbxproj | 26 +++++ Source/AppDelegate.h | 3 + Source/AppDelegate.m | 11 ++ Source/PreferencesController.h | 25 ++++ Source/PreferencesController.m | 33 ++++++ 7 files changed, 301 insertions(+), 8 deletions(-) create mode 100644 English.lproj/Preferences.xib create mode 100644 Source/PreferencesController.h create mode 100644 Source/PreferencesController.m diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index f7a3a6b..fdd7f54 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -2,14 +2,13 @@ 1050 - 9D34 - 667 + 9E17 + 670 949.33 352.00 YES - - + YES @@ -650,7 +649,7 @@ {3.40282e+38, 3.40282e+38} - + 256 YES @@ -752,7 +751,6 @@ {480, 153} - {{0, 0}, {1440, 878}} {3.40282e+38, 3.40282e+38} @@ -1025,6 +1023,14 @@ 284 + + + showPreferences: + + + + 285 + @@ -1866,7 +1872,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{75, 562}, {203, 183}} + {{512, 618}, {203, 183}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1895,7 +1901,7 @@ - 284 + 285 @@ -1911,6 +1917,7 @@ openUpdateInformation: showBreakpointWindow: showDebuggerWindow: + showPreferences: YES @@ -1918,6 +1925,7 @@ id id id + id diff --git a/English.lproj/Preferences.xib b/English.lproj/Preferences.xib new file mode 100644 index 0000000..bde0f1b --- /dev/null +++ b/English.lproj/Preferences.xib @@ -0,0 +1,187 @@ + + + + 1050 + 9E17 + 670 + 949.33 + 352.00 + + YES + + + + YES + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + PreferencesController + + + FirstResponder + + + NSApplication + + + 15 + 2 + {{196, 240}, {480, 270}} + 1610612736 + Window + NSWindow + + {3.40282e+38, 3.40282e+38} + + + 256 + {480, 270} + + + {{0, 0}, {1680, 1028}} + {3.40282e+38, 3.40282e+38} + + + + + YES + + + window + + + + 3 + + + + + YES + + 0 + + YES + + + + + + -2 + + + RmlsZSdzIE93bmVyA + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 2.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilderKit + {{63, 506}, {480, 270}} + com.apple.InterfaceBuilder.CocoaPlugin + {{63, 506}, {480, 270}} + + {196, 240} + {{202, 428}, {480, 270}} + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 3 + + + + YES + + NSObject + + IBProjectSource + Source/BSSourceView.h + + + + NSObject + + IBProjectSource + Source/SocketWrapper.h + + + + PreferencesController + NSWindowController + + IBProjectSource + Source/PreferencesController.h + + + + + 0 + ../MacGDBp.xcodeproj + 3 + + diff --git a/MacGDBp.xcodeproj/project.pbxproj b/MacGDBp.xcodeproj/project.pbxproj index 9996fd5..cb77749 100644 --- a/MacGDBp.xcodeproj/project.pbxproj +++ b/MacGDBp.xcodeproj/project.pbxproj @@ -22,6 +22,8 @@ 1E7188690D839F6300969277 /* BSSourceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E7188650D839F6300969277 /* BSSourceView.m */; }; 1E71886A0D839F6300969277 /* BSSourceViewTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E7188670D839F6300969277 /* BSSourceViewTextView.m */; }; 1E822CDD0DA28AC30027A23F /* Breakpoint.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E822CDC0DA28AC30027A23F /* Breakpoint.m */; }; + 1E9582620E252474001A3D89 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1E9582600E252474001A3D89 /* Preferences.xib */; }; + 1E9582670E2524AD001A3D89 /* PreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E9582660E2524AD001A3D89 /* PreferencesController.m */; }; 1EEBFBE50D34C793008F835B /* Debugger.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1EEBFBE30D34C793008F835B /* Debugger.xib */; }; 1EEBFC2B0D358EBD008F835B /* StepIn.png in Resources */ = {isa = PBXBuildFile; fileRef = 1EEBFC2A0D358EBD008F835B /* StepIn.png */; }; 1EEBFC370D358F1B008F835B /* StepOut.png in Resources */ = {isa = PBXBuildFile; fileRef = 1EEBFC360D358F1B008F835B /* StepOut.png */; }; @@ -64,6 +66,9 @@ 1E7188670D839F6300969277 /* BSSourceViewTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BSSourceViewTextView.m; path = Source/BSSourceViewTextView.m; sourceTree = ""; }; 1E822CDB0DA28AC30027A23F /* Breakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Breakpoint.h; path = Source/Breakpoint.h; sourceTree = ""; }; 1E822CDC0DA28AC30027A23F /* Breakpoint.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Breakpoint.m; path = Source/Breakpoint.m; sourceTree = ""; }; + 1E9582610E252474001A3D89 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Preferences.xib; sourceTree = ""; }; + 1E9582650E2524AD001A3D89 /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PreferencesController.h; path = Source/PreferencesController.h; sourceTree = ""; }; + 1E9582660E2524AD001A3D89 /* PreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PreferencesController.m; path = Source/PreferencesController.m; sourceTree = ""; }; 1EEBFBE40D34C793008F835B /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Debugger.xib; sourceTree = ""; }; 1EEBFC2A0D358EBD008F835B /* StepIn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = StepIn.png; path = Icons/StepIn.png; sourceTree = ""; }; 1EEBFC360D358F1B008F835B /* StepOut.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = StepOut.png; path = Icons/StepOut.png; sourceTree = ""; }; @@ -100,6 +105,7 @@ children = ( 1E02C3D30C60EC2C006F1752 /* AppDelegate.h */, 1E02C3D40C60EC2C006F1752 /* AppDelegate.m */, + 1E9582640E252480001A3D89 /* Preferences */, 1E1E52C10DF9B1FB00D334F9 /* Connection */, 1E1E52C00DF9B1E700D334F9 /* Breakpoints */, 1E71886C0D839F6C00969277 /* Source View */, @@ -179,6 +185,7 @@ 1EEBFBE30D34C793008F835B /* Debugger.xib */, 1E416FF60D36F821009A53A2 /* MainMenu.xib */, 1E1E53010DF9B89800D334F9 /* Breakpoints.xib */, + 1E9582600E252474001A3D89 /* Preferences.xib */, ); name = Interfaces; sourceTree = ""; @@ -198,6 +205,15 @@ name = "Source View"; sourceTree = ""; }; + 1E9582640E252480001A3D89 /* Preferences */ = { + isa = PBXGroup; + children = ( + 1E9582650E2524AD001A3D89 /* PreferencesController.h */, + 1E9582660E2524AD001A3D89 /* PreferencesController.m */, + ); + name = Preferences; + sourceTree = ""; + }; 29B97314FDCFA39411CA2CEA /* MacGDBp */ = { isa = PBXGroup; children = ( @@ -298,6 +314,7 @@ 1E416FF90D36F821009A53A2 /* MainMenu.xib in Resources */, 1EEE875D0D9DE4B4009CBA7C /* MacGDBp.icns in Resources */, 1E1E53030DF9B89800D334F9 /* Breakpoints.xib in Resources */, + 1E9582620E252474001A3D89 /* Preferences.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -338,6 +355,7 @@ 1E822CDD0DA28AC30027A23F /* Breakpoint.m in Sources */, 1E4C7AF90DA401C7000A9DC7 /* BreakpointManager.m in Sources */, 1EFF70C30DFDC018006B9D33 /* BreakpointWindowController.m in Sources */, + 1E9582670E2524AD001A3D89 /* PreferencesController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -368,6 +386,14 @@ name = MainMenu.xib; sourceTree = ""; }; + 1E9582600E252474001A3D89 /* Preferences.xib */ = { + isa = PBXVariantGroup; + children = ( + 1E9582610E252474001A3D89 /* English */, + ); + name = Preferences.xib; + sourceTree = ""; + }; 1EEBFBE30D34C793008F835B /* Debugger.xib */ = { isa = PBXVariantGroup; children = ( diff --git a/Source/AppDelegate.h b/Source/AppDelegate.h index 4d64faa..1b56a78 100644 --- a/Source/AppDelegate.h +++ b/Source/AppDelegate.h @@ -17,11 +17,13 @@ #import #import "DebuggerWindowController.h" #import "BreakpointWindowController.h" +#import "PreferencesController.h" @interface AppDelegate : NSObject { DebuggerWindowController *debugger; BreakpointWindowController *breakpoint; + PreferencesController *prefs; IBOutlet NSWindow *updateWindow; IBOutlet NSTextField *updateString; @@ -32,6 +34,7 @@ - (IBAction)showDebuggerWindow:(id)sender; - (IBAction)showBreakpointWindow:(id)sender; +- (IBAction)showPreferences:(id)sender; - (IBAction)openHelpPage:(id)sender; diff --git a/Source/AppDelegate.m b/Source/AppDelegate.m index 8d44e1a..64f98e4 100644 --- a/Source/AppDelegate.m +++ b/Source/AppDelegate.m @@ -59,6 +59,17 @@ [[breakpoint window] makeKeyAndOrderFront:self]; } +/** + * Shows the preferences window. Lazily loads the PreferencesController. + */ +- (IBAction)showPreferences:(id)sender +{ + if (!prefs) + prefs = [[PreferencesController alloc] init]; + + [[prefs window] makeKeyAndOrderFront:self]; +} + /** * Opens the URL to the help page */ diff --git a/Source/PreferencesController.h b/Source/PreferencesController.h new file mode 100644 index 0000000..2208922 --- /dev/null +++ b/Source/PreferencesController.h @@ -0,0 +1,25 @@ +/* + * MacGDBp + * Copyright (c) 2007 - 2008, Blue Static + * + * This program is free software; you can redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program; if not, + * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#import + + +@interface PreferencesController : NSWindowController +{ + +} + +@end diff --git a/Source/PreferencesController.m b/Source/PreferencesController.m new file mode 100644 index 0000000..b0c6277 --- /dev/null +++ b/Source/PreferencesController.m @@ -0,0 +1,33 @@ +/* + * MacGDBp + * Copyright (c) 2007 - 2008, Blue Static + * + * This program is free software; you can redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program; if not, + * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#import "PreferencesController.h" + + +@implementation PreferencesController + +/** + * Loads the NIB and shows the preferences + */ +- (id)init +{ + if (self = [super initWithWindowNibName:@"Preferences"]) + { + } + return self; +} + +@end -- 2.22.5