Skip to content

Commit ed283a8

Browse files
committed
Turn off credits page
1 parent 684be2f commit ed283a8

11 files changed

+159
-8
lines changed

Juice.sketch

8 KB
Binary file not shown.

Juice.xcodeproj/project.pbxproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
728EB9361E060DA900920B83 /* FileBackedChargeScaleDisplay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 728EB9351E060DA900920B83 /* FileBackedChargeScaleDisplay.swift */; };
2929
728EB9381E06184000920B83 /* FileBackedChargeScaleDisplay+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 728EB9371E06184000920B83 /* FileBackedChargeScaleDisplay+Extensions.swift */; };
3030
728EB93A1E061B4700920B83 /* PreferencesStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 728EB9391E061B4700920B83 /* PreferencesStorage.swift */; };
31+
728EB9431E06661800920B83 /* AboutPreferencesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 728EB9411E06661800920B83 /* AboutPreferencesViewController.swift */; };
32+
728EB9441E06661800920B83 /* AboutPreferencesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 728EB9421E06661800920B83 /* AboutPreferencesViewController.xib */; };
3133
BB1E603B06F7547FED9412FB /* Pods_Juice.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89FE5472659FE380046C1766 /* Pods_Juice.framework */; };
3234
/* End PBXBuildFile section */
3335

