diff --git a/NEWS.md b/NEWS.md index e22ba75..b0cfb42 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# 1.2.0 + +- numbered key equivalents (up to 9) + # 1.1.0 - About dialog (to ensure icon author gets credit) diff --git a/README.md b/README.md index 73ce94d..3bf32e9 100644 --- a/README.md +++ b/README.md @@ -56,12 +56,12 @@ This codebase has been uploaded to the following authoritative social coding sit ## TODO -- Allow hiding of the app icon (not sure this is a good idea, tho…pls discuss in an issue!) -- Add Cmd-1, -2, -3, (etc) key equivalents in the menu bar for fast selection (one reason why ^^ might not be a good idea) - Clean up the icon (which is "dial" by IconMark from the Noun Project). This means having it look better in the menu bar in dark/light mode _including_ the highlight mode for it. Possibly means getting a visible "R" on it somewhere. - Better/prettier alerting (which also means more sanity checks) -- Add an "about" box (mostly to ensure IconMark gets more credit than a comment and README) +- Allow hiding of the app icon? (not sure this is a good idea, tho…pls discuss in an issue!) - (add your own TODO suggestions via PR) +- Add Cmd-1, -2, -3, (etc) key equivalents in the menu bar for fast selection (one reason why ^^ might not be a good idea) +- Add an "about" box (mostly to ensure IconMark gets more credit than a comment and README) ## License diff --git a/RSwitch.xcodeproj/project.pbxproj b/RSwitch.xcodeproj/project.pbxproj index e3239ee..8a1cf33 100644 --- a/RSwitch.xcodeproj/project.pbxproj +++ b/RSwitch.xcodeproj/project.pbxproj @@ -285,7 +285,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 1.1.0; + MARKETING_VERSION = 1.2.0; PRODUCT_BUNDLE_IDENTIFIER = is.rud.bob.RSwitch; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -308,7 +308,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 1.1.0; + MARKETING_VERSION = 1.2.0; PRODUCT_BUNDLE_IDENTIFIER = is.rud.bob.RSwitch; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/RSwitch/AppDelegate.swift b/RSwitch/AppDelegate.swift index 8c74c2b..2884953 100644 --- a/RSwitch/AppDelegate.swift +++ b/RSwitch/AppDelegate.swift @@ -84,7 +84,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { } - // + // Show about dialog @objc func about(_ sender: NSMenuItem?) { abtController.showWindow(self) } @@ -120,9 +120,10 @@ extension AppDelegate: NSMenuDelegate { // retrieves all versions (excludes hidden files and the Current alias let versions = entries.sorted().filter { !($0.hasPrefix(".")) && !($0 == "Current") } - + let hasCurrent = entries.filter { $0 == "Current" } + // if there was a Current alias (prbly shld alert if not) - if ((entries.filter { $0 == "Current" })[0] == "Current") { + if (hasCurrent.count > 0) { // get where Current points to let furl = NSURL(fileURLWithPath: macos_r_framework_dir + "/" + "Current") @@ -138,12 +139,15 @@ extension AppDelegate: NSMenuDelegate { // populate menu items with all installed R versions, ensuring we // put a checkbox next to the one that is Current + var i = 1 for version in versions { - let item = NSMenuItem(title: version, action: #selector(handleSwitch), keyEquivalent: "") + let keynum = (i < 10) ? String(i) : "" + let item = NSMenuItem(title: version, action: #selector(handleSwitch), keyEquivalent: keynum) item.isEnabled = true if (version == targetPath) { item.state = NSControl.StateValue.on } item.representedObject = version menu.addItem(item) + i = i + 1 } }