BOOL active;
}
-@synthesize jsController;
-@synthesize targetController;
-@synthesize configsController;
-
- (void)didSwitchApplication:(NSNotification *)notification {
NSRunningApplication *currentApp = notification.userInfo[NSWorkspaceApplicationKey];
[self.configsController activateConfigForProcess:currentApp.localizedName];
activeMenuItem.state = sendRealEvents;
}
-- (NSUInteger)firstConfigMenuIndex {
- NSUInteger count = dockMenuBase.numberOfItems;
+- (NSInteger)firstConfigMenuIndex {
+ NSInteger count = dockMenuBase.numberOfItems;
for (int i = 0; i < count; ++i)
if ([dockMenuBase itemAtIndex:i].isSeparatorItem)
return i + 1;
}
- (void)configsChanged {
- NSUInteger removeFrom = [self firstConfigMenuIndex];
+ NSInteger removeFrom = [self firstConfigMenuIndex];
while (dockMenuBase.numberOfItems > removeFrom)
[dockMenuBase removeItemAtIndex:dockMenuBase.numberOfItems - 1];
for (Config *config in self.configsController.configs)
[dockMenuBase addItemWithTitle:config.name action:@selector(chooseConfig:) keyEquivalent:@""];
+ [_targetController refreshConfigs];
[self configChanged];
}
- (void)configChanged {
- NSUInteger firstConfig = [self firstConfigMenuIndex];
+ NSInteger firstConfig = [self firstConfigMenuIndex];
Config *current = self.configsController.currentConfig;
NSArray *configs = self.configsController.configs;
for (int i = 0; i < configs.count; ++i)
}
- (void)chooseConfig:(id)sender {
- int idx = [dockMenuBase indexOfItem:sender] - [self firstConfigMenuIndex];
+ NSInteger idx = [dockMenuBase indexOfItem:sender] - [self firstConfigMenuIndex];
Config *chosen = self.configsController.configs[idx];
- [configsController activateConfig:chosen];
+ [_configsController activateConfig:chosen];
}
@end