display different dialog titles when saving a new explorer and renaming an explorer

This commit is contained in:
MaysWind
2026-01-07 23:47:14 +08:00
parent 1c596c4a15
commit 6829eddde5
20 changed files with 24 additions and 3 deletions
+1 -1
View File
@@ -456,7 +456,7 @@ function loadExplorer(explorerId: string): void {
function saveExplorer(saveAs?: boolean): void {
if (saveAs || !currentExplorer.value.name) {
explorerRenameDialog.value?.open(currentExplorer.value.name || '').then((newName: string) => {
explorerRenameDialog.value?.open(currentExplorer.value.name || '', tt('Set Explorer Name')).then((newName: string) => {
currentExplorer.value.name = newName;
doSaveExplorer(saveAs);
})
@@ -2,10 +2,11 @@
<v-dialog max-width="500" :persistent="oldExplorerName !== newExplorerName" v-model="showState">
<v-card class="pa-sm-1 pa-md-2">
<template #title>
<h4 class="text-h4 text-wrap">{{ tt('Rename Explorer') }}</h4>
<h4 class="text-h4 text-wrap">{{ dialogTitle || tt('Rename Explorer') }}</h4>
</template>
<v-card-text class="w-100 d-flex justify-center">
<v-text-field persistent-placeholder
:autofocus="true"
:label="tt('Explorer Name')"
:placeholder="tt('Explorer Name')"
v-model="newExplorerName"/>
@@ -35,11 +36,13 @@ let resolveFunc: ((name: string) => void) | null = null;
let rejectFunc: ((reason?: unknown) => void) | null = null;
const showState = ref<boolean>(false);
const dialogTitle = ref<string | undefined>(undefined);
const oldExplorerName = ref<string>('');
const newExplorerName = ref<string>('');
function open(currentExplorerName: string): Promise<string> {
function open(currentExplorerName: string, title?: string): Promise<string> {
showState.value = true;
dialogTitle.value = title;
oldExplorerName.value = currentExplorerName;
newExplorerName.value = currentExplorerName;