From 8a7999648d97e3040d2ac820b612265f8a07c92f Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Mon, 11 Mar 2013 13:24:30 +0100 Subject: [PATCH] Fix some coding style issues. --- Classes/NJKeyInputField.m | 4 ++-- Classes/NJOutputController.m | 31 ++++++++++++++++--------------- Info.plist | 2 +- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Classes/NJKeyInputField.m b/Classes/NJKeyInputField.m index a03f238..f4525e5 100644 --- a/Classes/NJKeyInputField.m +++ b/Classes/NJKeyInputField.m @@ -14,8 +14,8 @@ CGKeyCode NJKeyInputFieldEmpty = 0xFFFF; - (id)initWithFrame:(NSRect)frameRect { if ((self = [super initWithFrame:frameRect])) { self.alignment = NSCenterTextAlignment; - [self setEditable:NO]; - [self setSelectable:NO]; + self.editable = NO; + self.selectable = NO; } return self; } diff --git a/Classes/NJOutputController.m b/Classes/NJOutputController.m index 0bb335f..6ae58d4 100644 --- a/Classes/NJOutputController.m +++ b/Classes/NJOutputController.m @@ -145,11 +145,12 @@ [radioButtons selectCellAtRow:5 column:0]; [sender.window makeFirstResponder:sender]; if (sender.state == NSOnState) { - scrollSpeedSlider.floatValue = (scrollSpeedSlider.maxValue - scrollSpeedSlider.minValue) / 2; - [scrollSpeedSlider setEnabled:YES]; + scrollSpeedSlider.floatValue = + scrollSpeedSlider.minValue + (scrollSpeedSlider.maxValue - scrollSpeedSlider.minValue) / 2; + scrollSpeedSlider.enabled = YES; } else { scrollSpeedSlider.floatValue = scrollSpeedSlider.minValue; - [scrollSpeedSlider setEnabled:NO]; + scrollSpeedSlider.enabled = NO; } [self commit]; } @@ -206,19 +207,19 @@ } - (BOOL)enabled { - return [radioButtons isEnabled]; + return radioButtons.isEnabled; } - (void)setEnabled:(BOOL)enabled { - [radioButtons setEnabled:enabled]; - [keyInput setEnabled:enabled]; - [mappingPopup setEnabled:enabled]; - [mouseDirSelect setEnabled:enabled]; - [mouseSpeedSlider setEnabled:enabled]; - [mouseBtnSelect setEnabled:enabled]; - [scrollDirSelect setEnabled:enabled]; - [smoothCheck setEnabled:enabled]; - [scrollSpeedSlider setEnabled:enabled && smoothCheck.isEnabled]; + radioButtons.enabled = enabled; + keyInput.enabled = enabled; + mappingPopup.enabled = enabled; + mouseDirSelect.enabled = enabled; + mouseSpeedSlider.enabled = enabled; + mouseBtnSelect.enabled = enabled; + scrollDirSelect.enabled = enabled; + smoothCheck.enabled = enabled; + scrollSpeedSlider.enabled = enabled && smoothCheck.state; } - (void)loadOutput:(NJOutput *)output forInput:(NJInput *)input { @@ -229,7 +230,7 @@ self.enabled = YES; NSString *inpFullName = input.name; for (id cur = input.base; cur; cur = cur.base) { - inpFullName = [[NSString alloc] initWithFormat:@"%@ > %@", cur.name, inpFullName]; + inpFullName = [[NSString alloc] initWithFormat:@"%@ ▸ %@", cur.name, inpFullName]; } title.stringValue = inpFullName; } @@ -261,7 +262,7 @@ [scrollDirSelect selectSegmentWithTag:direction]; scrollSpeedSlider.floatValue = speed; smoothCheck.state = smooth ? NSOnState : NSOffState; - [scrollSpeedSlider setEnabled:smooth]; + scrollSpeedSlider.enabled = smooth; } else { [radioButtons selectCellAtRow:self.enabled ? 0 : -1 column:0]; } diff --git a/Info.plist b/Info.plist index 0cda67c..beec610 100644 --- a/Info.plist +++ b/Info.plist @@ -46,7 +46,7 @@ CFBundleSignature ???? CFBundleVersion - 134 + 142 LSApplicationCategoryType public.app-category.utilities NSHumanReadableCopyright -- 2.30.2