@@ -57,6 +59,8 @@
5759
728EB9351E060DA900920B83 /* FileBackedChargeScaleDisplay.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FileBackedChargeScaleDisplay.swift; path = Classes/FileBackedChargeScaleDisplay.swift; sourceTree = "<group>"; };
5860
728EB9371E06184000920B83 /* FileBackedChargeScaleDisplay+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "FileBackedChargeScaleDisplay+Extensions.swift"; path = "Classes/FileBackedChargeScaleDisplay+Extensions.swift"; sourceTree = "<group>"; };
5961
728EB9391E061B4700920B83 /* PreferencesStorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PreferencesStorage.swift; path = Classes/PreferencesStorage.swift; sourceTree = "<group>"; };
62+
728EB9411E06661800920B83 /* AboutPreferencesViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AboutPreferencesViewController.swift; path = Classes/AboutPreferencesViewController.swift; sourceTree = "<group>"; };
63+
728EB9421E06661800920B83 /* AboutPreferencesViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = AboutPreferencesViewController.xib; path = Classes/AboutPreferencesViewController.xib; sourceTree = "<group>"; };
6064
77622EE75A5C033BF8EAACB4 /* Pods-Juice.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Juice.release.xcconfig"; path = "Pods/Target Support Files/Pods-Juice/Pods-Juice.release.xcconfig"; sourceTree = "<group>"; };
6165
89FE5472659FE380046C1766 /* Pods_Juice.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Juice.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6266
/* End PBXFileReference section */
@@ -156,6 +160,7 @@
156160
725AA5DE1E05DBCD006E5DDE /* Preferences */ = {
157161
isa = PBXGroup;
158162
children = (
163+
728EB9401E06660300920B83 /* About */,
159164
7230D7561E05F47D0001F3E9 /* Credits */,
160165
7230D7511E05E8A60001F3E9 /* General */,
161166
725AA5DF1E05DBDB006E5DDE /* PreferencesCoordinator.swift */,
@@ -185,6 +190,15 @@
185190
name = Extensions;
186191
sourceTree = "<group>";
187192
};
193+
728EB9401E06660300920B83 /* About */ = {
194+
isa = PBXGroup;
195+
children = (
196+
728EB9411E06661800920B83 /* AboutPreferencesViewController.swift */,
197+
728EB9421E06661800920B83 /* AboutPreferencesViewController.xib */,
198+
);
199+
name = About;
200+
sourceTree = "<group>";
201+
};
188202
A49489D7401DD5FE5654CC8B /* Pods */ = {
189203
isa = PBXGroup;
190204
children = (
@@ -273,6 +287,7 @@
273287
7230D7551E05E8C70001F3E9 /* GeneralPreferencesViewController.xib in Resources */,
274288
725AA5E61E05DE22006E5DDE /* PreferencesWindowController.xib in Resources */,
275289
725AA5C21E05BF3A006E5DDE /* Assets.xcassets in Resources */,
290+
728EB9441E06661800920B83 /* AboutPreferencesViewController.xib in Resources */,
276291
725AA5C51E05BF3A006E5DDE /* MainMenu.xib in Resources */,
277292
7230D75A1E05F4960001F3E9 /* CreditsPreferencesViewController.xib in Resources */,
278293
);
@@ -338,6 +353,7 @@
338353
725AA5D51E05C1F5006E5DDE /* StatusBarItemCoordinator.swift in Sources */,
339354
725AA5D01E05C0E8006E5DDE /* PowerSourceWatcher.swift in Sources */,
340355
728EB92E1E0601D800920B83 /* ChargeScaleDisplay.swift in Sources */,
356+
728EB9431E06661800920B83 /* AboutPreferencesViewController.swift in Sources */,
341357
728EB9381E06184000920B83 /* FileBackedChargeScaleDisplay+Extensions.swift in Sources */,
342358
725AA5C01E05BF3A006E5DDE /* AppDelegate.swift in Sources */,
343359
725AA5D31E05C19A006E5DDE /* ApplicationCoordinator.swift in Sources */,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "Juice Icon 128.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "Juice Icon [email protected]",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"filename" : "Juice Icon [email protected]",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
}
23+
}
14.8 KB
Loading
44.7 KB
Loading
83.4 KB
Loading
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//
2+
// AboutPreferencesViewController.swift
3+
// Juice
4+
//
5+
// Created by Brian Michel on 12/18/16.
6+
// Copyright © 2016 Brian Michel. All rights reserved.
7+
//
8+
9+
import Cocoa
10+
11+
class AboutPreferencesViewController: NSViewController {
12+
@IBOutlet weak var versionLabel: NSTextField!
13+
@IBOutlet weak var buildLabel: NSTextField!
14+
15+
override var nibName: String? {
16+
return "AboutPreferencesViewController"
17+
}
18+
19+
override func viewDidLoad() {
20+
super.viewDidLoad()
21+
let bundle = Bundle.main
22+
guard let version = bundle.infoDictionary?["CFBundleShortVersionString"] as? String,
23+
let build = bundle.infoDictionary?["CFBundleVersion"] as? String else {
24+
versionLabel.stringValue = "Unknown Version"
25+
buildLabel.stringValue = "Unknown Build"
26+
return
27+
}
28+
29+
versionLabel.stringValue = "Version \(version)"
30+
buildLabel.stringValue = "Build \(build)"
31+
}
32+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16B2555" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
3+
<dependencies>
4+
<deployment identifier="macosx"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
6+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7+
<capability name="stacking Non-gravity area distributions on NSStackView" minToolsVersion="7.0" minSystemVersion="10.11"/>
8+
<capability name="system font weights other than Regular or Bold" minToolsVersion="7.0"/>
9+
</dependencies>
10+
<objects>
11+
<customObject id="-2" userLabel="File's Owner" customClass="AboutPreferencesViewController" customModule="Juice" customModuleProvider="target">
12+
<connections>
13+
<outlet property="buildLabel" destination="iBt-a3-1u9" id="LAg-a0-nTC"/>
14+
<outlet property="versionLabel" destination="LRT-kf-qTU" id="iOT-3o-Bbh"/>
15+
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
16+
</connections>
17+
</customObject>
18+
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
19+
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
20+
<customView id="Hz6-mo-xeY">
21+
<rect key="frame" x="0.0" y="0.0" width="267" height="279"/>
22+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
23+
<subviews>
24+
<stackView distribution="fill" orientation="vertical" alignment="centerX" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" fixedFrame="YES" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pX0-YP-H9w">
25+
<rect key="frame" x="69" y="24" width="135" height="224"/>
26+
<autoresizingMask key="autoresizingMask"/>
27+
<subviews>
28+
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="OvV-0K-JDp">
29+
<rect key="frame" x="3.5" y="96" width="128" height="128"/>
30+
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="Icon Large" id="XnB-p7-VMC"/>
31+
</imageView>
32+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6Q7-qe-Scw">
33+
<rect key="frame" x="38.5" y="59" width="58" height="29"/>
34+
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Juice" id="EHj-2q-aVJ">
35+
<font key="font" metaFont="systemThin" size="24"/>
36+
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
37+
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
38+
</textFieldCell>
39+
</textField>
40+
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="HeZ-gY-XCG">
41+
<rect key="frame" x="19.5" y="48" width="96" height="5"/>
42+
</box>
43+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="LRT-kf-qTU">
44+
<rect key="frame" x="32.5" y="25" width="70" height="17"/>
45+
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Version 1.0" usesSingleLineMode="YES" id="S0O-8c-m66">
46+
<font key="font" metaFont="system"/>
47+
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
48+
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
49+
</textFieldCell>
50+
</textField>
51+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="iBt-a3-1u9">
52+
<rect key="frame" x="-2" y="0.0" width="139" height="17"/>
53+
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Build 2016.12.1801145" usesSingleLineMode="YES" id="9xH-qZ-1ZU">
54+
<font key="font" metaFont="system"/>
55+
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
56+
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
57+
</textFieldCell>
58+
</textField>
59+
</subviews>
60+
<visibilityPriorities>
61+
<integer value="1000"/>
62+
<integer value="1000"/>
63+
<integer value="1000"/>
64+
<integer value="1000"/>
65+
<integer value="1000"/>
66+
</visibilityPriorities>
67+
<customSpacing>
68+
<real value="3.4028234663852886e+38"/>
69+
<real value="3.4028234663852886e+38"/>
70+
<real value="3.4028234663852886e+38"/>
71+
<real value="3.4028234663852886e+38"/>
72+
<real value="3.4028234663852886e+38"/>
73+
</customSpacing>
74+
</stackView>
75+
</subviews>
76+
<point key="canvasLocation" x="48.5" y="70.5"/>
77+
</customView>
78+
</objects>
79+
<resources>
80+
<image name="Icon Large" width="128" height="128"/>
81+
</resources>
82+
</document>

Juice/Classes/PreferencesCoordinator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ final class PreferencesCoordinator: PreferencesWindowControllerDelegate {
2929
windowController.contentViewController = CreditsPreferencesViewController()
3030
windowController.window?.title = "Credits"
3131
case PreferencesWindowController.Identifiers.Tip:
32-
windowController.contentViewController = nil
33-
windowController.window?.title = "Tip"
32+
windowController.contentViewController = AboutPreferencesViewController()
33+
windowController.window?.title = "About"
3434
default:
3535
break
3636
}

Juice/Classes/PreferencesWindowController.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,12 @@ final class PreferencesWindowController: NSWindowController, NSToolbarDelegate {
5656

5757
func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [String] {
5858
return [Identifiers.General,
59-
Identifiers.Credits,
6059
NSToolbarFlexibleSpaceItemIdentifier,
6160
Identifiers.Tip]
6261
}
6362

6463
func toolbarSelectableItemIdentifiers(_ toolbar: NSToolbar) -> [String] {
6564
return [Identifiers.General,
66-
Identifiers.Credits,
6765
Identifiers.Tip]
6866
}
6967

@@ -89,9 +87,9 @@ final class PreferencesWindowController: NSWindowController, NSToolbarDelegate {
8987
menu: nil)
9088
case Identifiers.Tip:
9189
return customToolbarItem(itemForItemIdentifier: Identifiers.Tip,
92-
label: "Tip",
93-
paletteLabel: "Tip",
94-
toolTip: "Tip the author of this app",
90+
label: "About",
91+
paletteLabel: "About",
92+
toolTip: "Version Information",
9593
target: self,
9694
itemContent: NSImage(named: "Tip Icon"),
9795
action: #selector(tipToolbarItemClicked),

0 commit comments

Comments
 (0)