@@ -25,21 +25,24 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
2525 AppDelegate . shared = self
2626
2727 setUpMainMenu ( )
28- registerServices ( )
29- registerHotKeys ( )
28+ if ! TTSRuntime . isPreview {
29+ registerServices ( )
30+ registerHotKeys ( )
31+ }
3032 observeState ( )
3133 appState . agentAccess . startPairing ( )
3234
3335 // Opening the app does not refresh cloud voices. Settings already
3436 // loads voice/model inventory when the user opens it.
3537 mainWindow . show ( ) // open the management window on launch
3638
37- Log . app . info ( " Codebasic TTS launched. Backend: \( self . appState . backendIdentity , privacy : . public ) " )
39+ Log . app . info ( " \( TTSRuntime . displayName , privacy : . public ) launched. Backend: \( self . appState . backendIdentity , privacy : . public ) " )
3840 }
3941
4042 // MARK: - Local MCP opt-in
4143
4244 @ objc private func toggleLocalSpeech ( ) {
45+ guard ! TTSRuntime . isPreview else { return }
4346 if let socket = localSpeechSocket {
4447 socket . stop ( ) ; localSpeechSocket = nil ; localSpeechGate = nil
4548 localSpeechMenu ? . state = . off
@@ -64,6 +67,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
6467 @ objc private func toggleLocalInstructions ( ) { toggleInstructionSharing ( ) }
6568
6669 func toggleInstructionSharing ( preselect : LocalInstructionProfile . Name ? = nil ) {
70+ guard ! TTSRuntime . isPreview else { return }
6771 if localInstructionSocket != nil { revokeLocalInstructions ( ) ; return }
6872 guard appState . agentAccess . shared == nil else {
6973 showInstructionShareError ( " 활성 에이전트 지시 조회를 먼저 해제하세요. " )
@@ -241,7 +245,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
241245
242246 // MARK: - Global hotkeys (read/explain the selection from any app)
243247
244- private let hotKeys = HotKeyCenter ( )
248+ private lazy var hotKeys = HotKeyCenter ( )
245249
246250 /// ⌃⌥⌘R → read the selection aloud. The selection is
247251 /// grabbed via a clipboard-preserving copy, so it works even where the
@@ -267,6 +271,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
267271 /// Called by ServiceProvider when the user picks "Codebasic TTS": synthesize
268272 /// the selected text (cache-first) and play it without opening the window.
269273 func handleSelectedText ( _ text : String ) {
274+ guard ! TTSRuntime . isPreview else { return }
270275 let preview = text . replacingOccurrences ( of : " \n " , with : " " ) . prefix ( 60 )
271276 Log . app . info ( " handleSelectedText: \( text . count ) chars — \" \( preview , privacy : . public ) \" " )
272277 appState . captureHUDTarget ( )
@@ -280,25 +285,27 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
280285
281286 let appItem = NSMenuItem ( )
282287 main . addItem ( appItem )
283- let appMenu = NSMenu ( title : " Codebasic TTS " )
288+ let appMenu = NSMenu ( title : TTSRuntime . displayName )
284289 appItem . submenu = appMenu
285- appMenu . addItem ( withTitle : " 설정… " , action : #selector( openSettings ) , keyEquivalent : " , " ) . target = self
286- appMenu . addItem ( . separator ( ) )
287- appMenu . addItem ( withTitle : " 재생 중지 " , action : #selector( stopSpeaking ) , keyEquivalent : " " ) . target = self
288- let local = appMenu . addItem ( withTitle : " 로컬 MCP 음성 입력 허용 (이번 실행) " ,
289- action : #selector( toggleLocalSpeech ) , keyEquivalent : " " )
290- local . target = self
291- localSpeechMenu = local
292- let instructions = appMenu . addItem ( withTitle : " 로컬 MCP 지시 공유 (이번 실행)… " ,
293- action : #selector( toggleLocalInstructions ) , keyEquivalent : " " )
294- instructions . target = self
295- localInstructionMenu = instructions
290+ if ! TTSRuntime . isPreview {
291+ appMenu . addItem ( withTitle : " 설정… " , action : #selector( openSettings ) , keyEquivalent : " , " ) . target = self
292+ appMenu . addItem ( . separator ( ) )
293+ appMenu . addItem ( withTitle : " 재생 중지 " , action : #selector( stopSpeaking ) , keyEquivalent : " " ) . target = self
294+ let local = appMenu . addItem ( withTitle : " 로컬 MCP 음성 입력 허용 (이번 실행) " ,
295+ action : #selector( toggleLocalSpeech ) , keyEquivalent : " " )
296+ local . target = self
297+ localSpeechMenu = local
298+ let instructions = appMenu . addItem ( withTitle : " 로컬 MCP 지시 공유 (이번 실행)… " ,
299+ action : #selector( toggleLocalInstructions ) , keyEquivalent : " " )
300+ instructions . target = self
301+ localInstructionMenu = instructions
302+ }
296303 let draftReceipt = appMenu . addItem ( withTitle : " 외부 대본 받기 허용 (이번 실행) " ,
297304 action : #selector( toggleDraftReceipt ) , keyEquivalent : " " )
298305 draftReceipt . target = self
299306 draftReceiptMenu = draftReceipt
300307 appMenu . addItem ( . separator ( ) )
301- appMenu . addItem ( withTitle : " Codebasic TTS 가리기" , action : #selector( NSApplication . hide ( _ : ) ) , keyEquivalent : " h " )
308+ appMenu . addItem ( withTitle : " \( TTSRuntime . displayName ) 가리기 " , action : #selector( NSApplication . hide ( _ : ) ) , keyEquivalent : " h " )
302309 appMenu . addItem ( withTitle : " 다른 항목 가리기 " ,
303310 action : #selector( NSApplication . hideOtherApplications ( _ : ) ) , keyEquivalent : " h " )
304311 . keyEquivalentModifierMask = [ . command , . option ]
@@ -324,8 +331,10 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
324331 windowMenu . addItem ( withTitle : " 최소화 " , action : #selector( NSWindow . performMiniaturize ( _ : ) ) , keyEquivalent : " m " )
325332 windowMenu . addItem ( withTitle : " 닫기 " , action : #selector( NSWindow . performClose ( _ : ) ) , keyEquivalent : " w " )
326333 windowMenu . addItem ( . separator ( ) )
327- windowMenu . addItem ( withTitle : " Codebasic TTS 열기 " , action : #selector( openWindow ) , keyEquivalent : " " ) . target = self
328- windowMenu . addItem ( withTitle : " 재생 기록 " , action : #selector( openHistory ) , keyEquivalent : " " ) . target = self
334+ windowMenu . addItem ( withTitle : " \( TTSRuntime . displayName ) 열기 " , action : #selector( openWindow ) , keyEquivalent : " " ) . target = self
335+ if ! TTSRuntime . isPreview {
336+ windowMenu . addItem ( withTitle : " 재생 기록 " , action : #selector( openHistory ) , keyEquivalent : " " ) . target = self
337+ }
329338 NSApp . windowsMenu = windowMenu
330339
331340 NSApp . mainMenu = main
0 commit comments