From 3d6eb5b23278f0d7854258317d1f9f93a1260bce Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Tue, 28 Jan 2025 09:53:49 +0900 Subject: [PATCH 1/4] =?UTF-8?q?Fix:=20GPU=E5=A4=89=E6=9B=B4=E3=81=AE?= =?UTF-8?q?=E3=83=80=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0=E3=81=8C=E3=82=AF?= =?UTF-8?q?=E3=83=AA=E3=83=83=E3=82=AF=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=8B?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/_index.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/styles/_index.scss b/src/styles/_index.scss index ae0b795b5e..fae095dbce 100644 --- a/src/styles/_index.scss +++ b/src/styles/_index.scss @@ -92,6 +92,9 @@ img { // ダイアログ .q-dialog, #q-loading { + // ダイアログをQLoading(z-index: 9998)の上に出す + z-index: 10000; + .q-dialog__backdrop, .q-dialog__inner, .q-loading, @@ -278,7 +281,7 @@ img { font-family: "Material Symbols Outlined"; font-weight: normal; font-style: normal; - font-size: 24px; /* Preferred icon size */ + font-size: 24px; /* Preferred icon size */ display: inline-block; line-height: 1; text-transform: none; From 0e37b51cd8afaa5f3f2043b45eedf0828bb079d1 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Wed, 29 Jan 2025 01:15:44 +0900 Subject: [PATCH 2/4] =?UTF-8?q?refactor:=20GPU=E3=83=A2=E3=83=BC=E3=83=89?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E6=99=82=E3=81=AE=E3=83=AD=E3=83=BC=E3=83=87?= =?UTF-8?q?=E3=82=A3=E3=83=B3=E3=82=B0=E7=94=BB=E9=9D=A2=E3=81=AE=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=83=AD=E3=82=B8=E3=83=83=E3=82=AF=E3=82=92=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dialog/SettingDialog/SettingDialog.vue | 6 --- src/store/setting.ts | 41 ++++++++++++------- src/store/type.ts | 8 ---- src/store/ui.ts | 12 ------ src/styles/_index.scss | 3 -- 5 files changed, 27 insertions(+), 43 deletions(-) diff --git a/src/components/Dialog/SettingDialog/SettingDialog.vue b/src/components/Dialog/SettingDialog/SettingDialog.vue index 004be181eb..65113506c5 100644 --- a/src/components/Dialog/SettingDialog/SettingDialog.vue +++ b/src/components/Dialog/SettingDialog/SettingDialog.vue @@ -681,16 +681,10 @@ const acceptRetrieveTelemetryComputed = computed({ }); const changeUseGpu = async (useGpu: boolean) => { - void store.actions.SHOW_LOADING_SCREEN({ - message: "起動モードを変更中です", - }); - await store.actions.CHANGE_USE_GPU({ useGpu, engineId: selectedEngineId.value, }); - - void store.actions.HIDE_ALL_LOADING_SCREEN(); }; const changeinheritAudioInfo = async (inheritAudioInfo: boolean) => { diff --git a/src/store/setting.ts b/src/store/setting.ts index 1cd2aa1dd9..729cf4d05e 100644 --- a/src/store/setting.ts +++ b/src/store/setting.ts @@ -3,7 +3,9 @@ import { createUILockAction } from "./ui"; import { createPartialStore } from "./vuex"; import { themes } from "@/domain/theme"; import { + hideAllLoadingScreen, showAlertDialog, + showLoadingScreen, showQuestionDialog, } from "@/components/Dialog/Dialog"; import { @@ -357,24 +359,33 @@ export const settingStore = createPartialStore({ */ action: createUILockAction( async ({ state, actions }, { useGpu, engineId }) => { - const isAvailableGPUMode = await window.backend.isAvailableGPUMode(); - // 対応するGPUがない場合に変更を続行するか問う - if (useGpu && !isAvailableGPUMode) { - const result = await showQuestionDialog({ - type: "warning", - title: "対応するGPUデバイスが見つかりません", - message: - "GPUモードの利用には対応するGPUデバイスが必要です。\n" + - "このままGPUモードに変更するとエンジンエラーが発生する可能性があります。本当に変更しますか?", - buttons: ["変更しない", "変更する"], - cancel: 0, - }); - if (result == 0) { - return; + if (useGpu) { + showLoadingScreen({ message: "GPUデバイスを確認中です" }); + + const isAvailableGPUMode = await window.backend.isAvailableGPUMode(); + if (!isAvailableGPUMode) { + const result = await showQuestionDialog({ + type: "warning", + title: "対応するGPUデバイスが見つかりません", + message: + "GPUモードの利用には対応するGPUデバイスが必要です。\n" + + "このままGPUモードに変更するとエンジンエラーが発生する可能性があります。本当に変更しますか?", + buttons: ["変更しない", "変更する"], + cancel: 0, + }); + if (result == 0) { + return; + } } + + hideAllLoadingScreen(); } + showLoadingScreen({ + message: "起動モードを変更中です", + }); + void actions.SET_ENGINE_SETTING({ engineSetting: { ...state.engineSettings[engineId], useGpu }, engineId, @@ -383,6 +394,8 @@ export const settingStore = createPartialStore({ engineIds: [engineId], }); + hideAllLoadingScreen(); + // GPUモードに変更できなかった場合はCPUモードに戻す // FIXME: useGpu設定を保存してからエンジン起動を試すのではなく、逆にしたい if (!result.success && useGpu) { diff --git a/src/store/type.ts b/src/store/type.ts index a57e243881..9ec54729c4 100644 --- a/src/store/type.ts +++ b/src/store/type.ts @@ -2087,14 +2087,6 @@ export type UiStoreTypes = { action(payload: NotifyAndNotShowAgainButtonOption): void; }; - SHOW_LOADING_SCREEN: { - action(payload: LoadingScreenOption): void; - }; - - HIDE_ALL_LOADING_SCREEN: { - action(): void; - }; - ON_VUEX_READY: { mutation: void; action(): void; diff --git a/src/store/ui.ts b/src/store/ui.ts index 14eab4b367..36070ebf19 100644 --- a/src/store/ui.ts +++ b/src/store/ui.ts @@ -229,18 +229,6 @@ export const uiStore = createPartialStore({ }, }, - SHOW_LOADING_SCREEN: { - action(_, payload: LoadingScreenOption) { - showLoadingScreen(payload); - }, - }, - - HIDE_ALL_LOADING_SCREEN: { - action() { - hideAllLoadingScreen(); - }, - }, - HYDRATE_UI_STORE: { async action({ mutations }) { mutations.SET_INHERIT_AUDIOINFO({ diff --git a/src/styles/_index.scss b/src/styles/_index.scss index fae095dbce..64ba2f891c 100644 --- a/src/styles/_index.scss +++ b/src/styles/_index.scss @@ -92,9 +92,6 @@ img { // ダイアログ .q-dialog, #q-loading { - // ダイアログをQLoading(z-index: 9998)の上に出す - z-index: 10000; - .q-dialog__backdrop, .q-dialog__inner, .q-loading, From 7a6618f0cfc83e5318c04f9c3677bb4d959cc7ff Mon Sep 17 00:00:00 2001 From: Hiroshiba Kazuyuki Date: Fri, 31 Jan 2025 19:15:01 +0900 Subject: [PATCH 3/4] =?UTF-8?q?refactor:=20LoadingScreenOption=E3=81=AE?= =?UTF-8?q?=E5=9E=8B=E5=AE=9A=E7=BE=A9=E3=82=92Dialog.ts=E3=81=AB=E7=A7=BB?= =?UTF-8?q?=E5=8B=95=E3=81=97=E3=80=81=E4=B8=8D=E8=A6=81=E3=81=AA=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=9D=E3=83=BC=E3=83=88=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dialog/Dialog.ts | 4 ++-- src/store/type.ts | 1 - src/store/ui.ts | 3 --- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/Dialog/Dialog.ts b/src/components/Dialog/Dialog.ts index 38edc9b31f..c29b0cd5cb 100644 --- a/src/components/Dialog/Dialog.ts +++ b/src/components/Dialog/Dialog.ts @@ -54,8 +54,6 @@ export type NotifyAndNotShowAgainButtonOption = { tipName: keyof ConfirmedTips; }; -export type LoadingScreenOption = { message: string }; - // 汎用ダイアログを表示 /** メッセージを知らせるダイアログ */ @@ -404,6 +402,8 @@ export const showNotifyAndNotShowAgainButton = ( }); }; +type LoadingScreenOption = { message: string }; + export const showLoadingScreen = (options: LoadingScreenOption) => { Loading.show({ spinnerColor: "primary", diff --git a/src/store/type.ts b/src/store/type.ts index 9ec54729c4..ebb5f10314 100644 --- a/src/store/type.ts +++ b/src/store/type.ts @@ -58,7 +58,6 @@ import { IEngineConnectorFactory } from "@/infrastructures/EngineConnector"; import { TextDialogResult, NotifyAndNotShowAgainButtonOption, - LoadingScreenOption, MessageDialogOptions, ConfirmDialogOptions, WarningDialogOptions, diff --git a/src/store/ui.ts b/src/store/ui.ts index 36070ebf19..f75913f5d6 100644 --- a/src/store/ui.ts +++ b/src/store/ui.ts @@ -17,16 +17,13 @@ import { MessageDialogOptions, ConfirmDialogOptions, WarningDialogOptions, - LoadingScreenOption, NotifyAndNotShowAgainButtonOption, connectAndExportTextWithDialog, generateAndConnectAndSaveAudioWithDialog, generateAndSaveOneAudioWithDialog, - hideAllLoadingScreen, multiGenerateAndSaveAudioWithDialog, showAlertDialog, showConfirmDialog, - showLoadingScreen, showNotifyAndNotShowAgainButton, showWarningDialog, } from "@/components/Dialog/Dialog"; From 77a316c0b7c891baf568f7792c328312307c6cec Mon Sep 17 00:00:00 2001 From: Hiroshiba Kazuyuki Date: Sun, 2 Feb 2025 15:49:33 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20GPU=E3=83=87=E3=83=90=E3=82=A4?= =?UTF-8?q?=E3=82=B9=E7=A2=BA=E8=AA=8D=E4=B8=AD=E3=81=AE=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=B3=E3=82=B0=E7=94=BB=E9=9D=A2=E3=82=92?= =?UTF-8?q?=E9=81=A9=E5=88=87=E3=81=AB=E9=9D=9E=E8=A1=A8=E7=A4=BA=E3=81=AB?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/setting.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/store/setting.ts b/src/store/setting.ts index 729cf4d05e..6cd5ad630b 100644 --- a/src/store/setting.ts +++ b/src/store/setting.ts @@ -364,6 +364,9 @@ export const settingStore = createPartialStore({ showLoadingScreen({ message: "GPUデバイスを確認中です" }); const isAvailableGPUMode = await window.backend.isAvailableGPUMode(); + + hideAllLoadingScreen(); + if (!isAvailableGPUMode) { const result = await showQuestionDialog({ type: "warning", @@ -378,8 +381,6 @@ export const settingStore = createPartialStore({ return; } } - - hideAllLoadingScreen(); } showLoadingScreen({