From cbb9bd7d0979d853d654102fb9e6fa0fb23917b6 Mon Sep 17 00:00:00 2001 From: Maxim Ganetsky Date: Tue, 3 Aug 2021 01:20:03 +0300 Subject: [PATCH] IDEIntf: improved error messages when it is not possible to get the database fields list, issue 39304 --- components/ideintf/fieldseditor.pas | 2 +- components/ideintf/newfield.pas | 2 +- components/ideintf/objinspstrconsts.pas | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/components/ideintf/fieldseditor.pas b/components/ideintf/fieldseditor.pas index bc1766767c..aa48462246 100644 --- a/components/ideintf/fieldseditor.pas +++ b/components/ideintf/fieldseditor.pas @@ -189,7 +189,7 @@ begin FieldsList := TFieldsListFrm.Create(Self, LinkDataset, Designer); except on E:Exception do begin - ShowMessage(fesNoFields+^M+fesCheckDSet+^M^M+E.Message); + MessageDlg(fesNoFields+^M+fesCheckDSet+^M^M+Format(fesErrorMessage, [E.Message]), mtError, [mbOK], 0); exit; end; end; diff --git a/components/ideintf/newfield.pas b/components/ideintf/newfield.pas index 731ace75e4..08c6180779 100644 --- a/components/ideintf/newfield.pas +++ b/components/ideintf/newfield.pas @@ -431,7 +431,7 @@ begin end; except on E:Exception do begin - ShowMessage(fesNoFields+^M+fesCheckDSet+^M^M+E.Message); + MessageDlg(fesNoFields+^M+fesCheckDSet+^M^M+Format(fesErrorMessage, [E.Message]), mtError, [mbOK], 0); end; end; end; diff --git a/components/ideintf/objinspstrconsts.pas b/components/ideintf/objinspstrconsts.pas index f38504eaf9..e959df6ed8 100644 --- a/components/ideintf/objinspstrconsts.pas +++ b/components/ideintf/objinspstrconsts.pas @@ -401,10 +401,11 @@ resourcestring fesFeTitle = 'Edit Fields ...'; oisAddFields = '&Add fields'; oisAddFieldsFromFieldDefs = 'Add fields from FieldDefs'; - fesNoFields = 'It was not possible to get the dataset field''s list'; - fesCheckDset = 'Check dataset settings'; + fesNoFields = 'It was not possible to get the dataset fields list.'; + fesCheckDset = 'Check dataset settings.'; + fesErrorMessage = 'Error message:' + LineEnding + '%s'; fesFlTitle = 'FieldDefs'; - fesNoFieldsNote = 'Field''s list is not available, can''t check for duplicates'; + fesNoFieldsNote = 'Fields list is not available, can''t check for duplicates.'; oisIncompatibleIdentifier = 'Incompatible Identifier'; oisIsNotAValidMethodName = '"%s" is not a valid method name.'; oisTheIdentifierIsNotAMethodPressCancelToUndoPressIgn = 'The identifier "%s" is not a method.'