diff --git a/MacPass/MPContextToolbarButton.h b/MacPass/MPContextToolbarButton.h new file mode 100644 index 00000000..413239ec --- /dev/null +++ b/MacPass/MPContextToolbarButton.h @@ -0,0 +1,14 @@ +// +// MPSegmentedToolbarButton.h +// MacPass +// +// Created by Michael Starke on 26.07.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import + +@interface MPContextToolbarButton : NSSegmentedControl + +- (void)setImage:(NSImage *)image; +@end diff --git a/MacPass/MPContextToolbarButton.m b/MacPass/MPContextToolbarButton.m new file mode 100644 index 00000000..91181f3b --- /dev/null +++ b/MacPass/MPContextToolbarButton.m @@ -0,0 +1,46 @@ +// +// MPSegmentedToolbarButton.m +// MacPass +// +// Created by Michael Starke on 26.07.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPContextToolbarButton.h" + +@implementation MPContextToolbarButton + +- (id)initWithFrame:(NSRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self setFocusRingType:NSFocusRingTypeNone]; + [self setSegmentCount:1]; + //[[self cell] setWidth:15 forSegment:1]; + [[self cell] setTrackingMode:NSSegmentSwitchTrackingMomentary]; + [self setSegmentStyle:NSSegmentStyleTexturedSquare]; + } + + return self; +} +/* + Block the segment setter to prevent accidential settings + */ +- (void)setImage:(NSImage *)image forSegment:(NSInteger)segment { + if(segment == 0) { + [super setImage:image forSegment:segment]; + } +} + +- (void)setSegmentCount:(NSInteger)count { + if(count == 1) { + [super setSegmentCount:count]; + } +} + +- (void)setImage:(NSImage *)image { + [self setImage:image forSegment:0]; +} + + + +@end diff --git a/MacPass/MPLoggerProxy.h b/MacPass/MPLoggerProxy.h deleted file mode 100644 index 9f511597..00000000 --- a/MacPass/MPLoggerProxy.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// MPLoggerProxy.h -// MacPass -// -// Created by michael starke on 26.02.13. -// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. -// - -#import - -@interface MPLoggerProxy : NSObject -@property (strong) id original; - -- (id)initWithOriginal:(id) value; - -@end diff --git a/MacPass/MPLoggerProxy.m b/MacPass/MPLoggerProxy.m deleted file mode 100644 index eabc4622..00000000 --- a/MacPass/MPLoggerProxy.m +++ /dev/null @@ -1,35 +0,0 @@ -// -// MPLoggerProxy.m -// MacPass -// -// Created by michael starke on 26.02.13. -// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. -// - -#import "MPLoggerProxy.h" - -@implementation MPLoggerProxy - -- (id) initWithOriginal:(id)value { - if (self = [super init]) { - self.original = value; - } - return self; -} - -- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel { - NSMethodSignature *sig = [super methodSignatureForSelector:sel]; - if(!sig) - { - sig = [self.original methodSignatureForSelector:sel]; - } - return sig; -} - -- (void)forwardInvocation:(NSInvocation *)inv { - NSLog(@"[%@ %@] %@ %@", self.original, inv,[inv methodSignature], - NSStringFromSelector([inv selector])); - [inv invokeWithTarget:self.original]; -} - -@end diff --git a/MacPass/NSString+PasswordStrength.h b/MacPass/NSString+PasswordStrength.h deleted file mode 100644 index df7eaab2..00000000 --- a/MacPass/NSString+PasswordStrength.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// NSString+MPPasswordAnalysis.h -// MacPass -// -// Created by Michael Starke on 29.03.13. -// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. -// - -#import - - -@interface NSString (PasswordStrenght) - -- (NSUInteger)passwordStrenght; - - -@end diff --git a/MacPass/NSString+PasswordStrength.m b/MacPass/NSString+PasswordStrength.m deleted file mode 100644 index 5dc95086..00000000 --- a/MacPass/NSString+PasswordStrength.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// NSString+MPPasswordAnalysis.m -// MacPass -// -// Created by Michael Starke on 29.03.13. -// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. -// - -#import "NSString+PasswordStrength.h" - -@implementation NSString (PasswordStrenght) - -- (NSUInteger)passwordStrenght { - return 0; -} - -@end