mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Complete rename of all OpenClaw/OPENCLAW/openclaw references to Hanzo Bot/BOT/bot naming convention: - Env vars: OPENCLAW_* → BOT_* (18 patterns) - Config: ~/.openclaw/ → ~/.bot/, openclaw.json → bot.json - Packages: @openclaw/* → @hanzo/bot-* - Domains: openclaw.ai → hanzo.bot - Mobile: OpenClawKit → BotKit, bundle IDs ai.openclaw → ai.hanzo.bot - mDNS: _openclaw-gw._tcp → _bot-gw._tcp - Docker: CMD hanzo-bot.mjs, BOT_PREFER_PNPM, BOT_DOCKER_APT_PACKAGES - CI: docker-release.yml adds :latest tag on main branch
37 lines
1.0 KiB
Swift
37 lines
1.0 KiB
Swift
import AppKit
|
|
import SwiftUI
|
|
|
|
@objc
|
|
private protocol SettingsWindowMenuActions {
|
|
@objc(showSettingsWindow:)
|
|
optional func showSettingsWindow(_ sender: Any?)
|
|
|
|
@objc(showPreferencesWindow:)
|
|
optional func showPreferencesWindow(_ sender: Any?)
|
|
}
|
|
|
|
@MainActor
|
|
final class SettingsWindowOpener {
|
|
static let shared = SettingsWindowOpener()
|
|
|
|
private var openSettingsAction: OpenSettingsAction?
|
|
|
|
func register(openSettings: OpenSettingsAction) {
|
|
self.openSettingsAction = openSettings
|
|
}
|
|
|
|
func open() {
|
|
NSApp.activate(ignoringOtherApps: true)
|
|
if let openSettingsAction {
|
|
openSettingsAction()
|
|
return
|
|
}
|
|
|
|
// Fallback path: mimic the built-in Settings menu item action.
|
|
let didOpen = NSApp.sendAction(#selector(SettingsWindowMenuActions.showSettingsWindow(_:)), to: nil, from: nil)
|
|
if !didOpen {
|
|
_ = NSApp.sendAction(#selector(SettingsWindowMenuActions.showPreferencesWindow(_:)), to: nil, from: nil)
|
|
}
|
|
}
|
|
}
|