From 6af4400bf62165deeaf33bfed56102986b72695c Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 6 Feb 2009 00:57:00 -0500 Subject: [PATCH] Add a custom NSArrayController for the paths preferences so we can customize the default dictionary values * English.lproj/Preferences.xib: Update the bindings * Source/PreferencesPathsArrayController.h+m: New files * MacGDBp.xcodeproj/project.pbxproj: Project updates for new files --- English.lproj/Preferences.xib | 300 ++++++++++++----------- MacGDBp.xcodeproj/project.pbxproj | 6 + Source/PreferencesPathsArrayController.h | 24 ++ Source/PreferencesPathsArrayController.m | 33 +++ 4 files changed, 222 insertions(+), 141 deletions(-) create mode 100644 Source/PreferencesPathsArrayController.h create mode 100644 Source/PreferencesPathsArrayController.m diff --git a/English.lproj/Preferences.xib b/English.lproj/Preferences.xib index 3044de2..05dc21e 100644 --- a/English.lproj/Preferences.xib +++ b/English.lproj/Preferences.xib @@ -8,7 +8,7 @@ 353.00 YES - + YES @@ -77,7 +77,7 @@ YES 0 - + 7E7339A3-79C3-4087-B2F7-2479CFD10818 @@ -166,12 +166,12 @@ - + YES - + @@ -224,7 +224,7 @@ 6 System controlColor - + 3 MC42NjY2NjY2OQA @@ -258,7 +258,7 @@ 6 System textBackgroundColor - + 3 MQA @@ -333,43 +333,43 @@ NSView - + 268 YES - - + + 268 YES - - + + 2304 YES - - + + 256 {427, 175} - + YES - - + + 256 {427, 17} - - + + - - + + -2147483392 {{-26, 0}, {16, 17}} - + YES - + 2.050000e+02 4.000000e+01 1.000000e+03 @@ -382,37 +382,37 @@ 1.100000e+01 3100 - + 3 MC4zMzMzMzI5OQA - + 6 System headerTextColor - + 337772096 2048 Text Cell - - + + 6 System controlBackgroundColor - + 3 YES YES - + - + 2.160000e+02 4.000000e+01 1.000000e+03 @@ -421,27 +421,27 @@ 0 Replacement - - + + - + 337772096 2048 Text Cell - - + + 3 YES YES - + 3.000000e+00 2.000000e+00 - + 6 System @@ -452,7 +452,7 @@ 1.700000e+01 - 1388314624 + 1522532352 4 15 0 @@ -460,71 +460,71 @@ {{1, 17}, {427, 175}} - - - - + + + + 4 - - + + -2147483392 {{411, 17}, {15, 160}} - - + + _doScroller: 9.142857e-01 - - + + -2147483392 {{1, 177}, {411, 15}} - + 1 - + _doScroller: 1.000000e+00 9.976526e-01 - - + + 2304 YES - + {{1, 0}, {427, 17}} - - - - + + + + 4 - + {{-1, 20}, {429, 193}} - - + + 562 - - - - - + + + + + QSAAAEEgAABBmAAAQZgAAA - - + + 268 {{-1, -1}, {26, 23}} - + YES - + -2080244224 134217728 - + -2033434369 162 @@ -537,18 +537,18 @@ 75 - - + + 268 {{24, -1}, {26, 23}} - + YES - + -2080244224 134217728 - + -2033434369 162 @@ -566,7 +566,7 @@ NSView - + YES local @@ -669,7 +669,7 @@ showPaths: - + 51 @@ -677,7 +677,7 @@ pathsPreferencesItem - + 52 @@ -685,17 +685,17 @@ pathsPreferencesView - + 54 contentArray: values.PathReplacements - + - + contentArray: values.PathReplacements contentArray @@ -712,11 +712,11 @@ value: arrangedObjects.local - - + + - - + + value: arrangedObjects.local value arrangedObjects.local @@ -728,11 +728,11 @@ value: arrangedObjects.remote - - + + - - + + value: arrangedObjects.remote value arrangedObjects.remote @@ -743,19 +743,27 @@ - add: - - + remove: + + - 85 + 86 - remove: - - + add: + + - 86 + 89 + + + + content + + + + 90 @@ -818,7 +826,7 @@ - + @@ -923,117 +931,117 @@ 50 - + 53 - + YES - - - + + + PathsPreferences 55 - + YES - - - - + + + + - + 56 - - + + 57 - - + + 58 - + YES - - + + - + 59 - - + + 60 - + YES - + - + 61 - + YES - + - + 62 - - + + 63 - - + + 64 - + YES - + - + 65 - - + + 66 - + YES - + - + 67 - - + + 78 - + Paths Controller @@ -1088,6 +1096,7 @@ 65.IBPluginDependency 66.IBPluginDependency 67.IBPluginDependency + 78.CustomClassName 78.IBPluginDependency @@ -1137,6 +1146,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + PreferencesPathsArrayController com.apple.InterfaceBuilder.CocoaPlugin @@ -1160,7 +1170,7 @@ - 86 + 90 @@ -1219,6 +1229,14 @@ Source/PreferencesController.h + + PreferencesPathsArrayController + NSArrayController + + IBProjectSource + Source/PreferencesPathsArrayController.h + + 0 diff --git a/MacGDBp.xcodeproj/project.pbxproj b/MacGDBp.xcodeproj/project.pbxproj index a5c7d59..0d25f46 100644 --- a/MacGDBp.xcodeproj/project.pbxproj +++ b/MacGDBp.xcodeproj/project.pbxproj @@ -18,6 +18,7 @@ 1E35FEA10C6599040030F527 /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E35FEA00C6599040030F527 /* base64.c */; }; 1E416FF90D36F821009A53A2 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1E416FF60D36F821009A53A2 /* MainMenu.xib */; }; 1E4C7AF90DA401C7000A9DC7 /* BreakpointManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E4C7AF80DA401C7000A9DC7 /* BreakpointManager.m */; }; + 1E67E6FD0F3C052000E68F1B /* PreferencesPathsArrayController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E67E6FC0F3C052000E68F1B /* PreferencesPathsArrayController.m */; }; 1E7188680D839F6300969277 /* BSLineNumberView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E7188630D839F6300969277 /* BSLineNumberView.m */; }; 1E7188690D839F6300969277 /* BSSourceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E7188650D839F6300969277 /* BSSourceView.m */; }; 1E71886A0D839F6300969277 /* BSSourceViewTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E7188670D839F6300969277 /* BSSourceViewTextView.m */; }; @@ -75,6 +76,8 @@ 1E416FF70D36F821009A53A2 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 1E4C7AF70DA401C7000A9DC7 /* BreakpointManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointManager.h; path = Source/BreakpointManager.h; sourceTree = ""; }; 1E4C7AF80DA401C7000A9DC7 /* BreakpointManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BreakpointManager.m; path = Source/BreakpointManager.m; sourceTree = ""; }; + 1E67E6FB0F3C052000E68F1B /* PreferencesPathsArrayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PreferencesPathsArrayController.h; path = Source/PreferencesPathsArrayController.h; sourceTree = ""; }; + 1E67E6FC0F3C052000E68F1B /* PreferencesPathsArrayController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PreferencesPathsArrayController.m; path = Source/PreferencesPathsArrayController.m; sourceTree = ""; }; 1E7188620D839F6300969277 /* BSLineNumberView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BSLineNumberView.h; path = Source/BSLineNumberView.h; sourceTree = ""; }; 1E7188630D839F6300969277 /* BSLineNumberView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BSLineNumberView.m; path = Source/BSLineNumberView.m; sourceTree = ""; }; 1E7188640D839F6300969277 /* BSSourceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BSSourceView.h; path = Source/BSSourceView.h; sourceTree = ""; }; @@ -233,6 +236,8 @@ children = ( 1E9582650E2524AD001A3D89 /* PreferencesController.h */, 1E9582660E2524AD001A3D89 /* PreferencesController.m */, + 1E67E6FB0F3C052000E68F1B /* PreferencesPathsArrayController.h */, + 1E67E6FC0F3C052000E68F1B /* PreferencesPathsArrayController.m */, ); name = Preferences; sourceTree = ""; @@ -395,6 +400,7 @@ 1E9582670E2524AD001A3D89 /* PreferencesController.m in Sources */, 1EB7BED50ECF3CA90033283A /* StackFrame.m in Sources */, 1EBF4D5D0EE35F0700B62769 /* StackController.m in Sources */, + 1E67E6FD0F3C052000E68F1B /* PreferencesPathsArrayController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Source/PreferencesPathsArrayController.h b/Source/PreferencesPathsArrayController.h new file mode 100644 index 0000000..b1096ce --- /dev/null +++ b/Source/PreferencesPathsArrayController.h @@ -0,0 +1,24 @@ +/* + * MacGDBp + * Copyright (c) 2007 - 2009, 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 PreferencesPathsArrayController : NSArrayController +{ +} + +@end diff --git a/Source/PreferencesPathsArrayController.m b/Source/PreferencesPathsArrayController.m new file mode 100644 index 0000000..f2b4e31 --- /dev/null +++ b/Source/PreferencesPathsArrayController.m @@ -0,0 +1,33 @@ +/* + * MacGDBp + * Copyright (c) 2007 - 2009, 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 "PreferencesPathsArrayController.h" + + +@implementation PreferencesPathsArrayController + +/** + * Subclass to add the default values to the NSDictionary + */ +- (id)newObject +{ + NSMutableDictionary *obj = (NSMutableDictionary *)[super newObject]; + [obj setValue:@"Remote Path" forKey:@"remote"]; + [obj setValue:@"Local Path" forKey:@"local"]; + return obj; +} + +@end -- 2.22.5