From bb597851df8e81190eb453134872eaeda001a370 Mon Sep 17 00:00:00 2001 From: raa0121 Date: Thu, 2 Dec 2021 23:37:53 +0900 Subject: [PATCH 1/9] add electron-updater --- package-lock.json | 119 ++++++++++++++++++++++++++++++++++++++++++---- package.json | 1 + src/background.ts | 40 ++++++++++++++++ 3 files changed, 152 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 45ccfac8eb..1845db1d35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2219,6 +2219,11 @@ "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==", "dev": true }, + "@types/semver": { + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.9.tgz", + "integrity": "sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ==" + }, "@types/serve-static": { "version": "1.13.9", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.9.tgz", @@ -8317,6 +8322,98 @@ "integrity": "sha512-qKD5Pbq+QMk4nea4lMuncUMhpEiQwaJyCW7MrvissnRcBDENhVfDmAqQYRQ3X525oTzhar9Zh1cK0L2d1UKYcw==", "dev": true }, + "electron-updater": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-4.6.1.tgz", + "integrity": "sha512-YsU1mHqXLrXXmBMsxhxy24PrbaB8rnpZDPmFa2gOkTYk/Ch13+R0fjsRSpPYvqtskVVY0ux8fu+HnUkVkqc7og==", + "requires": { + "@types/semver": "^7.3.6", + "builder-util-runtime": "8.9.1", + "fs-extra": "^10.0.0", + "js-yaml": "^4.1.0", + "lazy-val": "^1.0.5", + "lodash.escaperegexp": "^4.1.2", + "lodash.isequal": "^4.5.0", + "semver": "^7.3.5" + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "builder-util-runtime": { + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.9.1.tgz", + "integrity": "sha512-c8a8J3wK6BIVLW7ls+7TRK9igspTbzWmUqxFbgK0m40Ggm6efUbxtWVCGIjc+dtchyr5qAMAUL6iEGRdS/6vwg==", + "requires": { + "debug": "^4.3.2", + "sax": "^1.2.4" + } + }, + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "requires": { + "ms": "2.1.2" + } + }, + "fs-extra": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "requires": { + "argparse": "^2.0.1" + } + }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } + }, "elegant-spinner": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz", @@ -9964,8 +10061,7 @@ "graceful-fs": { "version": "4.2.6", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", - "dev": true + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" }, "graceful-readlink": { "version": "1.0.1", @@ -11710,8 +11806,7 @@ "lazy-val": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/lazy-val/-/lazy-val-1.0.5.tgz", - "integrity": "sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==", - "dev": true + "integrity": "sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==" }, "levn": { "version": "0.3.0", @@ -12175,12 +12270,22 @@ "integrity": "sha1-uvr7yRi1UVTheRdqALsK76rIVLc=", "dev": true }, + "lodash.escaperegexp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=" + }, "lodash.flatten": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", "dev": true }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" + }, "lodash.kebabcase": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", @@ -13393,8 +13498,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "multicast-dns": { "version": "6.2.3", @@ -15960,8 +16064,7 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "saxes": { "version": "3.1.11", diff --git a/package.json b/package.json index e6d70d2e5b..184633c8ef 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "dayjs": "1.10.7", "electron-log": "4.4.1", "electron-store": "8.0.0", + "electron-updater": "4.6.1", "encoding-japanese": "1.0.30", "immer": "9.0.2", "markdown-it": "12.0.4", diff --git a/src/background.ts b/src/background.ts index 4d11dde27f..694febc600 100644 --- a/src/background.ts +++ b/src/background.ts @@ -25,6 +25,7 @@ import { StyleInfo, } from "./type/preload"; +import { autoUpdater } from "electron-updater" import log from "electron-log"; import dayjs from "dayjs"; @@ -47,6 +48,8 @@ if (isDevelopment) { ); } +autoUpdater.logger = log; + let win: BrowserWindow; // 多重起動防止 @@ -797,6 +800,7 @@ app.on("ready", async () => { } createWindow().then(() => runEngine()); + autoUpdater.checkForUpdatesAndNotify(); }); app.on("second-instance", () => { @@ -819,3 +823,39 @@ if (isDevelopment) { }); } } + +//------------------------------------------- +// 自動アップデート関連のイベント処理 +//------------------------------------------- +// アップデートをチェック開始 +autoUpdater.on('checking-for-update', () => { + log.info(process.pid, 'checking-for-update...'); +}); +// アップデートが見つかった +autoUpdater.on('update-available', (ev, info) => { + log.info(process.pid, 'Update available.'); +}); +// アップデートがなかった(最新版だった) +autoUpdater.on('update-not-available', (ev, info) => { + log.info(process.pid, 'Update not available.'); +}); +// アップデートのダウンロードが完了 +autoUpdater.on('update-downloaded', (info) => { + const dialogOpts = { + type: 'info', + buttons: ['更新して再起動', 'あとで'], + message: 'アップデート', + detail: '新しいバージョンをダウンロードしました。再起動して更新を適用しますか?' + } + + // ダイアログを表示しすぐに再起動するか確認 + dialog.showMessageBox(win, dialogOpts).then((returnValue) => { + if (returnValue.response === 0){ + autoUpdater.quitAndInstall() + } + }) +}); +// エラーが発生 +autoUpdater.on('error', (err) => { + log.error(process.pid, err); +}); From c4958bd3f8039f93bff7e333a4baa3cd095248c6 Mon Sep 17 00:00:00 2001 From: raa0121 Date: Thu, 2 Dec 2021 23:52:27 +0900 Subject: [PATCH 2/9] fix for lint --- src/background.ts | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/background.ts b/src/background.ts index 694febc600..bc887eb8fe 100644 --- a/src/background.ts +++ b/src/background.ts @@ -25,7 +25,7 @@ import { StyleInfo, } from "./type/preload"; -import { autoUpdater } from "electron-updater" +import { autoUpdater } from "electron-updater"; import log from "electron-log"; import dayjs from "dayjs"; @@ -828,34 +828,35 @@ if (isDevelopment) { // 自動アップデート関連のイベント処理 //------------------------------------------- // アップデートをチェック開始 -autoUpdater.on('checking-for-update', () => { - log.info(process.pid, 'checking-for-update...'); +autoUpdater.on("checking-for-update", () => { + log.info(process.pid, "checking-for-update..."); }); // アップデートが見つかった -autoUpdater.on('update-available', (ev, info) => { - log.info(process.pid, 'Update available.'); +autoUpdater.on("update-available", () => { + log.info(process.pid, "Update available."); }); // アップデートがなかった(最新版だった) -autoUpdater.on('update-not-available', (ev, info) => { - log.info(process.pid, 'Update not available.'); +autoUpdater.on("update-not-available", () => { + log.info(process.pid, "Update not available."); }); // アップデートのダウンロードが完了 -autoUpdater.on('update-downloaded', (info) => { +autoUpdater.on("update-downloaded", () => { const dialogOpts = { - type: 'info', - buttons: ['更新して再起動', 'あとで'], - message: 'アップデート', - detail: '新しいバージョンをダウンロードしました。再起動して更新を適用しますか?' - } + type: "info", + buttons: ["更新して再起動", "あとで"], + message: "アップデート", + detail: + "新しいバージョンをダウンロードしました。再起動して更新を適用しますか?", + }; // ダイアログを表示しすぐに再起動するか確認 dialog.showMessageBox(win, dialogOpts).then((returnValue) => { - if (returnValue.response === 0){ - autoUpdater.quitAndInstall() + if (returnValue.response === 0) { + autoUpdater.quitAndInstall(); } - }) + }); }); // エラーが発生 -autoUpdater.on('error', (err) => { +autoUpdater.on("error", (err) => { log.error(process.pid, err); }); From d4cca242d2baa48f8cfc782bc90896aefd8a65d0 Mon Sep 17 00:00:00 2001 From: raa0121 Date: Thu, 16 Dec 2021 20:57:59 +0900 Subject: [PATCH 3/9] =?UTF-8?q?=E8=B5=B7=E5=8B=95=E6=99=82=E3=83=81?= =?UTF-8?q?=E3=82=A7=E3=83=83=E3=82=AF=E3=82=92=E3=82=AA=E3=83=97=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=81=AB=E3=81=97=E3=80=81=E3=83=81=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=A7=E3=81=AE=E8=87=AA=E5=8B=95=E3=83=80?= =?UTF-8?q?=E3=82=A6=E3=83=B3=E3=83=AD=E3=83=BC=E3=83=89=E3=81=AF=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/background.ts | 33 +++++++++++++++++++++++++++++++- src/components/MenuBar.vue | 10 ++++++++++ src/components/SettingDialog.vue | 22 +++++++++++++++++++++ src/electron/preload.ts | 8 ++++++++ src/store/type.ts | 6 ++++++ src/store/ui.ts | 21 ++++++++++++++++++++ src/type/ipc.d.ts | 10 ++++++++++ src/type/preload.d.ts | 2 ++ 8 files changed, 111 insertions(+), 1 deletion(-) diff --git a/src/background.ts b/src/background.ts index bc887eb8fe..b0f192324e 100644 --- a/src/background.ts +++ b/src/background.ts @@ -49,6 +49,7 @@ if (isDevelopment) { } autoUpdater.logger = log; +autoUpdater.autoDownload = false; let win: BrowserWindow; @@ -175,6 +176,7 @@ const store = new Store<{ outputStereo: { type: "boolean", default: false }, outputSamplingRate: { type: "number", default: 24000 }, audioOutputDevice: { type: "string", default: "default" }, + enableAutoUpdateCheck: { type: "boolean", default: false }, }, default: { fileEncoding: "UTF-8", @@ -186,6 +188,7 @@ const store = new Store<{ outputStereo: false, outputSamplingRate: 24000, audioOutputDevice: "default", + enableAutoUpdateCheck: false, }, }, // To future developers: if you are to modify the store schema with array type, @@ -568,6 +571,18 @@ ipcMainHandle("INHERIT_AUDIOINFO", (_, { newValue }) => { return store.get("inheritAudioInfo", false); }); +ipcMainHandle("ENABLE_AUTO_UPDATE_CHECK", (_, { newValue }) => { + if (newValue !== undefined) { + store.set("enableAutoUpdateCheck", newValue); + } + + return store.get("enableAutoUpdateCheck", false); +}); + +ipcMainHandle("UPDATE_CHECK", () => { + autoUpdater.checkForUpdatesAndNotify(); +}); + ipcMainHandle("IS_AVAILABLE_GPU_MODE", () => { return hasSupportedGpu(); }); @@ -800,7 +815,10 @@ app.on("ready", async () => { } createWindow().then(() => runEngine()); - autoUpdater.checkForUpdatesAndNotify(); + const enableAutoUpdateCheck = store.get("enableAutoUpdateCheck", false); + if (enableAutoUpdateCheck) { + autoUpdater.checkForUpdatesAndNotify(); + } }); app.on("second-instance", () => { @@ -834,6 +852,19 @@ autoUpdater.on("checking-for-update", () => { // アップデートが見つかった autoUpdater.on("update-available", () => { log.info(process.pid, "Update available."); + const dialogOpts = { + type: "info", + buttons: ["はい", "いいえ"], + message: "アップデート", + detail: + "新しいバージョンをがありました。更新をダウンロードしますか?", + } + // ダイアログを表示しすぐに再起動するか確認 + dialog.showMessageBox(win, dialogOpts).then((returnValue) => { + if (returnValue.response === 0) { + autoUpdater.downloadUpdate(); + } + }); }); // アップデートがなかった(最新版だった) autoUpdater.on("update-not-available", () => { diff --git a/src/components/MenuBar.vue b/src/components/MenuBar.vue index 72daf76ccb..faa04ed21f 100644 --- a/src/components/MenuBar.vue +++ b/src/components/MenuBar.vue @@ -329,6 +329,16 @@ export default defineComponent({ }); }, }, + { type: "separator" }, + { + type: "button", + label: "アップデート確認", + onClick() { + store.dispatch("IS_UPDATE_CHECK_DIALOG_OPEN", { + isUpdateCheckDialogOpen: true, + }); + }, + }, ], }, { diff --git a/src/components/SettingDialog.vue b/src/components/SettingDialog.vue index 352698972b..d45d3f61da 100644 --- a/src/components/SettingDialog.vue +++ b/src/components/SettingDialog.vue @@ -305,6 +305,28 @@ + +
自動アップデートチェック
+ + + + 起動時にアップデートチェックを行います + + +
diff --git a/src/electron/preload.ts b/src/electron/preload.ts index 003d092177..72183fb07a 100644 --- a/src/electron/preload.ts +++ b/src/electron/preload.ts @@ -136,6 +136,14 @@ const api: Sandbox = { return ipcRendererInvoke("INHERIT_AUDIOINFO", { newValue }); }, + enableAutoUpdateCheck: (newValue) => { + return ipcRendererInvoke("ENABLE_AUTO_UPDATE_CHECK", { newValue }); + }, + + updateCheck: () => { + return ipcRendererInvoke("UPDATE_CHECK"); + }, + isAvailableGPUMode: () => { return ipcRendererInvoke("IS_AVAILABLE_GPU_MODE"); }, diff --git a/src/store/type.ts b/src/store/type.ts index 91722b0ffe..1d15c09155 100644 --- a/src/store/type.ts +++ b/src/store/type.ts @@ -661,6 +661,7 @@ export type UiStoreState = { inheritAudioInfo: boolean; isHelpDialogOpen: boolean; isSettingDialogOpen: boolean; + isUpdateCheckDialogOpen: boolean; isDefaultStyleSelectDialogOpen: boolean; isHotkeySettingDialogOpen: boolean; isMaximized: boolean; @@ -714,6 +715,11 @@ type UiStoreTypes = { action(payload: { isSettingDialogOpen: boolean }): void; }; + IS_UPDATE_CHECK_DIALOG_OPEN: { + mutation: { isUpdateCheckDialogOpen: boolean }; + action(payload: { isUpdateCheckDialogOpen: boolean }): void; + }; + IS_HOTKEY_SETTING_DIALOG_OPEN: { mutation: { isHotkeySettingDialogOpen: boolean }; action(payload: { isHotkeySettingDialogOpen: boolean }): void; diff --git a/src/store/ui.ts b/src/store/ui.ts index b7e2df5df1..7f47a337f1 100644 --- a/src/store/ui.ts +++ b/src/store/ui.ts @@ -33,6 +33,7 @@ export const uiStoreState: UiStoreState = { inheritAudioInfo: true, isHelpDialogOpen: false, isSettingDialogOpen: false, + isUpdateCheckDialogOpen: false, isHotkeySettingDialogOpen: false, isDefaultStyleSelectDialogOpen: false, isMaximized: false, @@ -78,6 +79,12 @@ export const uiStore: VoiceVoxStoreOptions = ) { state.isSettingDialogOpen = isSettingDialogOpen; }, + IS_UPDATE_CHECK_DIALOG_OPEN( + state, + { isUpdateCheckDialogOpen }: { isUpdateCheckDialogOpen: boolean } + ) { + state.isUpdateCheckDialogOpen = isUpdateCheckDialogOpen; + }, IS_HOTKEY_SETTING_DIALOG_OPEN(state, { isHotkeySettingDialogOpen }) { state.isHotkeySettingDialogOpen = isHotkeySettingDialogOpen; }, @@ -162,6 +169,20 @@ export const uiStore: VoiceVoxStoreOptions = commit("IS_SETTING_DIALOG_OPEN", { isSettingDialogOpen }); }, + async IS_UPDATE_CHECK_DIALOG_OPEN( + { state, commit }, + { isUpdateCheckDialogOpen }: { isUpdateCheckDialogOpen: boolean } + ) { + const result: number = await window.electron.showInfoDialog({ + title: "自動アップデートチェック", + message: "自動アップデートチェックを行います。\nよろしいですか?", + buttons: ["はい", "いいえ"], + }); + if (result == 1) { + return; + } + window.electron.updateCheck(); + }, IS_HOTKEY_SETTING_DIALOG_OPEN( { state, commit }, { isHotkeySettingDialogOpen } diff --git a/src/type/ipc.d.ts b/src/type/ipc.d.ts index 82aac5e568..34a16828ee 100644 --- a/src/type/ipc.d.ts +++ b/src/type/ipc.d.ts @@ -97,6 +97,16 @@ type IpcIHData = { return: boolean; }; + ENABLE_AUTO_UPDATE_CHECK: { + args: [obj: { newValue?: boolean }]; + return: boolean; + }; + + UPDATE_CHECK: { + args: []; + return: void; + }; + IS_AVAILABLE_GPU_MODE: { args: []; return: boolean; diff --git a/src/type/preload.d.ts b/src/type/preload.d.ts index dbd7615af7..447ca1a438 100644 --- a/src/type/preload.d.ts +++ b/src/type/preload.d.ts @@ -37,6 +37,8 @@ export interface Sandbox { openTextEditContextMenu(): Promise; useGpu(newValue?: boolean): Promise; inheritAudioInfo(newValue?: boolean): Promise; + enableAutoUpdateCheck(newValue?: boolean): Promise; + updateCheck(): void; isAvailableGPUMode(): Promise; onReceivedIPCMsg( channel: T, From 41fc7dd07fd55d1232a7b5b4e53e2c7609dc176c Mon Sep 17 00:00:00 2001 From: raa0121 Date: Thu, 16 Dec 2021 21:39:01 +0900 Subject: [PATCH 4/9] =?UTF-8?q?lint=E5=AF=BE=E5=BF=9C=E3=81=A8UI=E3=83=AD?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=82=92=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/background.ts | 5 ++--- src/store/ui.ts | 26 ++++++++++++++++++-------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/background.ts b/src/background.ts index b0f192324e..5d7eb79880 100644 --- a/src/background.ts +++ b/src/background.ts @@ -856,9 +856,8 @@ autoUpdater.on("update-available", () => { type: "info", buttons: ["はい", "いいえ"], message: "アップデート", - detail: - "新しいバージョンをがありました。更新をダウンロードしますか?", - } + detail: "新しいバージョンをがありました。更新をダウンロードしますか?", + }; // ダイアログを表示しすぐに再起動するか確認 dialog.showMessageBox(win, dialogOpts).then((returnValue) => { if (returnValue.response === 0) { diff --git a/src/store/ui.ts b/src/store/ui.ts index 7f47a337f1..8d6613de5b 100644 --- a/src/store/ui.ts +++ b/src/store/ui.ts @@ -173,15 +173,25 @@ export const uiStore: VoiceVoxStoreOptions = { state, commit }, { isUpdateCheckDialogOpen }: { isUpdateCheckDialogOpen: boolean } ) { - const result: number = await window.electron.showInfoDialog({ - title: "自動アップデートチェック", - message: "自動アップデートチェックを行います。\nよろしいですか?", - buttons: ["はい", "いいえ"], - }); - if (result == 1) { - return; + if (state.isUpdateCheckDialogOpen === isUpdateCheckDialogOpen) return; + + if (isUpdateCheckDialogOpen) { + commit("LOCK_UI"); + commit("LOCK_MENUBAR"); + + const result: number = await window.electron.showInfoDialog({ + title: "自動アップデートチェック", + message: "自動アップデートチェックを行います。\nよろしいですか?", + buttons: ["はい", "いいえ"], + }); + if (result == 1) { + return; + } + window.electron.updateCheck(); + } else { + commit("UNLOCK_UI"); + commit("UNLOCK_MENUBAR"); } - window.electron.updateCheck(); }, IS_HOTKEY_SETTING_DIALOG_OPEN( { state, commit }, From f95bec79f07b81ad1b94f11f9823d20e911c24e2 Mon Sep 17 00:00:00 2001 From: raa0121 Date: Thu, 16 Dec 2021 22:34:11 +0900 Subject: [PATCH 5/9] =?UTF-8?q?unittest=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/store/Vuex.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/store/Vuex.spec.ts b/tests/unit/store/Vuex.spec.ts index 407f035e8c..981fdb5b35 100644 --- a/tests/unit/store/Vuex.spec.ts +++ b/tests/unit/store/Vuex.spec.ts @@ -30,6 +30,7 @@ describe("store/vuex.js test", () => { inheritAudioInfo: true, isHelpDialogOpen: false, isSettingDialogOpen: false, + isUpdateCheckDialogOpen: false, isHotkeySettingDialogOpen: false, isDefaultStyleSelectDialogOpen: false, isMaximized: false, @@ -107,6 +108,7 @@ describe("store/vuex.js test", () => { assert.equal(store.state.inheritAudioInfo, true); assert.equal(store.state.isHelpDialogOpen, false); assert.equal(store.state.isSettingDialogOpen, false); + assert.equal(store.state.isUpdateCheckDialogOpen, false); assert.equal(store.state.isHotkeySettingDialogOpen, false); assert.equal(store.state.isDefaultStyleSelectDialogOpen, false); assert.equal(store.state.isMaximized, false); From 60b5879cafef8296192fb369612ce948dfd22551 Mon Sep 17 00:00:00 2001 From: raa0121 Date: Sun, 19 Dec 2021 19:40:48 +0900 Subject: [PATCH 6/9] =?UTF-8?q?savingSetting=20=E3=82=92=E6=AD=A3=E3=81=97?= =?UTF-8?q?=E3=81=8F=E4=BD=BF=E3=81=86=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/background.ts | 4 ++-- src/store/setting.ts | 1 + src/type/preload.d.ts | 1 + tests/unit/store/Vuex.spec.ts | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/background.ts b/src/background.ts index 5d7eb79880..418b701539 100644 --- a/src/background.ts +++ b/src/background.ts @@ -815,8 +815,8 @@ app.on("ready", async () => { } createWindow().then(() => runEngine()); - const enableAutoUpdateCheck = store.get("enableAutoUpdateCheck", false); - if (enableAutoUpdateCheck) { + const savingSetting = store.get("savingSetting"); + if (savingSetting.enableAutoUpdateCheck) { autoUpdater.checkForUpdatesAndNotify(); } }); diff --git a/src/store/setting.ts b/src/store/setting.ts index 12ab68e89d..74620e3b74 100644 --- a/src/store/setting.ts +++ b/src/store/setting.ts @@ -30,6 +30,7 @@ export const settingStoreState: SettingStoreState = { outputStereo: false, outputSamplingRate: 24000, audioOutputDevice: "default", + enableAutoUpdateCheck: false, }, hotkeySettings: [], engineHost: process.env.VUE_APP_ENGINE_URL as unknown as string, diff --git a/src/type/preload.d.ts b/src/type/preload.d.ts index 447ca1a438..4ae4a52982 100644 --- a/src/type/preload.d.ts +++ b/src/type/preload.d.ts @@ -110,6 +110,7 @@ export type SavingSetting = { outputStereo: boolean; outputSamplingRate: number; audioOutputDevice: string; + enableAutoUpdateCheck: boolean; }; export type DefaultStyleId = { diff --git a/tests/unit/store/Vuex.spec.ts b/tests/unit/store/Vuex.spec.ts index 981fdb5b35..ee2cab4b2b 100644 --- a/tests/unit/store/Vuex.spec.ts +++ b/tests/unit/store/Vuex.spec.ts @@ -45,6 +45,7 @@ describe("store/vuex.js test", () => { outputStereo: false, outputSamplingRate: 24000, audioOutputDevice: "default", + enableAutoUpdateCheck: false, }, themeSetting: { currentTheme: "Default", From 737a9e33df528ba2d9fc114ebbb17f81cf3da525 Mon Sep 17 00:00:00 2001 From: raa0121 Date: Tue, 8 Feb 2022 14:05:39 +0900 Subject: [PATCH 7/9] =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=82=92=20savingSetting?= =?UTF-8?q?s=20=E3=81=8B=E3=82=89=E6=8A=9C=E3=81=8F=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=20enableAutoUpdateCheck=20=E3=81=8B=E3=82=89=20isAuto?= =?UTF-8?q?UpdateCheck=20=E3=81=AB=20=E3=82=A2=E3=83=83=E3=83=97=E3=83=87?= =?UTF-8?q?=E3=83=BC=E3=83=88=E7=A2=BA=E8=AA=8D=E5=BE=8C=E3=80=81=E3=83=80?= =?UTF-8?q?=E3=82=A6=E3=83=B3=E3=83=AD=E3=83=BC=E3=83=89=E3=81=A7=E3=81=AF?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E3=80=81=E5=85=AC=E5=BC=8F=E3=82=B5=E3=82=A4?= =?UTF-8?q?=E3=83=88=E3=81=AB=E9=81=B7=E7=A7=BB=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/background.ts | 49 +++++++++++++------------------- src/components/SettingDialog.vue | 17 +++++++---- src/electron/preload.ts | 4 +-- src/store/setting.ts | 1 - src/store/type.ts | 6 ++++ src/store/ui.ts | 26 +++++++++++++---- src/type/ipc.d.ts | 2 +- src/type/preload.d.ts | 3 +- tests/unit/store/Vuex.spec.ts | 3 +- 9 files changed, 64 insertions(+), 47 deletions(-) diff --git a/src/background.ts b/src/background.ts index 418b701539..265138d040 100644 --- a/src/background.ts +++ b/src/background.ts @@ -150,6 +150,7 @@ const store = new Store<{ hotkeySettings: HotkeySetting[]; defaultStyleIds: DefaultStyleId[]; currentTheme: string; + isAutoUpdateCheck: boolean; }>({ schema: { useGpu: { @@ -176,7 +177,6 @@ const store = new Store<{ outputStereo: { type: "boolean", default: false }, outputSamplingRate: { type: "number", default: 24000 }, audioOutputDevice: { type: "string", default: "default" }, - enableAutoUpdateCheck: { type: "boolean", default: false }, }, default: { fileEncoding: "UTF-8", @@ -188,7 +188,6 @@ const store = new Store<{ outputStereo: false, outputSamplingRate: 24000, audioOutputDevice: "default", - enableAutoUpdateCheck: false, }, }, // To future developers: if you are to modify the store schema with array type, @@ -221,6 +220,10 @@ const store = new Store<{ type: "string", default: "Default", }, + isAutoUpdateCheck: { + type: "boolean", + default: false, + }, }, migrations: { ">=0.7.3": (store) => { @@ -571,16 +574,20 @@ ipcMainHandle("INHERIT_AUDIOINFO", (_, { newValue }) => { return store.get("inheritAudioInfo", false); }); -ipcMainHandle("ENABLE_AUTO_UPDATE_CHECK", (_, { newValue }) => { +ipcMainHandle("IS_AUTO_UPDATE_CHECK", (_, { newValue }) => { if (newValue !== undefined) { - store.set("enableAutoUpdateCheck", newValue); + store.set("isAutoUpdateCheck", newValue); } - return store.get("enableAutoUpdateCheck", false); + return store.get("isAutoUpdateCheck", false); }); -ipcMainHandle("UPDATE_CHECK", () => { - autoUpdater.checkForUpdatesAndNotify(); +ipcMainHandle("UPDATE_CHECK", async () => { + try { + await autoUpdater.checkForUpdatesAndNotify(); + } catch (err: unknown) { + return; + } }); ipcMainHandle("IS_AVAILABLE_GPU_MODE", () => { @@ -815,9 +822,9 @@ app.on("ready", async () => { } createWindow().then(() => runEngine()); - const savingSetting = store.get("savingSetting"); - if (savingSetting.enableAutoUpdateCheck) { - autoUpdater.checkForUpdatesAndNotify(); + const isAutoUpdateCheck = store.get("isAutoUpdateCheck"); + if (isAutoUpdateCheck) { + await autoUpdater.checkForUpdatesAndNotify(); } }); @@ -856,12 +863,13 @@ autoUpdater.on("update-available", () => { type: "info", buttons: ["はい", "いいえ"], message: "アップデート", - detail: "新しいバージョンをがありました。更新をダウンロードしますか?", + detail: "新しいバージョンをがありました。公式サイトを開きますか?", }; // ダイアログを表示しすぐに再起動するか確認 dialog.showMessageBox(win, dialogOpts).then((returnValue) => { if (returnValue.response === 0) { - autoUpdater.downloadUpdate(); + shell.openExternal("https://voicevox.hiroshiba.jp/"); + log.info(process.pid, "Open Official Site."); } }); }); @@ -869,23 +877,6 @@ autoUpdater.on("update-available", () => { autoUpdater.on("update-not-available", () => { log.info(process.pid, "Update not available."); }); -// アップデートのダウンロードが完了 -autoUpdater.on("update-downloaded", () => { - const dialogOpts = { - type: "info", - buttons: ["更新して再起動", "あとで"], - message: "アップデート", - detail: - "新しいバージョンをダウンロードしました。再起動して更新を適用しますか?", - }; - - // ダイアログを表示しすぐに再起動するか確認 - dialog.showMessageBox(win, dialogOpts).then((returnValue) => { - if (returnValue.response === 0) { - autoUpdater.quitAndInstall(); - } - }); -}); // エラーが発生 autoUpdater.on("error", (err) => { log.error(process.pid, err); diff --git a/src/components/SettingDialog.vue b/src/components/SettingDialog.vue index d45d3f61da..cd5eba46be 100644 --- a/src/components/SettingDialog.vue +++ b/src/components/SettingDialog.vue @@ -309,12 +309,8 @@
自動アップデートチェック
store.state.inheritAudioInfo); + const isAutoUpdateCheck = computed(() => store.state.isAutoUpdateCheck); + const currentThemeNameComputed = computed({ get: () => store.state.themeSetting.currentTheme, set: (currentTheme: string) => { @@ -520,6 +518,11 @@ export default defineComponent({ store.dispatch("SET_INHERIT_AUDIOINFO", { inheritAudioInfo }); }; + const changeIsAutoUpdateCheck = async (isAutoUpdateCheck: boolean) => { + if (store.state.isAutoUpdateCheck === isAutoUpdateCheck) return; + store.dispatch("SET_IS_AUTO_UPDATE_CHECK", { isAutoUpdateCheck }); + }; + const restartEngineProcess = () => { store.dispatch("RESTART_ENGINE"); }; @@ -576,6 +579,8 @@ export default defineComponent({ currentAudioOutputDeviceComputed, availableAudioOutputDevices, changeinheritAudioInfo, + isAutoUpdateCheck, + changeIsAutoUpdateCheck, restartEngineProcess, savingSetting, handleSavingSettingChange, diff --git a/src/electron/preload.ts b/src/electron/preload.ts index 72183fb07a..0b7e8451db 100644 --- a/src/electron/preload.ts +++ b/src/electron/preload.ts @@ -136,8 +136,8 @@ const api: Sandbox = { return ipcRendererInvoke("INHERIT_AUDIOINFO", { newValue }); }, - enableAutoUpdateCheck: (newValue) => { - return ipcRendererInvoke("ENABLE_AUTO_UPDATE_CHECK", { newValue }); + isAutoUpdateCheck: (newValue) => { + return ipcRendererInvoke("IS_AUTO_UPDATE_CHECK", { newValue }); }, updateCheck: () => { diff --git a/src/store/setting.ts b/src/store/setting.ts index 74620e3b74..12ab68e89d 100644 --- a/src/store/setting.ts +++ b/src/store/setting.ts @@ -30,7 +30,6 @@ export const settingStoreState: SettingStoreState = { outputStereo: false, outputSamplingRate: 24000, audioOutputDevice: "default", - enableAutoUpdateCheck: false, }, hotkeySettings: [], engineHost: process.env.VUE_APP_ENGINE_URL as unknown as string, diff --git a/src/store/type.ts b/src/store/type.ts index 1d15c09155..3bf97af009 100644 --- a/src/store/type.ts +++ b/src/store/type.ts @@ -666,6 +666,7 @@ export type UiStoreState = { isHotkeySettingDialogOpen: boolean; isMaximized: boolean; isPinned: boolean; + isAutoUpdateCheck: boolean; }; type UiStoreTypes = { @@ -752,6 +753,11 @@ type UiStoreTypes = { action(payload: { inheritAudioInfo: boolean }): void; }; + SET_IS_AUTO_UPDATE_CHECK: { + mutation: { isAutoUpdateCheck: boolean }; + action(payload: { isAutoUpdateCheck: boolean }): void; + }; + DETECT_UNMAXIMIZED: { mutation: undefined; action(): void; diff --git a/src/store/ui.ts b/src/store/ui.ts index 8d6613de5b..25b2b5a640 100644 --- a/src/store/ui.ts +++ b/src/store/ui.ts @@ -38,6 +38,7 @@ export const uiStoreState: UiStoreState = { isDefaultStyleSelectDialogOpen: false, isMaximized: false, isPinned: false, + isAutoUpdateCheck: false, }; export const uiStore: VoiceVoxStoreOptions = @@ -105,6 +106,12 @@ export const uiStore: VoiceVoxStoreOptions = ) { state.inheritAudioInfo = inheritAudioInfo; }, + SET_IS_AUTO_UPDATE_CHECK( + state, + { isAutoUpdateCheck }: { isAutoUpdateCheck: boolean } + ) { + state.isAutoUpdateCheck = isAutoUpdateCheck; + }, DETECT_UNMAXIMIZED(state) { state.isMaximized = false; }, @@ -180,17 +187,16 @@ export const uiStore: VoiceVoxStoreOptions = commit("LOCK_MENUBAR"); const result: number = await window.electron.showInfoDialog({ - title: "自動アップデートチェック", - message: "自動アップデートチェックを行います。\nよろしいですか?", + title: "アップデートチェック", + message: "アップデートチェックを行います。\nよろしいですか?", buttons: ["はい", "いいえ"], }); + commit("UNLOCK_UI"); + commit("UNLOCK_MENUBAR"); if (result == 1) { return; } window.electron.updateCheck(); - } else { - commit("UNLOCK_UI"); - commit("UNLOCK_MENUBAR"); } }, IS_HOTKEY_SETTING_DIALOG_OPEN( @@ -260,6 +266,16 @@ export const uiStore: VoiceVoxStoreOptions = ), }); }, + async SET_IS_AUTO_UPDATE_CHECK( + { commit }, + { isAutoUpdateCheck }: { isAutoUpdateCheck: boolean } + ) { + commit("SET_IS_AUTO_UPDATE_CHECK", { + isAutoUpdateCheck: await window.electron.isAutoUpdateCheck( + isAutoUpdateCheck + ), + }); + }, async DETECT_UNMAXIMIZED({ commit }) { commit("DETECT_UNMAXIMIZED"); }, diff --git a/src/type/ipc.d.ts b/src/type/ipc.d.ts index 34a16828ee..42a6417395 100644 --- a/src/type/ipc.d.ts +++ b/src/type/ipc.d.ts @@ -97,7 +97,7 @@ type IpcIHData = { return: boolean; }; - ENABLE_AUTO_UPDATE_CHECK: { + IS_AUTO_UPDATE_CHECK: { args: [obj: { newValue?: boolean }]; return: boolean; }; diff --git a/src/type/preload.d.ts b/src/type/preload.d.ts index 4ae4a52982..989affb152 100644 --- a/src/type/preload.d.ts +++ b/src/type/preload.d.ts @@ -37,7 +37,7 @@ export interface Sandbox { openTextEditContextMenu(): Promise; useGpu(newValue?: boolean): Promise; inheritAudioInfo(newValue?: boolean): Promise; - enableAutoUpdateCheck(newValue?: boolean): Promise; + isAutoUpdateCheck(newValue?: boolean): Promise; updateCheck(): void; isAvailableGPUMode(): Promise; onReceivedIPCMsg( @@ -110,7 +110,6 @@ export type SavingSetting = { outputStereo: boolean; outputSamplingRate: number; audioOutputDevice: string; - enableAutoUpdateCheck: boolean; }; export type DefaultStyleId = { diff --git a/tests/unit/store/Vuex.spec.ts b/tests/unit/store/Vuex.spec.ts index ee2cab4b2b..a5be9a8d83 100644 --- a/tests/unit/store/Vuex.spec.ts +++ b/tests/unit/store/Vuex.spec.ts @@ -35,6 +35,7 @@ describe("store/vuex.js test", () => { isDefaultStyleSelectDialogOpen: false, isMaximized: false, savedLastCommandUnixMillisec: null, + isAutoUpdateCheck: false, savingSetting: { fileEncoding: "UTF-8", fixedExportEnabled: false, @@ -45,7 +46,6 @@ describe("store/vuex.js test", () => { outputStereo: false, outputSamplingRate: 24000, audioOutputDevice: "default", - enableAutoUpdateCheck: false, }, themeSetting: { currentTheme: "Default", @@ -107,6 +107,7 @@ describe("store/vuex.js test", () => { assert.isEmpty(store.state.redoCommands); assert.equal(store.state.useGpu, false); assert.equal(store.state.inheritAudioInfo, true); + assert.equal(store.state.isAutoUpdateCheck, false); assert.equal(store.state.isHelpDialogOpen, false); assert.equal(store.state.isSettingDialogOpen, false); assert.equal(store.state.isUpdateCheckDialogOpen, false); From f5d3746988900de475a8e59eba17c6b5a51955e4 Mon Sep 17 00:00:00 2001 From: raa0121 Date: Tue, 8 Feb 2022 14:34:42 +0900 Subject: [PATCH 8/9] =?UTF-8?q?prettier=20=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/background.ts | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/background.ts b/src/background.ts index 56e72853bc..e4015c1813 100644 --- a/src/background.ts +++ b/src/background.ts @@ -212,14 +212,14 @@ const store = new Store<{ enum: ["UTF-8", "Shift_JIS"], default: "UTF-8", }, - fixedExportEnabled: {type: "boolean", default: false}, - avoidOverwrite: {type: "boolean", default: false}, - fixedExportDir: {type: "string", default: ""}, - exportLab: {type: "boolean", default: false}, - exportText: {type: "boolean", default: false}, - outputStereo: {type: "boolean", default: false}, - outputSamplingRate: {type: "number", default: 24000}, - audioOutputDevice: {type: "string", default: "default"}, + fixedExportEnabled: { type: "boolean", default: false }, + avoidOverwrite: { type: "boolean", default: false }, + fixedExportDir: { type: "string", default: "" }, + exportLab: { type: "boolean", default: false }, + exportText: { type: "boolean", default: false }, + outputStereo: { type: "boolean", default: false }, + outputSamplingRate: { type: "number", default: 24000 }, + audioOutputDevice: { type: "string", default: "default" }, }, default: { fileEncoding: "UTF-8", @@ -242,8 +242,8 @@ const store = new Store<{ items: { type: "object", properties: { - action: {type: "string"}, - combination: {type: "string"}, + action: { type: "string" }, + combination: { type: "string" }, }, }, default: defaultHotkeySettings, @@ -260,8 +260,8 @@ const store = new Store<{ items: { type: "object", properties: { - speakerUuid: {type: "string"}, - defaultStyleId: {type: "number"}, + speakerUuid: { type: "string" }, + defaultStyleId: { type: "number" }, }, }, default: [], @@ -276,13 +276,13 @@ const store = new Store<{ "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}": { type: "object", properties: { - name: {type: "string"}, - speedScale: {type: "number"}, - pitchScale: {type: "number"}, - intonationScale: {type: "number"}, - volumeScale: {type: "number"}, - prePhonemeLength: {type: "number"}, - postPhonemeLength: {type: "number"}, + name: { type: "string" }, + speedScale: { type: "number" }, + pitchScale: { type: "number" }, + intonationScale: { type: "number" }, + volumeScale: { type: "number" }, + prePhonemeLength: { type: "number" }, + postPhonemeLength: { type: "number" }, }, }, }, @@ -293,11 +293,11 @@ const store = new Store<{ items: { type: "string", pattern: - "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", + "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", }, }, }, - default: {items: {}, keys: []}, + default: { items: {}, keys: [] }, }, currentTheme: { type: "string", @@ -310,7 +310,7 @@ const store = new Store<{ experimentalSetting: { type: "object", properties: { - enablePreset: {type: "boolean", default: false}, + enablePreset: { type: "boolean", default: false }, enableInterrogativeUpspeak: { type: "boolean", default: false, From 71ad3cc63913d13175fa0b641859fe68be8f18a5 Mon Sep 17 00:00:00 2001 From: raa0121 Date: Thu, 9 Jun 2022 21:38:13 +0900 Subject: [PATCH 9/9] =?UTF-8?q?showQuestionDialog=20=E3=82=92=E4=BD=BF?= =?UTF-8?q?=E3=81=86=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/ui.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/store/ui.ts b/src/store/ui.ts index b8fcc3f932..47555a13dd 100644 --- a/src/store/ui.ts +++ b/src/store/ui.ts @@ -249,10 +249,12 @@ export const uiStore: VoiceVoxStoreOptions = commit("LOCK_UI"); commit("LOCK_MENUBAR"); - const result: number = await window.electron.showInfoDialog({ + const result: number = await window.electron.showQuestionDialog({ + type: "info", title: "アップデートチェック", message: "アップデートチェックを行います。\nよろしいですか?", buttons: ["はい", "いいえ"], + cancelId: 1, }); commit("UNLOCK_UI"); commit("UNLOCK_MENUBAR");