refactor: modernize Cast discovery and app activation

This commit is contained in:
2026-10-22 09:16:19 +02:00
parent f1893a5a5f
commit 419ac8d677
8 changed files with 279 additions and 67 deletions
+3 -3
View File
@@ -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"