From 768bc001cb51143e5fdc2800a436a3ba11c55d4e Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sun, 10 Feb 2019 13:02:33 +0100 Subject: [PATCH] Table editor: Make it impossible to (accidentally) click the save button twice. Closes #527 --- source/table_editor.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/table_editor.pas b/source/table_editor.pas index 79bb9572..4863a16d 100644 --- a/source/table_editor.pas +++ b/source/table_editor.pas @@ -372,8 +372,13 @@ end; procedure TfrmTableEditor.btnSaveClick(Sender: TObject); begin + // Save changes, and make it impossible to (accidentally) click the save button twice + btnSave.Enabled := False; + btnSave.Repaint; if ApplyModifications = mrOK then - Init(DBObject); + Init(DBObject) + else // Re-enable save button when something went wrong + btnSave.Enabled := True; end;