feat(electron): 实现系统托盘和关闭行为配置功能
- 添加系统托盘创建和销毁逻辑- 实现窗口关闭行为配置(退出/最小化/托盘) - 添加配置文件读写功能 - 实现下载取消和清理功能 - 添加待更新文件检查机制 - 优化文件下载进度和错误处理 - 添加自动更新配置选项- 实现平滑滚动动画效果 - 添加试用期过期类型检查 -优化VIP状态刷新逻辑
This commit is contained in:
@@ -10,6 +10,8 @@ const electronAPI = {
|
||||
installUpdate: () => ipcRenderer.invoke('install-update'),
|
||||
cancelDownload: () => ipcRenderer.invoke('cancel-download'),
|
||||
getUpdateStatus: () => ipcRenderer.invoke('get-update-status'),
|
||||
checkPendingUpdate: () => ipcRenderer.invoke('check-pending-update'),
|
||||
clearUpdateFiles: () => ipcRenderer.invoke('clear-update-files'),
|
||||
|
||||
// 添加文件保存对话框 API
|
||||
showSaveDialog: (options: any) => ipcRenderer.invoke('show-save-dialog', options),
|
||||
@@ -21,7 +23,12 @@ const electronAPI = {
|
||||
getLogDates: () => ipcRenderer.invoke('get-log-dates'),
|
||||
readLogFile: (logDate: string) => ipcRenderer.invoke('read-log-file', logDate),
|
||||
|
||||
// 关闭行为配置 API
|
||||
getCloseAction: () => ipcRenderer.invoke('get-close-action'),
|
||||
setCloseAction: (action: 'quit' | 'minimize' | 'tray') => ipcRenderer.invoke('set-close-action', action),
|
||||
|
||||
onDownloadProgress: (callback: (progress: any) => void) => {
|
||||
ipcRenderer.removeAllListeners('download-progress')
|
||||
ipcRenderer.on('download-progress', (event, progress) => callback(progress))
|
||||
},
|
||||
removeDownloadProgressListener: () => {
|
||||
|
||||
Reference in New Issue
Block a user