diff --git a/vite/src/pipedal/AppThemed.tsx b/vite/src/pipedal/AppThemed.tsx index 4deab00..f4f483f 100644 --- a/vite/src/pipedal/AppThemed.tsx +++ b/vite/src/pipedal/AppThemed.tsx @@ -1031,6 +1031,7 @@ export { this.setState({ diff --git a/vite/src/pipedal/BankDialog.tsx b/vite/src/pipedal/BankDialog.tsx index cfea2be..4080a42 100644 --- a/vite/src/pipedal/BankDialog.tsx +++ b/vite/src/pipedal/BankDialog.tsx @@ -458,7 +458,7 @@ const BankDialog = withStyles(
void; @@ -95,6 +96,7 @@ const PresetSelector = showEditPresetsDialog: false, presetsMenuAnchorRef: null, renameDialogOpen: false, + renameDialogTitle: "", renameDialogDefaultName: "", renameDialogActionName: "", renameDialogOnOk: undefined, @@ -144,7 +146,7 @@ const PresetSelector = if (item == null) return; let name = item.name; - this.renameDialogOpen(name, "Save As") + this.renameDialogOpen(name, "Save Preset As", "OK") .then((newName) => { return this.model.saveCurrentPresetAs(newName); }) @@ -167,7 +169,7 @@ const PresetSelector = if (item == null) return; let name = item.name; - this.renameDialogOpen(name, "Rename") + this.renameDialogOpen(name, "Rename Preset", "OK") .then((newName) => { if (newName === name) return; return this.model.renamePresetItem(this.model.presets.get().selectedInstanceId, newName); @@ -196,12 +198,13 @@ const PresetSelector = showError(error: string) { this.model.showAlert(error); } - renameDialogOpen(defaultText: string, acceptButtonText: string): Promise { + renameDialogOpen(defaultText: string, title: string,acceptButtonText: string): Promise { let result = new Promise( (resolve, reject) => { this.setState( { renameDialogOpen: true, + renameDialogTitle: title, renameDialogDefaultName: defaultText, renameDialogActionName: acceptButtonText, renameDialogOnOk: (name) => { @@ -365,6 +368,7 @@ const PresetSelector =
this.handleDialogClose()} /> this.handleRenameDialogClose()} diff --git a/vite/src/pipedal/RenameDialog.tsx b/vite/src/pipedal/RenameDialog.tsx index c795c60..e802165 100644 --- a/vite/src/pipedal/RenameDialog.tsx +++ b/vite/src/pipedal/RenameDialog.tsx @@ -20,6 +20,7 @@ import React from 'react'; import Button from '@mui/material/Button'; import DialogEx from './DialogEx'; +import DialogTitle from '@mui/material/DialogTitle'; import DialogActions from '@mui/material/DialogActions'; import DialogContent from '@mui/material/DialogContent'; import { nullCast } from './Utility'; @@ -33,6 +34,9 @@ export interface RenameDialogProps { open: boolean, defaultName: string, acceptActionName: string, + title: string, + allowEmpty?: boolean, + label?: string, onOk: (text: string) => void, onClose: () => void }; @@ -102,7 +106,7 @@ export default class RenameDialog extends ResizeResponsiveComponent): void => { @@ -119,20 +123,23 @@ export default class RenameDialog extends ResizeResponsiveComponent{}} > - + + {props.title ?? "Rename"} + + +