Browse Source

1.1.0 - about dialog

tags/v1.1.0 v1.1.0
boB Rudis 3 years ago
parent
commit
b0eda922ae
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 7
      NEWS.md
  2. 2
      README.md
  3. 27
      RSwitch.xcodeproj/project.pbxproj
  4. 10
      RSwitch/AboutViewController.swift
  5. 20
      RSwitch/AppDelegate.swift
  6. 105
      RSwitch/Base.lproj/Main.storyboard
  7. 4
      RSwitch/Info.plist
  8. BIN
      releases/RSwitch-1.1.0.app.zip

7
NEWS.md

@ -0,0 +1,7 @@
# 1.1.0
- About dialog (to ensure icon author gets credit)
# 1.0.0
- Initial version

2
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)
- <strike>Add an "about" box (mostly to ensure IconMark gets more credit than a comment and README)</strike>
- (add your own TODO suggestions via PR)
## License

27
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 = "<group>"; };
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 = "<group>"; };
01F3EF0D230E635300DF5DF9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
@ -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;

10
RSwitch/AboutViewController.swift

@ -0,0 +1,10 @@
import Cocoa
class AboutViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
}

20
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)

105
RSwitch/Base.lproj/Main.storyboard

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14865.1" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14865.1"/>
<capability name="System colors introduced in macOS 10.14" minToolsVersion="10.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
@ -678,7 +680,7 @@
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="0.0"/>
<point key="canvasLocation" x="449" y="-317"/>
</scene>
<!--View Controller-->
<scene sceneID="hIz-AP-VOD">
@ -691,7 +693,106 @@
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="61" y="225"/>
<point key="canvasLocation" x="435" y="-92"/>
</scene>
<!--Window Controller-->
<scene sceneID="fg4-ci-0Xb">
<objects>
<windowController storyboardIdentifier="aboutPanelController" id="TxV-Pk-3ou" sceneMemberID="viewController">
<window key="window" identifier="aboutPanelController" title="About RSwitch" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="Izb-xF-67U" customClass="NSPanel">
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="1776" y="1127" width="480" height="270"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1440"/>
<connections>
<outlet property="delegate" destination="TxV-Pk-3ou" id="KgN-QG-Y6j"/>
</connections>
</window>
<connections>
<segue destination="KlD-6a-3Gc" kind="relationship" relationship="window.shadowedContentViewController" id="D1J-wT-61h"/>
</connections>
</windowController>
<customObject id="lfp-MO-egv" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="132" y="297"/>
</scene>
<!--About View Controller-->
<scene sceneID="lbz-cy-h0Y">
<objects>
<viewController storyboardIdentifier="about2" id="KlD-6a-3Gc" customClass="AboutViewController" sceneMemberID="viewController">
<view key="view" id="SgY-wa-ilj">
<rect key="frame" x="0.0" y="0.0" width="480" height="240"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView appearanceType="aqua" fixedFrame="YES" borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" hasVerticalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rEB-nx-gFw">
<rect key="frame" x="7" y="9" width="463" height="223"/>
<autoresizingMask key="autoresizingMask"/>
<clipView key="contentView" ambiguous="YES" drawsBackground="NO" copiesOnScroll="NO" id="iCP-uh-CRl">
<rect key="frame" x="0.0" y="0.0" width="463" height="223"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView ambiguous="YES" editable="NO" drawsBackground="NO" importsGraphics="NO" verticallyResizable="YES" smartInsertDelete="YES" id="kWH-Et-k6l">
<rect key="frame" x="0.0" y="0.0" width="463" height="223"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="textColor" name="alternateSelectedControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="alternatingContentBackgroundColor" catalog="System" colorSpace="catalog"/>
<size key="minSize" width="463" height="223"/>
<size key="maxSize" width="463" height="10000000"/>
<attributedString key="textStorage">
<fragment>
<string key="content">
RSwitch v1.1.0
Copyright © 2019 Bob Rudis
MIT Licensed
</string>
<attributes>
<color key="NSColor" name="alternateSelectedControlTextColor" catalog="System" colorSpace="catalog"/>
<font key="NSFont" metaFont="system" size="17"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
<fragment content="https://git.rud.is/hrbrmstr/RSwitch">
<attributes>
<color key="NSColor" name="alternateSelectedControlTextColor" catalog="System" colorSpace="catalog"/>
<font key="NSFont" metaFont="system" size="17"/>
<url key="NSLink" string="https://git.rud.is/hrbrmstr/RSwitch"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
<fragment>
<string key="content">
dial app icon by IconMark from the Noun Project
</string>
<attributes>
<color key="NSColor" name="alternateSelectedControlTextColor" catalog="System" colorSpace="catalog"/>
<font key="NSFont" metaFont="system" size="17"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
</textView>
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="1Xi-yD-fAs">
<rect key="frame" x="-100" y="-100" width="225" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="S8X-5h-pQ6">
<rect key="frame" x="-100" y="-100" width="15" height="223"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
</subviews>
</view>
</viewController>
<customObject id="N40-nE-NTQ" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="689" y="357"/>
</scene>
</scenes>
</document>

4
RSwitch/Info.plist

@ -17,9 +17,11 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>

BIN
releases/RSwitch-1.1.0.app.zip

Binary file not shown.
Loading…
Cancel
Save