Make UserApp properties and methods public.

This commit is contained in:
Brent Simmons 2018-01-14 11:00:29 -08:00
parent bbf2b8f130
commit 75d0752a67

View File

@ -11,15 +11,15 @@ import Cocoa
// Represents an app (the type of app mostly found in /Applications.) // Represents an app (the type of app mostly found in /Applications.)
// The app may or may not be running. It may or may not exist. // The app may or may not be running. It may or may not exist.
final class UserApp { public final class UserApp {
let bundleID: String public let bundleID: String
var icon: NSImage? = nil public var icon: NSImage? = nil
var existsOnDisk = false public var existsOnDisk = false
var path: String? = nil public var path: String? = nil
var runningApplication: NSRunningApplication? = nil public var runningApplication: NSRunningApplication? = nil
var isRunning: Bool { public var isRunning: Bool {
updateStatus() updateStatus()
if let runningApplication = runningApplication { if let runningApplication = runningApplication {
@ -28,13 +28,13 @@ final class UserApp {
return false return false
} }
init(bundleID: String) { public init(bundleID: String) {
self.bundleID = bundleID self.bundleID = bundleID
updateStatus() updateStatus()
} }
func updateStatus() { public func updateStatus() {
if let runningApplication = runningApplication, runningApplication.isTerminated { if let runningApplication = runningApplication, runningApplication.isTerminated {
self.runningApplication = nil self.runningApplication = nil
@ -83,7 +83,7 @@ final class UserApp {
} }
} }
func launchIfNeeded() -> Bool { public func launchIfNeeded() -> Bool {
// Return true if already running. // Return true if already running.
// Return true if not running and successfully gets launched. // Return true if not running and successfully gets launched.
@ -110,7 +110,7 @@ final class UserApp {
return false return false
} }
func bringToFront() -> Bool { public func bringToFront() -> Bool {
// Activates the app, ignoring other apps. // Activates the app, ignoring other apps.
// Does not automatically launch the app first. // Does not automatically launch the app first.