Skip to content

Commit

Permalink
Update a bit
Browse files Browse the repository at this point in the history
- Remove Pods
- Remove Sparkle
- Change digits position of two bottoms ones
- Update README.md
  • Loading branch information
Victor Peschenkov committed Aug 28, 2019
1 parent a0ac2f7 commit 9871748
Show file tree
Hide file tree
Showing 21 changed files with 60 additions and 349 deletions.
13 changes: 0 additions & 13 deletions Podfile

This file was deleted.

16 changes: 0 additions & 16 deletions Podfile.lock

This file was deleted.

160 changes: 19 additions & 141 deletions Predator.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "35C15316228219EB005B24A9"
BuildableName = "Predator.app"
BlueprintName = "PredatorSandbox"
BlueprintName = "PredatorApp"
ReferencedContainer = "container:Predator.xcodeproj">
</BuildableReference>
</BuildActionEntry>
Expand All @@ -34,7 +34,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "35C15316228219EB005B24A9"
BuildableName = "Predator.app"
BlueprintName = "PredatorSandbox"
BlueprintName = "PredatorApp"
ReferencedContainer = "container:Predator.xcodeproj">
</BuildableReference>
</MacroExpansion>
Expand All @@ -57,7 +57,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "35C15316228219EB005B24A9"
BuildableName = "Predator.app"
BlueprintName = "PredatorSandbox"
BlueprintName = "PredatorApp"
ReferencedContainer = "container:Predator.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand All @@ -76,7 +76,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "35C15316228219EB005B24A9"
BuildableName = "Predator.app"
BlueprintName = "PredatorSandbox"
BlueprintName = "PredatorApp"
ReferencedContainer = "container:Predator.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand Down
10 changes: 0 additions & 10 deletions Predator.xcworkspace/contents.xcworkspacedata

This file was deleted.

8 changes: 0 additions & 8 deletions Predator.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

This file was deleted.

4 changes: 2 additions & 2 deletions Predator/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.5</string>
<string>1.0.6</string>
<key>CFBundleVersion</key>
<string>12</string>
<string>13</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 Victor Peschenkov. All rights reserved.</string>
<key>NSPrincipalClass</key>
Expand Down
11 changes: 0 additions & 11 deletions Predator/PredatorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import Sparkle
import ScreenSaver
import PredatorCore

Expand Down Expand Up @@ -43,16 +42,6 @@ final class PredatorView: ScreenSaverView {
private func configure() {
animationTimeInterval = Preferences.animationTimeInterval
startAnimation()

if Preferences.shared.autoUpdates {
if let updater = SUUpdater(for: Bundle(for: PredatorView.self)) {
// 1 day
if updater.lastUpdateCheckDate.timeIntervalSinceNow.distance(to: -86400) > 0 {
updater.resetUpdateCycle()
updater.installUpdatesIfAvailable()
}
}
}
}
}

Expand Down
11 changes: 0 additions & 11 deletions Predator/Preferences/Preferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,6 @@ final class Preferences: Configuration {
}
}

public var autoUpdates: Bool {
set {
defaults.set(newValue, forKey: Key.autoInstallUpdates)
defaults.synchronize()
}

get {
return defaults.bool(forKey: Key.autoInstallUpdates)
}
}

