From: Joe Wreschnig Date: Fri, 1 Mar 2013 17:01:48 +0000 (+0100) Subject: Fix incorrect config list when there are duplicate names. X-Git-Tag: version-1.0~70 X-Git-Url: https://git.yukkurigames.com/?a=commitdiff_plain;h=32ca88087708a8b1f7e65ecbea6c5fd6690431d3;p=enjoyable.git Fix incorrect config list when there are duplicate names. --- diff --git a/TargetController.m b/TargetController.m index 9aad491..86fe968 100644 --- a/TargetController.m +++ b/TargetController.m @@ -212,9 +212,14 @@ - (void)refreshConfigs { // TODO: This doesn't work when removing configs. NSInteger initialIndex = configPopup.indexOfSelectedItem; - [configPopup removeAllItems]; - for (Config *config in configsController.configs) - [configPopup addItemWithTitle:config.name]; + [configPopup.menu removeAllItems]; + for (Config *config in configsController.configs) { + NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:config.name + action:@selector(configChosen:) + keyEquivalent:@""]; + item.target = self; + [configPopup.menu addItem:item]; + } [configPopup selectItemAtIndex:initialIndex]; }