Skip to content

Commit

Permalink
Added a quit button in order to please appstore review team
Browse files Browse the repository at this point in the history
  • Loading branch information
cristibaluta committed Apr 24, 2018
1 parent 99d83a1 commit 88fef03
Show file tree
Hide file tree
Showing 13 changed files with 147 additions and 133 deletions.
16 changes: 9 additions & 7 deletions Delivery/macOS/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ class AppDelegate: NSObject, NSApplicationDelegate {
override init() {
super.init()

// For testing
#if DEBUG
// Simulate a freshly installed app by resetting the preferences
// localPreferences.reset()
// UserDefaults.standard.serverChangeToken = nil
localPreferences.reset(.wizardStep)
localPreferences.set(true, forKey: .firstLaunch, version: Versioning.appVersion)
localPreferences.set(0, forKey: .wizardStep)
localPreferences.set(false, forKey: .enableGit)
// localPreferences.reset(.wizardStep)
// localPreferences.set(true, forKey: .firstLaunch, version: Versioning.appVersion)
// localPreferences.set(0, forKey: .wizardStep)
// localPreferences.set(false, forKey: .enableGit)
#endif

localRepository = SqliteRepository()
#if APPSTORE
Expand All @@ -57,9 +59,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
menu.isDark = theme.isDark
menu.onOpen = {
self.removeActivePopup()
let firstLaunch = self.localPreferences.bool(.firstLaunch, version: Versioning.appVersion)
let isFirstLaunch = self.localPreferences.bool(.firstLaunch, version: Versioning.appVersion)
let wizardStep = self.localPreferences.int(.wizardStep)
if firstLaunch {
if isFirstLaunch {
self.presentWelcomePopup()
}
else if wizardStep != WizardStep.finished.rawValue {
Expand Down
3 changes: 2 additions & 1 deletion Delivery/macOS/App/Versioning.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ struct Versioning {
static let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String
static let compatibilityMaps: [String: Versions] = [
"17.06.14": (shellScript: "1.0", browserScript: "1.0", jirassicCmd: "17.06.14", jitCmd: "17.06.14"),
"18.04.04": (shellScript: "1.0", browserScript: "1.1", jirassicCmd: "17.06.14", jitCmd: "17.06.14")
"18.04.04": (shellScript: "1.0", browserScript: "1.1", jirassicCmd: "17.06.14", jitCmd: "17.06.14"),
"18.04.25": (shellScript: "1.0", browserScript: "1.1", jirassicCmd: "18.04.25", jitCmd: "18.04.25")
// Add a new compatibility for each app version that needs one
]

Expand Down
4 changes: 2 additions & 2 deletions Delivery/macOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>18.04.23</string>
<string>18.04.25</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>8</string>
<string>9</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class JirassicCell: NSTableRowView {
: NSImage.Name.statusPartiallyAvailable)
textField.stringValue = compatible
? "Installed, run 'jirassic' in Terminal for more info"
: "Outdated or uninstalled, please install!"
: "Outdated or not installed, please install the latest version!"
} else {
statusImageView.image = NSImage(named: NSImage.Name.statusUnavailable)
textField.stringValue = "Install shell support first!"
textField.stringValue = "Cannot determine compatibility, install shell support first!"
}
butInstall.isHidden = available && compatible
}
Expand Down
4 changes: 2 additions & 2 deletions Delivery/macOS/Screens/Settings/Input/Jit/JitCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class JitCell: NSTableRowView {

textField.stringValue = compatible
? "Installed, run 'jit' in Terminal for more info"
: "Applescript installed but 'jit' CLI is outdated/uninstalled"
: "Jit is outdated or not installed, please install the latest version!"
} else {
statusImageView.image = NSImage(named: NSImage.Name.statusUnavailable)
textField.stringValue = "Install shell support first!"
textField.stringValue = "Cannot determine Jit compatibility, install shell support first!"
}
butInstall.isHidden = available && compatible
}
Expand Down
66 changes: 19 additions & 47 deletions Delivery/macOS/Screens/Settings/Settings.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14109"/>
<capability name="box content view" minToolsVersion="7.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand Down Expand Up @@ -61,34 +60,6 @@
<action selector="handleSaveButton:" target="J1c-ZL-C5e" id="eUr-xg-ou7"/>
</connections>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="7Op-cc-eNR">
<rect key="frame" x="7" y="450" width="24" height="24"/>
<constraints>
<constraint firstAttribute="width" constant="24" id="FAr-ut-k7v"/>
<constraint firstAttribute="height" constant="24" id="JoT-ji-GDg"/>
</constraints>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="ButClose" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="9g5-lO-gFK">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="handleQuitAppButton:" target="J1c-ZL-C5e" id="owu-QK-Oel"/>
</connections>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="Hez-3a-Spi">
<rect key="frame" x="30" y="450" width="24" height="24"/>
<constraints>
<constraint firstAttribute="height" constant="24" id="PQh-Rm-W3G"/>
<constraint firstAttribute="width" constant="24" id="an2-9q-Fdz"/>
</constraints>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="ButMinimize" imagePosition="only" alignment="center" alternateImage="ButMinimize" imageScaling="proportionallyDown" inset="2" id="ghr-Jp-de2">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="handleMinimizeAppButton:" target="J1c-ZL-C5e" id="sJ1-lY-EXP"/>
</connections>
</button>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SGn-yv-6JW">
<rect key="frame" x="144" y="451" width="205" height="23"/>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="texturedSquare" trackingMode="selectOne" id="pn1-lj-JjN">
Expand All @@ -103,31 +74,35 @@
<action selector="handleSegmentedControl:" target="J1c-ZL-C5e" id="wev-kc-A58"/>
</connections>
</segmentedControl>
<button translatesAutoresizingMaskIntoConstraints="NO" id="3j7-kb-qU6">
<rect key="frame" x="53" y="450" width="24" height="24"/>
<constraints>
<constraint firstAttribute="width" constant="24" id="nor-Si-z0O"/>
<constraint firstAttribute="height" constant="24" id="zbc-7a-eWU"/>
</constraints>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="ButDisabled" imagePosition="only" alignment="center" alternateImage="ButDisabled" imageScaling="proportionallyDown" inset="2" id="FGs-IY-tvF">
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sOP-ZD-50a">
<rect key="frame" x="12" y="453" width="38" height="19"/>
<buttonCell key="cell" type="roundRect" title="Quit" bezelStyle="roundedRect" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="fze-b8-HZ5">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<font key="font" metaFont="cellTitle"/>
</buttonCell>
<connections>
<action selector="handleQuitAppButton:" target="J1c-ZL-C5e" id="cS6-mT-WmX"/>
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="JI6-hq-mSe">
<rect key="frame" x="60" y="453" width="20" height="19"/>
<buttonCell key="cell" type="roundRect" title="^" bezelStyle="roundedRect" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="ghA-S2-xyZ">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/>
</buttonCell>
<connections>
<action selector="handleMinimizeAppButton:" target="J1c-ZL-C5e" id="TiA-fU-ju8"/>
<action selector="handleMinimizeAppButton:" target="J1c-ZL-C5e" id="hZX-uF-dti"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="7Op-cc-eNR" firstAttribute="leading" secondItem="JAR-dh-Pss" secondAttribute="leading" constant="7" id="4KS-sV-fR6"/>
<constraint firstItem="3j7-kb-qU6" firstAttribute="leading" secondItem="Hez-3a-Spi" secondAttribute="trailing" constant="-1" id="59u-an-LCi"/>
<constraint firstItem="sOP-ZD-50a" firstAttribute="top" secondItem="JAR-dh-Pss" secondAttribute="top" constant="22" id="242-IV-jcI"/>
<constraint firstItem="JI6-hq-mSe" firstAttribute="centerY" secondItem="sOP-ZD-50a" secondAttribute="centerY" id="8dv-Jg-hNO"/>
<constraint firstItem="PxN-df-6xl" firstAttribute="leading" secondItem="JAR-dh-Pss" secondAttribute="leading" constant="10" id="F1s-2p-LIi"/>
<constraint firstItem="sOP-ZD-50a" firstAttribute="leading" secondItem="JAR-dh-Pss" secondAttribute="leading" constant="12" id="MC1-7c-utL"/>
<constraint firstAttribute="bottom" secondItem="PxN-df-6xl" secondAttribute="bottom" constant="91" id="Mhh-04-lzW"/>
<constraint firstItem="3j7-kb-qU6" firstAttribute="centerY" secondItem="Hez-3a-Spi" secondAttribute="centerY" id="Nha-hr-j41"/>
<constraint firstItem="7Op-cc-eNR" firstAttribute="top" secondItem="JAR-dh-Pss" secondAttribute="top" constant="20" id="RBZ-kd-nDQ"/>
<constraint firstItem="Hez-3a-Spi" firstAttribute="centerY" secondItem="7Op-cc-eNR" secondAttribute="centerY" id="Rpf-X2-6Vt"/>
<constraint firstItem="Hez-3a-Spi" firstAttribute="leading" secondItem="7Op-cc-eNR" secondAttribute="trailing" constant="-1" id="UTi-M2-rHs"/>
<constraint firstItem="SGn-yv-6JW" firstAttribute="centerX" secondItem="JAR-dh-Pss" secondAttribute="centerX" id="ZoM-gS-y3R"/>
<constraint firstItem="JI6-hq-mSe" firstAttribute="leading" secondItem="sOP-ZD-50a" secondAttribute="trailing" constant="10" id="aLV-Bk-ZQg"/>
<constraint firstAttribute="trailing" secondItem="nlR-CY-a5k" secondAttribute="trailing" constant="12" id="bBK-E5-Tw5"/>
<constraint firstItem="PxN-df-6xl" firstAttribute="top" secondItem="JAR-dh-Pss" secondAttribute="top" constant="45" id="c7W-dQ-9er"/>
<constraint firstAttribute="trailing" secondItem="PxN-df-6xl" secondAttribute="trailing" constant="10" id="cPD-hz-qMV"/>
Expand All @@ -148,9 +123,6 @@
</scene>
</scenes>
<resources>
<image name="ButClose" width="13" height="13"/>
<image name="ButDisabled" width="13" height="13"/>
<image name="ButMinimize" width="13" height="13"/>
<image name="NSHomeTemplate" width="14" height="14"/>
</resources>
</document>
Loading

0 comments on commit 88fef03

Please sign in to comment.