diff --git a/src/main/tray.ts b/src/main/tray.ts index 38af617..a78472f 100644 --- a/src/main/tray.ts +++ b/src/main/tray.ts @@ -1,6 +1,33 @@ import electron from 'electron'; import type { Tray as TrayType, MenuItemConstructorOptions } from 'electron'; -const { app, Tray, Menu, nativeImage } = electron; +import { platform, release } from 'node:os'; +const { app, Tray, Menu, nativeImage, dialog, shell, clipboard } = electron; + +function showAboutDialog(): void { + const version = app.getVersion(); + const electronVersion = process.versions.electron ?? '?'; + const nodeVersion = process.versions.node ?? '?'; + const profileDir = app.getPath('userData'); + const detail = [ + `버전: ${version}`, + `Electron: ${electronVersion}`, + `Node: ${nodeVersion}`, + `OS: ${platform()} ${release()}`, + `데이터 위치: ${profileDir}` + ].join('\n'); + void dialog.showMessageBox({ + type: 'info', + title: 'Inkling 정보', + message: `Inkling ${version}`, + detail, + buttons: ['확인', '데이터 위치 열기', '정보 복사'], + defaultId: 0, + cancelId: 0 + }).then((r) => { + if (r.response === 1) void shell.openPath(profileDir); + if (r.response === 2) clipboard.writeText(`Inkling ${version}\n${detail}`); + }); +} let tray: TrayType | null = null; let _showInbox: () => void = () => {}; @@ -60,6 +87,7 @@ function buildMenu() { } else { items.push({ type: 'separator' }); } + items.push({ label: 'Inkling 정보...', click: showAboutDialog }); items.push({ label: '종료', click: () => { app.isQuitting = true; app.quit(); } }); return Menu.buildFromTemplate(items); }