diff options
author | avenjamin <avenjamin@gmail.com> | 2009-06-24 15:46:27 +0000 |
---|---|---|
committer | avenjamin <avenjamin@gmail.com> | 2009-06-24 15:46:27 +0000 |
commit | 5b05f3f15aa0676f91bc1d127d31f4fd95ef9f40 (patch) | |
tree | f0eaf423f2c13f2091fe9cfceaa2e0a6f2169723 /Frameworks/BWToolkitFramework.framework/BWSelectableToolbarHelper.m | |
parent | 37bd86b2879c107ebb026954693540979cf25e2a (diff) | |
download | sequelpro-5b05f3f15aa0676f91bc1d127d31f4fd95ef9f40.tar.gz sequelpro-5b05f3f15aa0676f91bc1d127d31f4fd95ef9f40.tar.bz2 sequelpro-5b05f3f15aa0676f91bc1d127d31f4fd95ef9f40.zip |
- Changed the way the BWToolkit framework was included to allow modifications to be made easily.
- Fixed show/hide info pane toggle button image states to now show correctly
Diffstat (limited to 'Frameworks/BWToolkitFramework.framework/BWSelectableToolbarHelper.m')
-rw-r--r-- | Frameworks/BWToolkitFramework.framework/BWSelectableToolbarHelper.m | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/Frameworks/BWToolkitFramework.framework/BWSelectableToolbarHelper.m b/Frameworks/BWToolkitFramework.framework/BWSelectableToolbarHelper.m new file mode 100644 index 00000000..acdea38a --- /dev/null +++ b/Frameworks/BWToolkitFramework.framework/BWSelectableToolbarHelper.m @@ -0,0 +1,84 @@ +// +// BWSelectableToolbarHelper.m +// BWToolkit +// +// Created by Brandon Walkin (www.brandonwalkin.com) +// All code is provided under the New BSD license. +// + +#import "BWSelectableToolbarHelper.h" + +@implementation BWSelectableToolbarHelper + +@synthesize contentViewsByIdentifier; +@synthesize windowSizesByIdentifier; +@synthesize selectedIdentifier; +@synthesize oldWindowTitle; +@synthesize initialIBWindowSize; +@synthesize isPreferencesToolbar; + +- (id)init +{ + if(self = [super init]) + { + if (contentViewsByIdentifier == nil) + contentViewsByIdentifier = [[NSMutableDictionary alloc] init]; + + if (windowSizesByIdentifier == nil) + windowSizesByIdentifier = [[NSMutableDictionary alloc] init]; + + if (selectedIdentifier == nil) + selectedIdentifier = [[NSString alloc] init]; + + if (oldWindowTitle == nil) + oldWindowTitle = [[NSString alloc] init]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)decoder; +{ + if ((self = [super init]) != nil) + { + [self setContentViewsByIdentifier:[decoder decodeObjectForKey:@"BWSTHContentViewsByIdentifier"]]; + + NSData *data = [decoder decodeObjectForKey:@"BWSTHWindowSizesByIdentifier"]; + [self setWindowSizesByIdentifier:[NSUnarchiver unarchiveObjectWithData:data]]; + + [self setSelectedIdentifier:[decoder decodeObjectForKey:@"BWSTHSelectedIdentifier"]]; + + [self setOldWindowTitle:[decoder decodeObjectForKey:@"BWSTHOldWindowTitle"]]; + + [self setInitialIBWindowSize:[decoder decodeSizeForKey:@"BWSTHInitialIBWindowSize"]]; + + [self setIsPreferencesToolbar:[decoder decodeBoolForKey:@"BWSTHIsPreferencesToolbar"]]; + } + return self; +} + +- (void)encodeWithCoder:(NSCoder*)coder +{ + [coder encodeObject:[self contentViewsByIdentifier] forKey:@"BWSTHContentViewsByIdentifier"]; + + NSData *data = [NSArchiver archivedDataWithRootObject:[self windowSizesByIdentifier]]; + [coder encodeObject:data forKey:@"BWSTHWindowSizesByIdentifier"]; + + [coder encodeObject:[self selectedIdentifier] forKey:@"BWSTHSelectedIdentifier"]; + + [coder encodeObject:[self oldWindowTitle] forKey:@"BWSTHOldWindowTitle"]; + + [coder encodeSize:[self initialIBWindowSize] forKey:@"BWSTHInitialIBWindowSize"]; + + [coder encodeBool:[self isPreferencesToolbar] forKey:@"BWSTHIsPreferencesToolbar"]; +} + +- (void)dealloc +{ + [contentViewsByIdentifier release]; + [windowSizesByIdentifier release]; + [selectedIdentifier release]; + [oldWindowTitle release]; + [super dealloc]; +} + +@end |