public var drawEmptyDigits: Bool {
set {
defaults.set(newValue, forKey: Key.drawEmptyDigits)
Expand Down
19 changes: 0 additions & 19 deletions Predator/Preferences/PreferencesWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
// limitations under the License.

import Cocoa
import Sparkle

final class PreferencesWindowController: NSWindowController {
@IBOutlet var colorPicker: NSColorWell!
@IBOutlet var previewView: NSView!
@IBOutlet var reverseCheckbox: NSButton!
@IBOutlet var twentyHourCheckbox: NSButton!
@IBOutlet var autoInstallUpdatesCheckbox: NSButton!
@IBOutlet var drawEmptyDigitsCheckbox: NSButton!
@IBOutlet var versionLabel: NSTextField!

Expand All @@ -37,19 +35,6 @@ final class PreferencesWindowController: NSWindowController {
if let version = preferences.bundle.infoDictionary?["CFBundleShortVersionString"] as? String {
versionLabel.stringValue = "Predator's version \(version)"
}

// Sparkle
NotificationCenter.default.addObserver(
self,
selector: #selector(sparkleWillRestart),
name: .SUUpdaterWillRestart,
object: nil
)

autoInstallUpdatesCheckbox.state = preferences.autoUpdates ? .on : .off

let updater = SUUpdater(for: Bundle(for: PreferencesWindowController.self))
updater?.checkForUpdatesInBackground()
}

@objc func sparkleWillRestart() {
Expand Down Expand Up @@ -79,10 +64,6 @@ extension PreferencesWindowController {
previewView.setNeedsDisplay(previewView.bounds)
}

@IBAction func autoInstallUpdatesAction(_ sender: NSButton) {
preferences.autoUpdates = sender.state == .on ? true : false
}

@IBAction func drawEmptyDigitsAction(_ sender: NSButton) {
preferences.drawEmptyDigits = sender.state == .on ? true : false
previewView.setNeedsDisplay(previewView.bounds)
Expand Down
34 changes: 9 additions & 25 deletions Predator/Preferences/PreferencesWindowController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="PreferencesWindowController" customModule="Predator" customModuleProvider="target">
<connections>
<outlet property="autoInstallUpdatesCheckbox" destination="7PC-sc-V9a" id="2zu-7h-S9s"/>
<outlet property="colorPicker" destination="PFI-UJ-nv7" id="9cy-56-h37"/>
<outlet property="drawEmptyDigitsCheckbox" destination="t0E-5m-5Wc" id="zcO-98-H1p"/>
<outlet property="previewView" destination="Bnn-dY-5vI" id="8ue-e3-Zel"/>
Expand All @@ -30,7 +29,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<colorWell translatesAutoresizingMaskIntoConstraints="NO" id="PFI-UJ-nv7">
<rect key="frame" x="111" y="273" width="44" height="20"/>
<rect key="frame" x="88" y="273" width="44" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="7ko-Uq-JXd"/>
<constraint firstAttribute="width" constant="44" id="qf0-Wf-dUc"/>
Expand All @@ -41,11 +40,11 @@
</connections>
</colorWell>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Vnv-3I-Nmy">
<rect key="frame" x="14" y="203" width="154" height="24"/>
<rect key="frame" x="14" y="167" width="118" height="24"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="3GJ-Au-hwh"/>
</constraints>
<buttonCell key="cell" type="check" title="Reverse shapes filling" bezelStyle="regularSquare" imagePosition="left" inset="2" id="8af-fe-00T">
<buttonCell key="cell" type="check" title="Reverse shapes" bezelStyle="regularSquare" imagePosition="left" inset="2" id="8af-fe-00T">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
Expand Down Expand Up @@ -84,11 +83,11 @@
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="udT-lF-zKm">
<rect key="frame" x="14" y="273" width="91" height="20"/>
<rect key="frame" x="14" y="273" width="68" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="7Bp-ms-8VY"/>
</constraints>
<textFieldCell key="cell" lineBreakMode="clipping" title="Select a color:" id="9CI-hk-4rQ">
<textFieldCell key="cell" lineBreakMode="clipping" title="Pick color:" id="9CI-hk-4rQ">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
Expand Down Expand Up @@ -128,19 +127,6 @@ DQ
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7PC-sc-V9a">
<rect key="frame" x="14" y="167" width="142" height="24"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="tti-1H-2ap"/>
</constraints>
<buttonCell key="cell" type="check" title="Auto install updates" bezelStyle="regularSquare" imagePosition="left" inset="2" id="Ocg-MT-kov">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="autoInstallUpdatesAction:" target="-2" id="3Cj-hj-t5Y"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="QPA-Ty-yka">
<rect key="frame" x="14" y="72" width="145" height="17"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Want to keep updated?" id="3ad-ri-H5Y">
Expand All @@ -160,7 +146,7 @@ DQ
<rect key="frame" x="16" y="95" width="528" height="5"/>
</box>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="t0E-5m-5Wc">
<rect key="frame" x="14" y="131" width="132" height="24"/>
<rect key="frame" x="14" y="203" width="132" height="24"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="1dL-3C-ZSj"/>
</constraints>
Expand All @@ -185,26 +171,24 @@ DQ
<constraint firstItem="udT-lF-zKm" firstAttribute="top" secondItem="EiT-Mj-1SZ" secondAttribute="top" constant="16" id="MZn-Dj-AOl"/>
<constraint firstItem="udT-lF-zKm" firstAttribute="leading" secondItem="EiT-Mj-1SZ" secondAttribute="leading" constant="16" id="OEk-2C-3UQ"/>
<constraint firstAttribute="bottom" secondItem="eY6-hS-6X6" secondAttribute="bottom" constant="16" id="Oke-HN-RRc"/>
<constraint firstItem="t0E-5m-5Wc" firstAttribute="top" secondItem="7PC-sc-V9a" secondAttribute="bottom" constant="16" id="Onc-YA-uOL"/>
<constraint firstItem="PFI-UJ-nv7" firstAttribute="leading" secondItem="udT-lF-zKm" secondAttribute="trailing" constant="8" id="P3y-NY-qzt"/>
<constraint firstItem="7PC-sc-V9a" firstAttribute="leading" secondItem="udT-lF-zKm" secondAttribute="leading" id="TOq-M3-jlQ"/>
<constraint firstItem="t0E-5m-5Wc" firstAttribute="top" secondItem="wdp-Vx-SFy" secondAttribute="bottom" constant="16" id="PaW-tZ-bpj"/>
<constraint firstItem="wdp-Vx-SFy" firstAttribute="leading" secondItem="udT-lF-zKm" secondAttribute="leading" id="UQE-eG-ceo"/>
<constraint firstItem="Bnn-dY-5vI" firstAttribute="top" secondItem="EiT-Mj-1SZ" secondAttribute="top" constant="16" id="XDb-iz-b3f"/>
<constraint firstItem="w0R-LT-WzY" firstAttribute="bottom" secondItem="AJd-fC-cWE" secondAttribute="top" constant="-8" id="Xez-qZ-rnL"/>
<constraint firstItem="Vnv-3I-Nmy" firstAttribute="top" secondItem="t0E-5m-5Wc" secondAttribute="bottom" constant="16" id="YQO-m2-9jR"/>
<constraint firstItem="wdp-Vx-SFy" firstAttribute="top" secondItem="PFI-UJ-nv7" secondAttribute="bottom" constant="12" id="agA-17-4Yt"/>
<constraint firstItem="QPA-Ty-yka" firstAttribute="leading" secondItem="EiT-Mj-1SZ" secondAttribute="leading" constant="16" id="agf-4s-igX"/>
<constraint firstItem="Vnv-3I-Nmy" firstAttribute="top" secondItem="wdp-Vx-SFy" secondAttribute="bottom" constant="16" id="cJH-Fk-dc0"/>
<constraint firstItem="QPA-Ty-yka" firstAttribute="bottom" secondItem="w0R-LT-WzY" secondAttribute="top" constant="-8" id="dXo-bl-19U"/>
<constraint firstAttribute="trailing" secondItem="eY6-hS-6X6" secondAttribute="trailing" constant="16" id="qqw-ZX-QOK"/>
<constraint firstItem="7PC-sc-V9a" firstAttribute="top" secondItem="Vnv-3I-Nmy" secondAttribute="bottom" constant="16" id="vXx-Y8-LgS"/>
<constraint firstAttribute="trailing" secondItem="jqU-bc-Phd" secondAttribute="trailing" constant="16" id="vaz-Lc-0CO"/>
<constraint firstItem="Vnv-3I-Nmy" firstAttribute="leading" secondItem="udT-lF-zKm" secondAttribute="leading" id="xI4-ov-O73"/>
<constraint firstItem="PFI-UJ-nv7" firstAttribute="centerY" secondItem="udT-lF-zKm" secondAttribute="centerY" id="xJ7-bv-yL4"/>
<constraint firstItem="7AB-yP-Tm5" firstAttribute="centerX" secondItem="Bnn-dY-5vI" secondAttribute="centerX" id="xO4-kI-Ieb"/>
<constraint firstItem="QPA-Ty-yka" firstAttribute="top" secondItem="jqU-bc-Phd" secondAttribute="bottom" constant="8" id="yI5-7z-lKi"/>
</constraints>
</view>
<point key="canvasLocation" x="13" y="272"/>
<point key="canvasLocation" x="13" y="271.5"/>
</window>
</objects>
<resources>
Expand Down
1 change: 0 additions & 1 deletion PredatorCore/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ public protocol Configuration {
var reverse: Bool { get }
var twentyFourHours: Bool { get }
var twelveHours: Bool { get }
var autoUpdates: Bool { get }
var drawEmptyDigits: Bool { get }
}
16 changes: 8 additions & 8 deletions PredatorCore/PredatorClock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ final public class PredatorClock {
let p4 = CGPoint(x: p1.x - shape.width * 1.013, y: p1.y - shape.width * 0.934)
let p5 = CGPoint(x: p1.x + shape.width * 0.113, y: p1.y - shape.width * 0.234)
let p6 = CGPoint(x: p4.x - shape.width * 0.137, y: p4.y - shape.height * 0.431)
let p7 = CGPoint(x: p1.x, y: p6.y - shape.width * 1.543)
let p8 = CGPoint(x: p1.x + shape.width * 0.313, y: p7.y - shape.height)
let p7 = CGPoint(x: p1.x - shape.width * 0.068, y: p6.y - shape.width * 1.543)
let p8 = CGPoint(x: p1.x + shape.width * 0.237, y: p7.y - shape.height)
let p9 = CGPoint(x: p1.x + shape.width * 0.268, y: p6.y - shape.width * 0.713)
// Drawing
let isEnabled = { (value: Int, part: Int) -> Bool in
Expand Down Expand Up @@ -130,8 +130,8 @@ final public class PredatorClock {
let p4 = CGPoint(x: p1.x - shape.width * 1.013, y: p1.y - shape.width * 0.934)
let p5 = CGPoint(x: p1.x + shape.width * 0.113, y: p1.y - shape.width * 0.234)
let p6 = CGPoint(x: p4.x - shape.width * 0.137, y: p4.y - shape.height * 0.431)
let p7 = CGPoint(x: p1.x, y: p6.y - shape.width * 1.543)
let p8 = CGPoint(x: p1.x + shape.width * 0.313, y: p7.y - shape.height)
let p7 = CGPoint(x: p1.x - shape.width * 0.068, y: p6.y - shape.width * 1.543)
let p8 = CGPoint(x: p1.x + shape.width * 0.237, y: p7.y - shape.height)
let p9 = CGPoint(x: p1.x + shape.width * 0.268, y: p6.y - shape.width * 0.713)
// Drawing
draw(p1, 90, (value >= 1))
Expand Down Expand Up @@ -162,8 +162,8 @@ final public class PredatorClock {
let p4 = CGPoint(x: p1.x - shape.width * 1.013, y: p1.y - shape.width * 0.934)
let p5 = CGPoint(x: p1.x + shape.width * 0.113, y: p1.y - shape.width * 0.234)
let p6 = CGPoint(x: p4.x - shape.width * 0.137, y: p4.y - shape.height * 0.431)
let p7 = CGPoint(x: p1.x, y: p6.y - shape.width * 1.543)
let p8 = CGPoint(x: p1.x + shape.width * 0.313, y: p7.y - shape.height)
let p7 = CGPoint(x: p1.x - shape.width * 0.068, y: p6.y - shape.width * 1.543)
let p8 = CGPoint(x: p1.x + shape.width * 0.237, y: p7.y - shape.height)
let p9 = CGPoint(x: p1.x + shape.width * 0.268, y: p6.y - shape.width * 0.713)
// Drawing
draw(p1, 90, (value >= 1))
Expand Down Expand Up @@ -192,8 +192,8 @@ final public class PredatorClock {
let p4 = CGPoint(x: p1.x - shape.width * 1.013, y: p1.y - shape.width * 0.934)
let p5 = CGPoint(x: p1.x + shape.width * 0.113, y: p1.y - shape.width * 0.234)
let p6 = CGPoint(x: p4.x - shape.width * 0.137, y: p4.y - shape.height * 0.431)
let p7 = CGPoint(x: p1.x, y: p6.y - shape.width * 1.543)
let p8 = CGPoint(x: p1.x + shape.width * 0.313, y: p7.y - shape.height)
let p7 = CGPoint(x: p1.x - shape.width * 0.068, y: p6.y - shape.width * 1.543)
let p8 = CGPoint(x: p1.x + shape.width * 0.237, y: p7.y - shape.height)
let p9 = CGPoint(x: p1.x + shape.width * 0.268, y: p6.y - shape.width * 0.713)
// Drawing
draw(p1, 90, (value >= 1))
Expand Down
3 changes: 1 addition & 2 deletions PredatorSandbox/PredatorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ import Cocoa
import PredatorCore

class MainConfiguration: Configuration {
var primaryColor: NSColor = .red
var primaryColor: NSColor = .orange
var reverse: Bool = false
var twentyFourHours: Bool = true
var twelveHours: Bool = false
var autoUpdates: Bool = false
var drawEmptyDigits: Bool = false
}

Expand Down
Loading

0 comments on commit 9871748

Please sign in to comment.