TagSpaces is an offline, open source, document manager with tagging support
fix: disabling global shortcuts by default
Ilian Sapundshiev5194826fbdfe
diff --git a/package-lock.json b/package-lock.jsonindex 047cc977d..f9a902021 100644--- a/package-lock.json+++ b/package-lock.json@@ -197,7 +197,7 @@"yarn": "please-use-npm"},"optionalDependencies": {- "@tagspacespro/tagspacespro": "5.0.26-alpha.3"+ "@tagspacespro/tagspacespro": "5.0.28"}},"node_modules/@aashutoshrathi/word-wrap": {@@ -13596,9 +13596,9 @@}},"node_modules/@tagspacespro/tagspacespro": {- "version": "5.0.26-alpha.3",- "resolved": "https://npm.pkg.github.com/download/@tagspacespro/tagspacespro/5.0.26-alpha.3/d616f07bcddf380b28e2f2d75d9fbbd6531c9dc2",- "integrity": "sha512-DOaIN0L+L5CMBtWtDZYMaAoPsImVKiCgDw47LfD08kXcrrmNQEdSjM1VBnRfilzNUUNiLr4av6u+NIkKxSVRCQ==",+ "version": "5.0.28",+ "resolved": "https://npm.pkg.github.com/download/@tagspacespro/tagspacespro/5.0.28/c880b1ecb2c5879844c15a4b28f138dbdb4cdea0",+ "integrity": "sha512-k/RL19/laPq090csEqWRd1ajJyIIwSi6Vsgws/RfqhdPjMWGohoNIzEF/c8gnTmw5JQxzWFMkq+JepBhL3c1Jg==","license": "Proprietary","optional": true},@@ -59235,9 +59235,9 @@}},"@tagspacespro/tagspacespro": {- "version": "5.0.26-alpha.3",- "resolved": "https://npm.pkg.github.com/download/@tagspacespro/tagspacespro/5.0.26-alpha.3/d616f07bcddf380b28e2f2d75d9fbbd6531c9dc2",- "integrity": "sha512-DOaIN0L+L5CMBtWtDZYMaAoPsImVKiCgDw47LfD08kXcrrmNQEdSjM1VBnRfilzNUUNiLr4av6u+NIkKxSVRCQ==",+ "version": "5.0.28",+ "resolved": "https://npm.pkg.github.com/download/@tagspacespro/tagspacespro/5.0.28/c880b1ecb2c5879844c15a4b28f138dbdb4cdea0",+ "integrity": "sha512-k/RL19/laPq090csEqWRd1ajJyIIwSi6Vsgws/RfqhdPjMWGohoNIzEF/c8gnTmw5JQxzWFMkq+JepBhL3c1Jg==","optional": true},"@teamsupercell/typings-for-css-modules-loader": {diff --git a/src/main/electron-tray-menu.ts b/src/main/electron-tray-menu.tsindex 050f7349c..ce59e8cb8 100644--- a/src/main/electron-tray-menu.ts+++ b/src/main/electron-tray-menu.ts@@ -29,7 +29,12 @@ const icon2xBlack =const icon2xWhite ='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAACXBIWXMAAACjAAAAowHwx5rOAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAA+FJREFUWIW1mV2IVVUUx/93ZjLTCDM0sDIqKY2G7AMq+0ChlCh8GAkCwUj7xPKhD4ueBgp6KRA0iKSggsAHw/BxqCfJIEoxMjKRKCU11KwpR7vdXw9rTnPuae919pm75w+HuXPOXmv/zt5rr732vS1AU6B+SdskrcrlsC+Xo5JakrYqI6Q0NaBvSXo0t9PcoK9LejqzT0l5QTdKejmjvy61Mi2mJyS9LYvPkL6T9Feir0WSZvzvLtDrNQS0iet9oK+Bv69CTnqd+uWSPpKlo5B2SFonqVO615K0QNLtkmYm99TDSC4BRp2RHAHOr9jcAOwptRkDXkwZ0clCLgZOOZC7gQsrNrOAnyvtOuN/H5sK0GuBow7kPuDigN2TkfYd4Ps60KYxeoWkEUmXRp4flMXtqcCzhRGbImYHvI6bgM6VQc6PPD8s6T5JR0v3zit9PhCxQ9IhSW2398TpnkX3IqjqOLCoYtMPbAfeAwaA2cAvgWkHWF839SmQM4BdDuRvwM0Bu82lNjuAC4BbgP2l++eAYaDVK+h04FMH8k/gzoDdcKDtbuASbHRvBO7FRjkp4XuQA+MjEdNZYEXA7jbH5hvgMqfPO4jk5phBH/Ch02EbeMixfxb4J2J7BBgM2NyKhVFQsY42xwywBbDOsS2uIeBMxMdJ4K5S28XACafPQ6EOXnMMAF5IgCxmZRnxUToDrAKuw99AfgKuqjrfUAM5nAi5EfgEyxiDwOGIv7bzIoy/wEKgK48+wkReC2lLIuTDTMTnF8Ac4GrggOM7pGPA9YXfcjx5NeUHpNWUS7GKqKwfgGuw1PR5IuSvWKX1n28B92OpJqaPsVRVBzmbeEV1BMudM4HPaiBPYIury3+fpKckTXN22YskTXf3YdNJSWsljQWezZO0S9JKWWET02lJKyTtDe3104BtNW/5JRZrKTG61BlZbw2MAnfH/BYf+oF3amC/BS5PAJ2Dv9JjkPd4fsv/tAjv0WX9iBXOMYfrsWS+BJgH7E2AHMPWiTsAoZsb8KfoGHBTwG41E2lpFKsD5gO/O77OAg/UQcZABawB/nY6+AOrfor2D2IlWxViP3GdA1amQHqgGncS26vBpmwIy68pU1xWG9sYkiDrQIsVfLqmw7XAXODrBpCrm0CmgAorv447HXeA57HjsVdkF20fbwqZCipsz62eyat6FStEskM2ARVwJXb+now6dB/gphRUNIvFsp7rBXIyoMJicaQB5Cu9Qk4WVNjRd2cC5HAOyF5AhdUH7zqQb+aC7BVUWH3wRgByU07IHKDF9VIJcivd33xkuXJ9hy9Jz0galBXi2X9l+xc7opIKau8a2gAAAABJRU5ErkJggg==';-export default function buildTrayMenu(mainPageProps: any, i18n, isMacLike) {+export default function buildTrayMenu(+ mainPageProps: any,+ i18n,+ isMacLike,+ globalShortcutsEnabled,+) {// const cKey = isMacLike ? ' - ⌘' : ' - Ctrl';// const sKey = isMacLike ? '⇧' : 'Shift';// const pKey = isMacLike ? ' ' : ' + ';@@ -59,49 +64,49 @@ export default function buildTrayMenu(mainPageProps: any, i18n, isMacLike) {type: 'separator',},{- label: i18n.t('showTagSpaces'), // + cKey + pKey + sKey + pKey + 'W',- accelerator: 'CmdOrCtrl+Shift+w',+ label: i18n.t('showTagSpaces'),+ accelerator: globalShortcutsEnabled ? 'CmdOrCtrl+Shift+w' : undefined,click: mainPageProps.showTagSpaces,},{- label: i18n.t('showSearch'), // + cKey + pKey + sKey + pKey + 'F',- accelerator: 'CmdOrCtrl+Shift+f',+ label: i18n.t('showSearch'),+ accelerator: globalShortcutsEnabled ? 'CmdOrCtrl+Shift+f' : undefined,click: mainPageProps.openSearch,},{type: 'separator',},{- label: i18n.t('newFileNote'), // + cKey + pKey + sKey + pKey + 'N',- accelerator: 'CmdOrCtrl+Shift+n',+ label: i18n.t('newFileNote'),+ accelerator: globalShortcutsEnabled ? 'CmdOrCtrl+Shift+n' : undefined,click: mainPageProps.toggleNewFileDialog,},{type: 'separator',},{- label: i18n.t('openNextFileTooltip'), // + cKey + pKey + sKey + pKey + 'D',- accelerator: 'CmdOrCtrl+Shift+d',+ label: i18n.t('openNextFileTooltip'),+ accelerator: globalShortcutsEnabled ? 'CmdOrCtrl+Shift+d' : undefined,click: openNextFile,},{- label: i18n.t('openPrevFileTooltip'), // + cKey + pKey + sKey + pKey + 'A',- accelerator: 'CmdOrCtrl+Shift+a',+ label: i18n.t('openPrevFileTooltip'),+ accelerator: globalShortcutsEnabled ? 'CmdOrCtrl+Shift+a' : undefined,click: openPrevFile,},{type: 'separator',},{- label: i18n.t('pauseResumePlayback'), // + cKey + pKey + sKey + pKey + 'P',- accelerator: 'CmdOrCtrl+Shift+p',+ label: i18n.t('pauseResumePlayback'),+ accelerator: globalShortcutsEnabled ? 'CmdOrCtrl+Shift+p' : undefined,click: playResumePlayback,},{type: 'separator',},{- label: i18n.t('quitTagSpaces'), // + cKey + pKey + 'Q',+ label: i18n.t('quitTagSpaces'),accelerator: 'CmdOrCtrl+q',click: quitApp,},diff --git a/src/main/main.ts b/src/main/main.tsindex 23b53ce75..8e7211eee 100644--- a/src/main/main.ts+++ b/src/main/main.ts@@ -50,6 +50,8 @@ function getUsedWsPort() {return usedWsPort;}*/+let globalShortcutsEnabled = false;+if (process.env.NODE_ENV === 'production') {const sourceMapSupport = require('source-map-support');sourceMapSupport.install();@@ -322,6 +324,7 @@ function bindTrayMenu(i18n) {},i18n,isMacLike,+ globalShortcutsEnabled,);}@@ -536,7 +539,6 @@ const createWindow = async (i18n) => {app.quit();},);-try {bindAppMenu(i18n);bindTrayMenu(i18n);@@ -695,7 +697,13 @@ appmainWindow?.webContents.setZoomFactor(zoomLevel);});- ipcMain.on('global-shortcuts-enabled', (e, globalShortcutsEnabled) => {+ ipcMain.on('global-shortcuts-enabled', (e, globalShortcuts) => {+ globalShortcutsEnabled = globalShortcuts;+ try {+ bindTrayMenu(i18n);+ } catch (ex) {+ console.log('buildMenus', ex);+ }if (globalShortcutsEnabled) {globalShortcut.register('CommandOrControl+Shift+F', showSearch);globalShortcut.register('CommandOrControl+Shift+P', resumePlayback);diff --git a/src/renderer/reducers/settings-default.ts b/src/renderer/reducers/settings-default.tsindex 6f9a6b709..38830b862 100644--- a/src/renderer/reducers/settings-default.ts+++ b/src/renderer/reducers/settings-default.ts@@ -82,7 +82,7 @@ export default {currentDarkTheme: 'darklegacy',geoTaggingFormat: 'pluscodes',defaultPerspective: PerspectiveIDs.GRID,- enableGlobalKeyboardShortcuts: true,+ enableGlobalKeyboardShortcuts: false,zoomFactor: 1,lastPublishedVersion: '',entrySplitSize: '45%', // AppConfig.isElectron ? '560px' : '360px',