From 48ff5af24ecf1d0eb9309b1426e85956788c9923 Mon Sep 17 00:00:00 2001 From: Hiram <> Date: Mon, 4 Mar 2024 22:05:26 +0800 Subject: [PATCH] fix start app is not resgin recordShortcut --- src/main/core/db/init/tbl_setting.json | 6 ------ src/main/index.ts | 9 ++++++++- src/renderer/src/pages/setting/base/BaseSetting.vue | 5 +---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/core/db/init/tbl_setting.json b/src/main/core/db/init/tbl_setting.json index 5e76747b6..f3b2c4159 100644 --- a/src/main/core/db/init/tbl_setting.json +++ b/src/main/core/db/init/tbl_setting.json @@ -5,9 +5,6 @@ { "key": "theme", "value": "auto" }, - { "key": "externalPlayer", - "value": "" - }, { "key": "defaultHot", "value": "kylive" }, @@ -38,9 +35,6 @@ { "key": "iptvStatus", "value": false }, - { "key": "pauseWhenMinimize", - "value": true - }, { "key": "defaultSite", "value": null }, diff --git a/src/main/index.ts b/src/main/index.ts index 3c84a8121..8453c09e6 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -16,7 +16,6 @@ import logger from './core/logger'; import autoUpdater from './core/update'; import createTray from './core/tray'; - import loadHtml from '../../resources/html/load.html?asset' /** @@ -45,6 +44,8 @@ if (!setting.find({ key: "hardwareAcceleration" }).value) { app.disableHardwareAcceleration(); }; +let shortcutsState: any = setting.find({ key: "recordShortcut" }).value; + let uaState: any = setting.find({ key: "ua" }).value; let windowState: any = setting.find({ key: "windowPosition" }).value || { @@ -264,6 +265,12 @@ app.whenReady().then(async() => { createMenu(); // 快捷键 // createGlobalShortcut(mainWindow); + if (shortcutsState) { + globalShortcut.register(shortcutsState, () => { + // Do stuff when Y and either Command/Control is pressed. + showOrHidden(); + }); + } app.on('activate', function () { // On macOS it's common to re-create a window in the app when the diff --git a/src/renderer/src/pages/setting/base/BaseSetting.vue b/src/renderer/src/pages/setting/base/BaseSetting.vue index 8560d694a..c39a33e4b 100644 --- a/src/renderer/src/pages/setting/base/BaseSetting.vue +++ b/src/renderer/src/pages/setting/base/BaseSetting.vue @@ -212,7 +212,6 @@ const theme = computed(() => { const formData = ref({ version: '3.3.2', theme: 'auto', - externalPlayer: '', defaultHot: 'kylive', defaultSearchRecommend: 'site', defaultSearchType: 'site', @@ -223,8 +222,6 @@ const formData = ref({ iptvSkipIpv6: true, iptvThumbnail: false, iptvStatus: false, - restoreWindowPositionAndSize: false, - pauseWhenMinimize: true, defaultSite: null, defaultIptv: null, defaultAnalyze: null, @@ -240,7 +237,7 @@ const formData = ref({ snifferType: 'pie', softSolution: false, skipStartEnd: false, - agreementMask: 'false', + agreementMask: false, recordShortcut: '', selfBoot: false, hardwareAcceleration: true,