aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/BWToolkitFramework.framework/BWToolbarItem.m
diff options
context:
space:
mode:
authoravenjamin <avenjamin@gmail.com>2009-06-24 15:46:27 +0000
committeravenjamin <avenjamin@gmail.com>2009-06-24 15:46:27 +0000
commit5b05f3f15aa0676f91bc1d127d31f4fd95ef9f40 (patch)
treef0eaf423f2c13f2091fe9cfceaa2e0a6f2169723 /Frameworks/BWToolkitFramework.framework/BWToolbarItem.m
parent37bd86b2879c107ebb026954693540979cf25e2a (diff)
downloadsequelpro-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/BWToolbarItem.m')
-rw-r--r--Frameworks/BWToolkitFramework.framework/BWToolbarItem.m62
1 files changed, 62 insertions, 0 deletions
diff --git a/Frameworks/BWToolkitFramework.framework/BWToolbarItem.m b/Frameworks/BWToolkitFramework.framework/BWToolbarItem.m
new file mode 100644
index 00000000..3c196d1d
--- /dev/null
+++ b/Frameworks/BWToolkitFramework.framework/BWToolbarItem.m
@@ -0,0 +1,62 @@
+//
+// BWToolbarItem.m
+// BWToolkit
+//
+// Created by Brandon Walkin (www.brandonwalkin.com)
+// All code is provided under the New BSD license.
+//
+
+#import "BWToolbarItem.h"
+#import "NSString+BWAdditions.h"
+
+@interface BWToolbarItem ()
+@property (copy) NSString *identifierString;
+@end
+
+@interface NSToolbarItem (BWTIPrivate)
+- (void)_setItemIdentifier:(id)fp8;
+- (id)initWithCoder:(NSCoder *)coder;
+- (void)encodeWithCoder:(NSCoder*)coder;
+@end
+
+@implementation BWToolbarItem
+
+@synthesize identifierString;
+
+- (id)initWithCoder:(NSCoder *)coder
+{
+ if ((self = [super initWithCoder:coder]) != nil)
+ {
+ [self setIdentifierString:[coder decodeObjectForKey:@"BWTIIdentifierString"]];
+ }
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder*)coder
+{
+ [super encodeWithCoder:coder];
+
+ [coder encodeObject:[self identifierString] forKey:@"BWTIIdentifierString"];
+}
+
+- (void)setIdentifierString:(NSString *)aString
+{
+ if (identifierString != aString)
+ {
+ [identifierString release];
+ identifierString = [aString copy];
+ }
+
+ if (identifierString == nil || [identifierString isEqualToString:@""])
+ [self _setItemIdentifier:[[NSString randomUUID] retain]];
+ else
+ [self _setItemIdentifier:identifierString];
+}
+
+- (void)dealloc
+{
+ [identifierString release];
+ [super dealloc];
+}
+
+@end