Fix name conflict on setTheme

This commit is contained in:
Matthias Neeracher 2014-11-17 05:53:33 +01:00 committed by Matthias Neeracher
parent cccc33c847
commit 263a7c5051
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ class ASApplication: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(aNotification: NSNotification) {
themeMenu.removeAllItems()
for (index, theme) in enumerate(ACEThemeNames.humanThemeNames() as [NSString]) {
let menuItem = themeMenu.addItemWithTitle(theme, action: "setTheme:", keyEquivalent: "")
let menuItem = themeMenu.addItemWithTitle(theme, action: "changeTheme:", keyEquivalent: "")
menuItem!.tag = index
}
keyboardMenu.removeAllItems()

View File

@ -186,7 +186,7 @@ class ASProjDoc: NSDocument, NSOutlineViewDelegate {
// MARK: Editor configuration
@IBAction func setTheme(item: NSMenuItem) {
@IBAction func changeTheme(item: NSMenuItem) {
currentTheme = UInt(item.tag)
editor.setTheme(currentTheme)
NSUserDefaults.standardUserDefaults().setObject(
@ -202,7 +202,7 @@ class ASProjDoc: NSDocument, NSOutlineViewDelegate {
override func validateUserInterfaceItem(anItem: NSValidatedUserInterfaceItem) -> Bool {
if let menuItem = anItem as? NSMenuItem {
if menuItem.action == "setTheme:" {
if menuItem.action == "changeTheme:" {
menuItem.state = (menuItem.tag == Int(currentTheme) ? NSOnState : NSOffState)
return true
} else if menuItem.action == "changeKeyboardHandler:" {