()
| 87 | } |
| 88 | |
| 89 | private setupIPC(): void { |
| 90 | ipcMain.handle('get-apps', () => this.getApps()) |
| 91 | ipcMain.handle('get-commands', () => this.getCommands()) |
| 92 | ipcMain.handle('launch', (_event, options: any) => this.launch(options)) |
| 93 | ipcMain.handle('launch-as-admin', (_event, appPath: string, name?: string) => |
| 94 | this.launchAsAdmin(appPath, name) |
| 95 | ) |
| 96 | ipcMain.handle('refresh-apps-cache', () => this.refreshAppsCache()) |
| 97 | |
| 98 | // 历史记录管理 |
| 99 | ipcMain.handle( |
| 100 | 'remove-from-history', |
| 101 | (_event, appPath: string, featureCode?: string, name?: string) => |
| 102 | this.removeFromHistory(appPath, featureCode, name) |
| 103 | ) |
| 104 | |
| 105 | // 固定应用管理 |
| 106 | ipcMain.handle('pin-app', (_event, app: any) => this.pinApp(app)) |
| 107 | ipcMain.handle('unpin-app', (_event, appPath: string, featureCode?: string, name?: string) => |
| 108 | this.unpinApp(appPath, featureCode, name) |
| 109 | ) |
| 110 | ipcMain.handle('update-pinned-order', (_event, newOrder: any[]) => |
| 111 | this.updatePinnedOrder(newOrder) |
| 112 | ) |
| 113 | |
| 114 | // 上次匹配状态管理 |
| 115 | ipcMain.handle('get-last-match-state', () => this.getLastMatchState()) |
| 116 | ipcMain.handle('restore-last-match', () => this.restoreLastMatch()) |
| 117 | |
| 118 | // 使用统计管理 |
| 119 | ipcMain.handle('get-usage-stats', () => this.getUsageStats()) |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * 设置本地应用搜索开启状态 |
no test coverage detected