mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-26 17:43:22 +01:00
Make UserApp properties and methods public.
This commit is contained in:
parent
bbf2b8f130
commit
75d0752a67
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user