aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-01-22 23:45:03 +0000
committerrowanbeentje <rowan@beent.je>2011-01-22 23:45:03 +0000
commit9fc507268a5158ae0045b753a288f2df6500e0c5 (patch)
tree418ad1cc9fa80c23ca4b1b80c96e9ba4e09f4a1b /Source
parent0082b12a22fcc562b8a4425d22bc69ab9aa05645 (diff)
downloadsequelpro-9fc507268a5158ae0045b753a288f2df6500e0c5.tar.gz
sequelpro-9fc507268a5158ae0045b753a288f2df6500e0c5.tar.bz2
sequelpro-9fc507268a5158ae0045b753a288f2df6500e0c5.zip
- Manually restore autosave value for bundle editor splitview width, as this doesn't appear to be restored automatically
- Remove unused delegate methods
Diffstat (limited to 'Source')
-rw-r--r--Source/SPBundleEditorController.h4
-rw-r--r--Source/SPBundleEditorController.m33
2 files changed, 13 insertions, 24 deletions
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];
}
@@ -1191,25 +1199,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
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView