- }
- Target *target = configsController.currentConfig[jsaction];
-
- id act = jsaction;
- NSString* actFullName = [act name];
- while([act base]) {
- act = [act base];
- actFullName = [[NSString alloc] initWithFormat:@"%@ > %@", [act name], actFullName];
- }
- title.stringValue = [[NSString alloc] initWithFormat:@"%@ > %@", configsController.currentConfig.name, actFullName];
-
- if(!target) {
- [radioButtons setState:1 atRow:0 column:0];
- } else if([target isKindOfClass:[TargetKeyboard class]]) {
- [radioButtons setState:1 atRow:1 column:0];
- keyInput.vk = [(TargetKeyboard*)target vk];
- } else if([target isKindOfClass:[TargetConfig class]]) {
- [radioButtons setState:1 atRow:2 column:0];
- [configPopup selectItemAtIndex:[configsController.configs
- indexOfObject:[(TargetConfig *)target config]]];
+ NSString *actFullName = action.name;
+ for (id <NJActionPathElement> cur = action.base; cur; cur = cur.base) {
+ actFullName = [[NSString alloc] initWithFormat:@"%@ > %@", cur.name, actFullName];
+ }
+ title.stringValue = [[NSString alloc] initWithFormat:@"%@ > %@", configsController.currentConfig.name, actFullName];
+ }
+
+ if ([target isKindOfClass:TargetKeyboard.class]) {
+ [radioButtons selectCellAtRow:1 column:0];
+ keyInput.keyCode = [(TargetKeyboard*)target vk];
+ } else if ([target isKindOfClass:TargetConfig.class]) {
+ [radioButtons selectCellAtRow:2 column:0];
+ NSUInteger idx = [configsController.configs
+ indexOfObject:[(TargetConfig *)target config]];
+ if (idx == NSNotFound) {
+ [radioButtons selectCellAtRow:self.enabled ? 0 : -1 column:0];
+ [configPopup selectItemAtIndex:-1];
+ } else
+ [configPopup selectItemAtIndex:idx];
+ }
+ else if ([target isKindOfClass:TargetMouseMove.class]) {
+ [radioButtons selectCellAtRow:3 column:0];
+ [mouseDirSelect setSelectedSegment:[(TargetMouseMove *)target axis]];