projects
/
enjoyable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
844a57b
)
Subscribe the output controller to notifications directly. Application delegate has...
author
Joe Wreschnig
<joe.wreschnig@gmail.com>
Tue, 5 Mar 2013 01:08:03 +0000
(
02:08
+0100)
committer
Joe Wreschnig
<joe.wreschnig@gmail.com>
Tue, 5 Mar 2013 01:08:03 +0000
(
02:08
+0100)
English.lproj/MainMenu.xib
patch
|
blob
|
history
EnjoyableApplicationDelegate.h
patch
|
blob
|
history
EnjoyableApplicationDelegate.m
patch
|
blob
|
history
NJOutputController.h
patch
|
blob
|
history
NJOutputController.m
patch
|
blob
|
history
diff --git
a/English.lproj/MainMenu.xib
b/English.lproj/MainMenu.xib
index
00740ba
..
cc6ba01
100644
(file)
--- a/
English.lproj/MainMenu.xib
+++ b/
English.lproj/MainMenu.xib
@@
-329,10
+329,9
@@
<string key="NSToolbarItemPaletteLabel">Mapping Selector</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="227597319">
<string key="NSToolbarItemPaletteLabel">Mapping Selector</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="227597319">
- <
reference
key="NSNextResponder"/>
+ <
nil
key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{0, 14}, {140, 25}}</string>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{0, 14}, {140, 25}}</string>
- <reference key="NSSuperview"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="850080795">
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="850080795">
@@
-378,10
+377,9
@@
<string key="NSToolbarItemPaletteLabel">Translation Switch</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSSegmentedControl" key="NSToolbarItemView" id="679083346">
<string key="NSToolbarItemPaletteLabel">Translation Switch</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSSegmentedControl" key="NSToolbarItemView" id="679083346">
- <
reference
key="NSNextResponder"/>
+ <
nil
key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{19, 14}, {67, 25}}</string>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{19, 14}, {67, 25}}</string>
- <reference key="NSSuperview"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSSegmentedCell" key="NSCell" id="594076765">
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSSegmentedCell" key="NSCell" id="594076765">
@@
-1408,14
+1406,6
@@
</object>
<int key="connectionID">820</int>
</object>
</object>
<int key="connectionID">820</int>
</object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">outputController</string>
- <reference key="source" ref="207406104"/>
- <reference key="destination" ref="801536542"/>
- </object>
- <int key="connectionID">825</int>
- </object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">window</string>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">window</string>
@@
-2413,7
+2403,6
@@
<string key="dockMenuBase">NSMenu</string>
<string key="inputController">NJDeviceController</string>
<string key="mappingsController">NJMappingsController</string>
<string key="dockMenuBase">NSMenu</string>
<string key="inputController">NJDeviceController</string>
<string key="mappingsController">NJMappingsController</string>
- <string key="outputController">NJOutputController</string>
<string key="window">NSWindow</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="window">NSWindow</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
@@
-2429,10
+2418,6
@@
<string key="name">mappingsController</string>
<string key="candidateClassName">NJMappingsController</string>
</object>
<string key="name">mappingsController</string>
<string key="candidateClassName">NJMappingsController</string>
</object>
- <object class="IBToOneOutletInfo" key="outputController">
- <string key="name">outputController</string>
- <string key="candidateClassName">NJOutputController</string>
- </object>
<object class="IBToOneOutletInfo" key="window">
<string key="name">window</string>
<string key="candidateClassName">NSWindow</string>
<object class="IBToOneOutletInfo" key="window">
<string key="name">window</string>
<string key="candidateClassName">NSWindow</string>
diff --git
a/EnjoyableApplicationDelegate.h
b/EnjoyableApplicationDelegate.h
index
6488135
..
4615d12
100644
(file)
--- a/
EnjoyableApplicationDelegate.h
+++ b/
EnjoyableApplicationDelegate.h
@@
-16,7
+16,6
@@
}
@property (nonatomic, strong) IBOutlet NJDeviceController *inputController;
}
@property (nonatomic, strong) IBOutlet NJDeviceController *inputController;
-@property (nonatomic, strong) IBOutlet NJOutputController *outputController;
@property (nonatomic, strong) IBOutlet NJMappingsController *mappingsController;
@end
@property (nonatomic, strong) IBOutlet NJMappingsController *mappingsController;
@end
diff --git
a/EnjoyableApplicationDelegate.m
b/EnjoyableApplicationDelegate.m
index
313ba9a
..
1406115
100644
(file)
--- a/
EnjoyableApplicationDelegate.m
+++ b/
EnjoyableApplicationDelegate.m
@@
-89,7
+89,6
@@
item.state = mapping == self.mappingsController.currentMapping;
[dockMenuBase addItem:item];
}
item.state = mapping == self.mappingsController.currentMapping;
[dockMenuBase addItem:item];
}
- [_outputController refreshMappings];
}
- (void)mappingDidChange:(NSNotification *)note {
}
- (void)mappingDidChange:(NSNotification *)note {
diff --git
a/NJOutputController.h
b/NJOutputController.h
index
5b9a749
..
0c6a859
100644
(file)
--- a/
NJOutputController.h
+++ b/
NJOutputController.h
@@
-28,7
+28,6
@@
@property (assign) BOOL enabled;
- (void)loadCurrent;
@property (assign) BOOL enabled;
- (void)loadCurrent;
-- (void)refreshMappings;
- (IBAction)radioChanged:(id)sender;
- (IBAction)mdirChanged:(id)sender;
- (IBAction)mbtnChanged:(id)sender;
- (IBAction)radioChanged:(id)sender;
- (IBAction)mdirChanged:(id)sender;
- (IBAction)mbtnChanged:(id)sender;
diff --git
a/NJOutputController.m
b/NJOutputController.m
index
5ceccba
..
0c301ff
100644
(file)
--- a/
NJOutputController.m
+++ b/
NJOutputController.m
@@
-10,6
+10,7
@@
#import "NJMappingsController.h"
#import "NJMapping.h"
#import "NJInput.h"
#import "NJMappingsController.h"
#import "NJMapping.h"
#import "NJInput.h"
+#import "NJEvents.h"
#import "NJDeviceController.h"
#import "NJKeyInputField.h"
#import "NJOutputMapping.h"
#import "NJDeviceController.h"
#import "NJKeyInputField.h"
#import "NJOutputMapping.h"
@@
-22,6
+23,21
@@
@implementation NJOutputController
@implementation NJOutputController
+- (id)init {
+ if ((self = [super init])) {
+ [NSNotificationCenter.defaultCenter
+ addObserver:self
+ selector:@selector(mappingListDidChange:)
+ name:NJEventMappingListChanged
+ object:nil];
+ }
+ return self;
+}
+
+- (void)dealloc {
+ [NSNotificationCenter.defaultCenter removeObserver:self];
+}
+
- (void)cleanUpInterface {
NSInteger row = radioButtons.selectedRow;
- (void)cleanUpInterface {
NSInteger row = radioButtons.selectedRow;
@@
-216,10
+232,11
@@
[keyInput resignIfFirstResponder];
}
[keyInput resignIfFirstResponder];
}
-- (void)refreshMappings {
+- (void)mappingListDidChange:(NSNotification *)note {
+ NSArray *mappings = note.object;
NJMapping *current = mappingPopup.selectedItem.representedObject;
[mappingPopup.menu removeAllItems];
NJMapping *current = mappingPopup.selectedItem.representedObject;
[mappingPopup.menu removeAllItems];
- for (NJMapping *mapping in mappings
Controller
) {
+ for (NJMapping *mapping in mappings) {
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:mapping.name
action:@selector(mappingChosen:)
keyEquivalent:@""];
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:mapping.name
action:@selector(mappingChosen:)
keyEquivalent:@""];