SPB Git

spb/zyquo-cloud Public MIT

Native macOS AI chat client for 12 cloud providers — your keys, every cloud model, one beautiful chat.

Swift 97.4% Shell 1.7% Makefile 1%
752 B · 26 lines swift
Raw Blame History
1//2//  SettingsOpener.swift3//  Zyquo Cloud4//5//  Author: Simon-Pierre Boucher6//  Mail: contact@spboucher.ai7//8//  Opens the Settings scene from anywhere. SwiftUI's openSettings environment9//  action requires macOS 14; this selector-based helper works on macOS 13 too.10//1112import AppKit1314enum SettingsOpener {15    @MainActor16    static func open() {17        NSApplication.shared.activate(ignoringOtherApps: true)18        // macOS 13+ selector for the SwiftUI Settings scene.19        if NSApp.responds(to: Selector(("showSettingsWindow:"))) {20            NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil)21        } else {22            NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil)23        }24    }25}26