diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..e22ba75 --- /dev/null +++ b/NEWS.md @@ -0,0 +1,7 @@ +# 1.1.0 + +- About dialog (to ensure icon author gets credit) + +# 1.0.0 + +- Initial version \ No newline at end of file diff --git a/README.md b/README.md index 10ab93a..73ce94d 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ This codebase has been uploaded to the following authoritative social coding sit - 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) +- Add an "about" box (mostly to ensure IconMark gets more credit than a comment and README) - (add your own TODO suggestions via PR) ## License diff --git a/RSwitch.xcodeproj/project.pbxproj b/RSwitch.xcodeproj/project.pbxproj index fd4b242..e3239ee 100644 --- a/RSwitch.xcodeproj/project.pbxproj +++ b/RSwitch.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 0178970D230ED25100F8F5BC /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0178970C230ED25100F8F5BC /* AboutViewController.swift */; }; 01F3EF0C230E635300DF5DF9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F3EF0B230E635300DF5DF9 /* AppDelegate.swift */; }; 01F3EF0E230E635300DF5DF9 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F3EF0D230E635300DF5DF9 /* ViewController.swift */; }; 01F3EF10230E635500DF5DF9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 01F3EF0F230E635500DF5DF9 /* Assets.xcassets */; }; @@ -14,6 +15,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 0178970C230ED25100F8F5BC /* AboutViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; 01F3EF08230E635300DF5DF9 /* RSwitch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RSwitch.app; sourceTree = BUILT_PRODUCTS_DIR; }; 01F3EF0B230E635300DF5DF9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 01F3EF0D230E635300DF5DF9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -56,6 +58,7 @@ 01F3EF0D230E635300DF5DF9 /* ViewController.swift */, 01F3EF0F230E635500DF5DF9 /* Assets.xcassets */, 01F3EF11230E635500DF5DF9 /* Main.storyboard */, + 0178970C230ED25100F8F5BC /* AboutViewController.swift */, 01F3EF14230E635500DF5DF9 /* Info.plist */, ); path = RSwitch; @@ -131,6 +134,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 0178970D230ED25100F8F5BC /* AboutViewController.swift in Sources */, 01F3EF0E230E635300DF5DF9 /* ViewController.swift in Sources */, 01F3EF0C230E635300DF5DF9 /* AppDelegate.swift in Sources */, ); @@ -182,7 +186,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; + COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -200,7 +204,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; + INSTALL_PATH = /Users/hrbrmstr/Desktop; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -242,7 +247,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; + COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -254,9 +259,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; + INSTALL_PATH = /Users/hrbrmstr/Desktop; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; @@ -267,8 +274,8 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = CBY22P58G8; ENABLE_HARDENED_RUNTIME = NO; @@ -278,8 +285,10 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; + MARKETING_VERSION = 1.1.0; PRODUCT_BUNDLE_IDENTIFIER = is.rud.bob.RSwitch; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; }; name = Debug; @@ -288,8 +297,8 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = CBY22P58G8; ENABLE_HARDENED_RUNTIME = NO; @@ -299,8 +308,10 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; + MARKETING_VERSION = 1.1.0; PRODUCT_BUNDLE_IDENTIFIER = is.rud.bob.RSwitch; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; }; name = Release; diff --git a/RSwitch/AboutViewController.swift b/RSwitch/AboutViewController.swift new file mode 100644 index 0000000..d228d54 --- /dev/null +++ b/RSwitch/AboutViewController.swift @@ -0,0 +1,10 @@ + +import Cocoa + +class AboutViewController: NSViewController { + + override func viewDidLoad() { + super.viewDidLoad() + } + +} diff --git a/RSwitch/AppDelegate.swift b/RSwitch/AppDelegate.swift index c8bf99b..8c74c2b 100644 --- a/RSwitch/AppDelegate.swift +++ b/RSwitch/AppDelegate.swift @@ -26,6 +26,10 @@ public func quitAlert(_ message: String, _ extra: String? = nil) { @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { + var mainStoryboard: NSStoryboard! + var abtController: NSWindowController! + + // Where the official R installs go let macos_r_framework_dir = "/Library/Frameworks/R.framework/Versions" @@ -34,7 +38,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { let statusMenu = NSMenu() let quitItem = NSMenuItem(title: NSLocalizedString("Quit", comment: "Quit menu item"), action: #selector(NSApp.terminate), keyEquivalent: "q") - + override init() { super.init() @@ -43,10 +47,13 @@ class AppDelegate: NSObject, NSApplicationDelegate { // dial by IconMark from the Noun Project statusItem.button?.image = #imageLiteral(resourceName: "RSwitch") statusItem.menu = statusMenu + + mainStoryboard = NSStoryboard(name: "Main", bundle: nil) + abtController = (mainStoryboard.instantiateController(withIdentifier: "aboutPanelController") as! NSWindowController) + } func applicationDidFinishLaunching(_ aNotification: Notification) { - // Insert code here to initialize app } func applicationWillTerminate(_ aNotification: Notification) { @@ -77,6 +84,11 @@ class AppDelegate: NSObject, NSApplicationDelegate { } + // + @objc func about(_ sender: NSMenuItem?) { + abtController.showWindow(self) + } + // Show the framework dir in a new Finder window @objc func openFrameworksDir(_ sender: NSMenuItem?) { NSWorkspace.shared.openFile(macos_r_framework_dir, withApplication: "Finder") @@ -140,6 +152,10 @@ extension AppDelegate: NSMenuDelegate { quitAlert("Failed to list contents of R framework directory. You either do not have R installed or have incorrect permissions set on " + macos_r_framework_dir) } + // Add a About item + menu.addItem(NSMenuItem.separator()) + menu.addItem(NSMenuItem(title: NSLocalizedString("About RSwitch…", comment: "About menu item"), action: #selector(about), keyEquivalent: "")) + // Add a Quit item menu.addItem(NSMenuItem.separator()) menu.addItem(quitItem) diff --git a/RSwitch/Base.lproj/Main.storyboard b/RSwitch/Base.lproj/Main.storyboard index cac75e0..35d919b 100644 --- a/RSwitch/Base.lproj/Main.storyboard +++ b/RSwitch/Base.lproj/Main.storyboard @@ -1,7 +1,9 @@ + + @@ -678,7 +680,7 @@ - + @@ -691,7 +693,106 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +RSwitch v1.1.0 + +Copyright © 2019 Bob Rudis + +MIT Licensed + + + + + + + + + + + + + + + + + + + +dial app icon by IconMark from the Noun Project + + + + + + + + + + + + + + + + + + + + + diff --git a/RSwitch/Info.plist b/RSwitch/Info.plist index e171035..a258524 100644 --- a/RSwitch/Info.plist +++ b/RSwitch/Info.plist @@ -17,9 +17,11 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.0 + $(MARKETING_VERSION) CFBundleVersion 1 + LSApplicationCategoryType + public.app-category.utilities LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright diff --git a/releases/RSwitch-1.1.0.app.zip b/releases/RSwitch-1.1.0.app.zip new file mode 100644 index 0000000..5c2e57e Binary files /dev/null and b/releases/RSwitch-1.1.0.app.zip differ