From 9fc507268a5158ae0045b753a288f2df6500e0c5 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 22 Jan 2011 23:45:03 +0000 Subject: - Manually restore autosave value for bundle editor splitview width, as this doesn't appear to be restored automatically - Remove unused delegate methods --- Interfaces/English.lproj/BundleEditor.xib | 509 ++++++++++++++++++++++++++---- Source/SPBundleEditorController.h | 4 +- Source/SPBundleEditorController.m | 33 +- 3 files changed, 469 insertions(+), 77 deletions(-) diff --git a/Interfaces/English.lproj/BundleEditor.xib b/Interfaces/English.lproj/BundleEditor.xib index 1ed260c6..d1ad8f4d 100644 --- a/Interfaces/English.lproj/BundleEditor.xib +++ b/Interfaces/English.lproj/BundleEditor.xib @@ -27,9 +27,9 @@ YES - com.brandonwalkin.BWToolkit net.wafflesoftware.ShortcutRecorder.IB.Leopard com.apple.InterfaceBuilder.CocoaPlugin + com.brandonwalkin.BWToolkit YES @@ -59,7 +59,7 @@ Bundle Editor NSWindow - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} {691, 444} @@ -321,7 +321,7 @@ controlBackgroundColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -1380,7 +1380,7 @@ SPBundleEditorSplitView 1 - MC42NjY2NjY2ODY1IDAuNjY2NjY2Njg2NSAwLjY2NjY2NjY4NjUAA + MC42NjY2NjY2NjY3IDAuNjY2NjY2NjY2NyAwLjY2NjY2NjY2NjcAA YES @@ -1444,7 +1444,7 @@ {{0, 0}, {1920, 1058}} {691, 466} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} SPBundleEditor @@ -1509,7 +1509,7 @@ Window NSPanel - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} {341, 198} @@ -1700,7 +1700,7 @@ {{0, 0}, {1280, 778}} {341, 214} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} @@ -2260,14 +2260,6 @@ 1028 - - - bundleDataView - - - - 1035 - helpButton @@ -2574,11 +2566,11 @@ - splitViewButtonBar + splitView - + - 1129 + 1130 @@ -4051,7 +4043,7 @@ - 1129 + 1130 @@ -4072,10 +4064,10 @@ - NSObject + NSMenu IBProjectSource - Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h + Source/SPMenuAdditions.h @@ -4159,6 +4151,143 @@ Source/SPTablesList.h + + NSTextView + + YES + + YES + doDecomposedStringWithCanonicalMapping: + doDecomposedStringWithCompatibilityMapping: + doPrecomposedStringWithCanonicalMapping: + doPrecomposedStringWithCompatibilityMapping: + doRemoveDiacritics: + doSelectionLowerCase: + doSelectionTitleCase: + doSelectionUpperCase: + doTranspose: + executeBundleItemForInputField: + insertNULLvalue: + moveSelectionLineDown: + moveSelectionLineUp: + selectCurrentLine: + selectCurrentWord: + selectEnclosingBrackets: + + + YES + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + id + + + + YES + + YES + doDecomposedStringWithCanonicalMapping: + doDecomposedStringWithCompatibilityMapping: + doPrecomposedStringWithCanonicalMapping: + doPrecomposedStringWithCompatibilityMapping: + doRemoveDiacritics: + doSelectionLowerCase: + doSelectionTitleCase: + doSelectionUpperCase: + doTranspose: + executeBundleItemForInputField: + insertNULLvalue: + moveSelectionLineDown: + moveSelectionLineUp: + selectCurrentLine: + selectCurrentWord: + selectEnclosingBrackets: + + + YES + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + executeBundleItemForInputField: + id + + + insertNULLvalue: + id + + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + + + IBProjectSource + Source/SPTextViewAdditions.h + + NSWindow @@ -4166,9 +4295,6 @@ Source/SPWindowAdditions.h - - - YES SPBundleCommandTextView NSTextView @@ -4184,8 +4310,8 @@ - IBDocumentRelativeSource - ../../Source/SPBundleCommandTextView.h + IBProjectSource + Source/SPBundleCommandTextView.h @@ -4342,7 +4468,6 @@ addButton authorLabelField authorTextField - bundleDataView cancelButton categoryTextField commandBundleTreeController @@ -4369,7 +4494,7 @@ saveButton scopePopupButton showHideMetaButton - splitViewButtonBar + splitView tooltipTextField triggerPopupButton undeleteSheet @@ -4382,7 +4507,6 @@ NSButton NSTextField NSTextField - NSView NSButton NSTextField NSTreeController @@ -4409,7 +4533,7 @@ NSButton NSPopUpButton NSButton - BWAnchoredButtonBar + BWSplitView NSTextField NSPopUpButton id @@ -4425,7 +4549,6 @@ addButton authorLabelField authorTextField - bundleDataView cancelButton categoryTextField commandBundleTreeController @@ -4452,7 +4575,7 @@ saveButton scopePopupButton showHideMetaButton - splitViewButtonBar + splitView tooltipTextField triggerPopupButton undeleteSheet @@ -4474,10 +4597,6 @@ authorTextField NSTextField - - bundleDataView - NSView - cancelButton NSButton @@ -4583,8 +4702,8 @@ NSButton - splitViewButtonBar - BWAnchoredButtonBar + splitView + BWSplitView tooltipTextField @@ -4613,21 +4732,72 @@ - IBDocumentRelativeSource - ../../Source/SPBundleEditorController.h + IBProjectSource + Source/SPBundleEditorController.h SPOutlineView NSOutlineView - IBDocumentRelativeSource - ../../Source/SPOutlineView.h + IBProjectSource + Source/SPOutlineView.h YES + + BWAnchoredButtonBar + NSView + + IBFrameworkSource + BWToolkitFramework.framework/Headers/BWAnchoredButtonBar.h + + + + BWAnchoredPopUpButton + NSPopUpButton + + IBFrameworkSource + BWToolkitFramework.framework/Headers/BWAnchoredPopUpButton.h + + + + BWAnchoredPopUpButtonCell + NSPopUpButtonCell + + IBFrameworkSource + BWToolkitFramework.framework/Headers/BWAnchoredPopUpButtonCell.h + + + + BWSplitView + NSSplitView + + toggleCollapse: + id + + + toggleCollapse: + + toggleCollapse: + id + + + + IBFrameworkSource + BWToolkitFramework.framework/Headers/BWSplitView.h + + + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + NSApplication NSResponder @@ -4678,6 +4848,54 @@ BWToolkitFramework.framework/Headers/NSApplication+BWAdditions.h + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSController + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSController.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + NSMenu NSObject @@ -4686,6 +4904,22 @@ AppKit.framework/Headers/NSMenu.h + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + NSObject @@ -4707,10 +4941,7 @@ NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - + NSObject @@ -4760,7 +4991,7 @@ NSObject - + IBFrameworkSource AppKit.framework/Headers/NSOutlineView.h @@ -4781,7 +5012,7 @@ NSObject - + IBFrameworkSource AppKit.framework/Headers/NSTableView.h @@ -4954,6 +5185,27 @@ PrintCore.framework/Headers/PDEPluginInterface.h + + NSObject + + IBFrameworkSource + ShortcutRecorder.framework/Headers/SRRecorderCell.h + + + + NSObject + + IBFrameworkSource + ShortcutRecorder.framework/Headers/SRRecorderControl.h + + + + NSObject + + IBFrameworkSource + ShortcutRecorder.framework/Headers/SRValidator.h + + NSObject @@ -5038,6 +5290,43 @@ WebKit.framework/Headers/WebUIDelegate.h + + NSObjectController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSObjectController.h + + + + NSOutlineView + NSTableView + + + + NSPanel + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSPanel.h + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + NSResponder @@ -5054,19 +5343,101 @@ - NSView + NSScrollView + NSView IBFrameworkSource - AppKit.framework/Headers/NSClipView.h + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableHeaderView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTableHeaderView.h + + + + NSTableView + NSControl + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSTreeController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSTreeController.h NSView IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h + AppKit.framework/Headers/NSClipView.h + + NSView + + NSView @@ -5134,6 +5505,38 @@ AppKit.framework/Headers/NSWindowController.h + + SRRecorderCell + NSActionCell + + delegate + id + + + delegate + + delegate + id + + + + + + SRRecorderControl + NSControl + + delegate + id + + + delegate + + delegate + id + + + + 0 @@ -5170,8 +5573,8 @@ {9, 8} {7, 2} {15, 15} - {128, 128} - {128, 128} + {32, 23} + {32, 23} diff --git a/Source/SPBundleEditorController.h b/Source/SPBundleEditorController.h index d8c2d5df..1c3c0dab 100644 --- a/Source/SPBundleEditorController.h +++ b/Source/SPBundleEditorController.h @@ -27,7 +27,7 @@ #import "SPBundleCommandTextView.h" #import "SPOutlineView.h" -@class SRRecorderControl, BWAnchoredButtonBar; +@class SRRecorderControl, BWSplitView; @interface SPBundleEditorController : NSWindowController { @@ -63,7 +63,7 @@ IBOutlet NSButton *disabledCheckbox; IBOutlet NSScrollView *commandScrollView; IBOutlet NSScrollView *descriptionScrollView; - IBOutlet BWAnchoredButtonBar *splitViewButtonBar; + IBOutlet BWSplitView *splitView; IBOutlet id undeleteSheet; IBOutlet NSTableView *undeleteTableView; diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index a4a9a36b..279002f4 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -38,6 +38,8 @@ #define SP_BUNDLEEDITOR_SCOPE_GENERAL_STRING NSLocalizedString(@"General", @"Bundle Editor : Scope dropdown : 'general' item") #define SP_BUNDLEEDITOR_OUTLINE_BUNDLE_TOOLTIP_STRING NSLocalizedString(@"“%@” Bundle",@"Bundle Editor : Outline View : Bundle item : tooltip") +#define SP_BUNDLEEDITOR_SPLITVIEW_AUTOSAVE_STRING @"SPBundleEditorSplitView" + @interface SPBundleEditorController (PrivateAPI) - (void)_updateBundleDataView; @@ -116,6 +118,15 @@ - (void)awakeFromNib { + // Set up the splitview width manually; autosave appears to save but not restore this value + // here, so restore in code if present. + NSString *splitViewKeyName = [NSString stringWithFormat:@"NSSplitView Subview Frames %@", SP_BUNDLEEDITOR_SPLITVIEW_AUTOSAVE_STRING]; + if ([[NSUserDefaults standardUserDefaults] arrayForKey:splitViewKeyName]) { + NSString *detailString = [[[NSUserDefaults standardUserDefaults] arrayForKey:splitViewKeyName] objectAtIndex:0]; + float dividerPosition = [[[detailString componentsSeparatedByString:@", "] objectAtIndex:2] floatValue]; + [splitView setPosition:dividerPosition ofDividerAtIndex:0]; + } + // Init all needed variables; popup menus (with the chance for localization); and set // defaults @@ -363,9 +374,6 @@ [deletedDefaultBundles setArray:[[NSUserDefaults standardUserDefaults] objectForKey:SPBundleDeletedDefaultBundlesKey]]; } - // Set the button bar delegate - [splitViewButtonBar setSplitViewDelegate:self]; - [self _initTree]; } @@ -1190,25 +1198,6 @@ } -#pragma mark - -#pragma mark SplitView delegate methods - -/** - * Return the maximum possible size of the splitview. - */ -- (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)offset -{ - return (proposedMax - 240); -} - -/** - * Return the minimum possible size of the splitview. - */ -- (CGFloat)splitView:(NSSplitView *)sender constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)offset -{ - return (proposedMin + 120); -} - #pragma mark - #pragma mark TableView delegates -- cgit v1.2.3