refactor: modernize Cast discovery and app activation
This commit is contained in:
@@ -3173,7 +3173,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
NSApp.setActivationPolicy(.regular)
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
NSApp.activate()
|
||||
NSAppleEventManager.shared().setEventHandler(self, andSelector: #selector(openDocuments(_:withReplyEvent:)),
|
||||
forEventClass: AEEventClass(kCoreEventClass), andEventID: AEEventID(kAEOpenDocuments))
|
||||
let arguments = Array(CommandLine.arguments.dropFirst())
|
||||
@@ -3229,7 +3229,7 @@ public func terebiAppMain() {
|
||||
} catch {
|
||||
FileHandle.standardError.write(Data("terebi: \(error.localizedDescription)\n".utf8))
|
||||
NSApplication.shared.setActivationPolicy(.regular)
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
NSApp.activate()
|
||||
let alert = NSAlert()
|
||||
alert.alertStyle = .critical
|
||||
alert.messageText = "Could not load Terebi configuration"
|
||||
@@ -3254,7 +3254,7 @@ public func terebiAppMain() {
|
||||
PlayerModel.shared.shutdown()
|
||||
FileHandle.standardError.write(Data("terebi: \(error)\n".utf8))
|
||||
NSApp.setActivationPolicy(.regular)
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
NSApp.activate()
|
||||
let alert = NSAlert()
|
||||
alert.alertStyle = .critical
|
||||
alert.messageText = "Could not initialize playback progress reporting"
|
||||
|
||||
Reference in New Issue
Block a user