From 5de694150d275d27119d344cbb1d61bc31d75268 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Fri, 1 Mar 2013 13:59:33 +0100 Subject: [PATCH] Add key equivalents for switching configurations. --- ApplicationController.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ApplicationController.m b/ApplicationController.m index a3ad5ed..b86a5f2 100644 --- a/ApplicationController.m +++ b/ApplicationController.m @@ -61,8 +61,14 @@ 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:@""]; + int added = 0; + for (Config *config in self.configsController.configs) { + NSString *keyEquiv = ++added < 10 ? @(added).stringValue : @""; + [dockMenuBase addItemWithTitle:config.name + action:@selector(chooseConfig:) + keyEquivalent:keyEquiv]; + + } [_targetController refreshConfigs]; [self configChanged]; } -- 2.20.1