Phase 7~8 구현: 테스트 + 빌드 + CI/CD + SoundEffect + AutoLaunch + UI 리디자인
- vitest 41개 단위 테스트 (HistoryService, DictionaryService, CustomInstructionService, VoiceModeService, D3ROError) - electron-builder.yml (NSIS, asarUnpack, extraResources) - .gitlab-ci.yml (lint, typecheck, test, build, release) - SoundEffectService: WAV 프리로드 + PowerShell 재생 + VoiceMode 연동 - AutoLaunchService: app.setLoginItemSettings + ConfigService 동기화 - TextInsertService: 간이 삽입 검증 (EditMonitor 경량) - 번들링 인프라: SoX 다운로드 스크립트, PyInstaller 빌드, 경로 해상도 유틸 - AudioCaptureService/LocalSTTService: 번들 경로 자동 감지 - 08-design-system.md 기반 MUI 테마 (다크+라이트+auto 테마 시스템) - 전체 UI 컴포넌트 리디자인: AppLayout, Dashboard, StatusBar, History, Dictionary, Commands, Settings - 효과음 WAV 생성: recording-start, recording-stop, error - EPIPE 에러 핸들링 추가
This commit is contained in:
parent
ed5541f769
commit
3f4d0c5828
40 changed files with 6034 additions and 580 deletions
67
src/main/services/AutoLaunchService.ts
Normal file
67
src/main/services/AutoLaunchService.ts
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
// src/main/services/AutoLaunchService.ts
|
||||
// 시스템 시작 시 자동 실행 관리. 설계서 01 IAutoLaunchService 구현.
|
||||
|
||||
import { app } from 'electron'
|
||||
import { getLogger } from './LoggerService'
|
||||
import { configGet, configSet } from './ConfigService'
|
||||
|
||||
const logger = getLogger('AutoLaunchService')
|
||||
|
||||
class AutoLaunchService {
|
||||
/**
|
||||
* 현재 자동 실행 설정 상태를 조회한다.
|
||||
*/
|
||||
isEnabled(): boolean {
|
||||
// Electron API로 실제 OS 설정 확인
|
||||
const settings = app.getLoginItemSettings()
|
||||
return settings.openAtLogin
|
||||
}
|
||||
|
||||
/**
|
||||
* 자동 실행을 활성화/비활성화한다.
|
||||
*/
|
||||
setEnabled(enabled: boolean): void {
|
||||
try {
|
||||
app.setLoginItemSettings({
|
||||
openAtLogin: enabled,
|
||||
// Windows: 시작 프로그램에 등록
|
||||
// 개발 모드에서는 electron.exe 경로가 등록되므로 주의
|
||||
args: app.isPackaged ? [] : [app.getAppPath()]
|
||||
})
|
||||
|
||||
configSet('autoLaunch', enabled)
|
||||
logger.info(`Auto launch ${enabled ? 'enabled' : 'disabled'}`)
|
||||
} catch (err) {
|
||||
logger.error(`Failed to set auto launch: ${err instanceof Error ? err.message : String(err)}`)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ConfigService의 설정과 OS 설정을 동기화한다.
|
||||
* bootstrap에서 호출.
|
||||
*/
|
||||
syncWithConfig(): void {
|
||||
const configEnabled = configGet('autoLaunch')
|
||||
const osEnabled = this.isEnabled()
|
||||
|
||||
if (configEnabled !== osEnabled) {
|
||||
logger.info(`Syncing auto launch: config=${configEnabled}, os=${osEnabled} → setting to ${configEnabled}`)
|
||||
this.setEnabled(configEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
logger.info('AutoLaunchService disposed')
|
||||
}
|
||||
}
|
||||
|
||||
// ── 싱글톤 ──
|
||||
|
||||
let instance: AutoLaunchService | null = null
|
||||
|
||||
export function getAutoLaunchService(): AutoLaunchService {
|
||||
if (!instance) {
|
||||
instance = new AutoLaunchService()
|
||||
}
|
||||
return instance
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue