mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 16:22:21 +00:00
Partially converted to modern Objective-C
Signed-off-by: michael starke <michael.starke@hicknhack-software.com>
This commit is contained in:
@@ -106,10 +106,18 @@
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
self.cell.controlSize = controlSize;
|
if([self.superclass instancesRespondToSelector:@selector(setControlSize:)]) {
|
||||||
|
super.controlSize = controlSize;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
self.cell.controlSize = controlSize;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSControlSize)controlSize {
|
- (NSControlSize)controlSize {
|
||||||
|
if([self.superclass instancesRespondToSelector:@selector(controlSize)]) {
|
||||||
|
return super.controlSize;
|
||||||
|
}
|
||||||
return self.cell.controlSize;
|
return self.cell.controlSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (NSControlSize)controlSize {
|
- (NSControlSize)controlSize {
|
||||||
|
if([self.superclass instancesRespondToSelector:@selector(controlSize)]) {
|
||||||
|
return super.controlSize;
|
||||||
|
}
|
||||||
return self.cell.controlSize;
|
return self.cell.controlSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
if(validateTarget) {
|
if(validateTarget) {
|
||||||
isValid &= [validateTarget validateToolbarItem:self];
|
isValid &= [validateTarget validateToolbarItem:self];
|
||||||
}
|
}
|
||||||
[self setEnabled:isValid];
|
self.enabled = isValid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ FOUNDATION_EXPORT NSString *const MPErrorDomain;
|
|||||||
|
|
||||||
+ (NSError *)errorWithCode:(NSInteger)code description:(NSString *)description;
|
+ (NSError *)errorWithCode:(NSInteger)code description:(NSString *)description;
|
||||||
|
|
||||||
- (NSString *)descriptionForErrorCode;
|
@property (nonatomic, readonly, copy) NSString *descriptionForErrorCode;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ NSString *const MPErrorDomain = @"com.hicknhack.macpass.error";
|
|||||||
@implementation NSError (Messages)
|
@implementation NSError (Messages)
|
||||||
|
|
||||||
- (NSString *)descriptionForErrorCode {
|
- (NSString *)descriptionForErrorCode {
|
||||||
return [NSString stringWithFormat:@"%@ (%ld)", [self localizedDescription], [self code] ];
|
return [NSString stringWithFormat:@"%@ (%ld)", self.localizedDescription, self.code ];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSError *)errorWithCode:(NSInteger)code description:(NSString *)description {
|
+ (NSError *)errorWithCode:(NSInteger)code description:(NSString *)description {
|
||||||
|
|||||||
Reference in New Issue
Block a user