mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 20:28:19 +02:00
EditorMAcroScript: Add some more try except dealing with self-test. Save reason of failure
git-svn-id: trunk@43398 -
This commit is contained in:
parent
6767c20339
commit
6770c13d81
@ -78,6 +78,7 @@ type
|
||||
TEMSConfig = class(TAbstractIDEEnvironmentOptions)
|
||||
private
|
||||
FSelfTestActive: Boolean;
|
||||
FSelfTestError: String;
|
||||
FSelfTestFailed: Integer; // stores EMSVersion that failed
|
||||
protected
|
||||
function GetXmlConf: TRttiXMLConfig;
|
||||
@ -92,6 +93,7 @@ type
|
||||
published
|
||||
property SelfTestActive: Boolean read FSelfTestActive write FSelfTestActive;
|
||||
property SelfTestFailed: Integer read FSelfTestFailed write FSelfTestFailed;
|
||||
property SelfTestError: String read FSelfTestError write FSelfTestError;
|
||||
end;
|
||||
|
||||
function GetEMSConf: TEMSConfig;
|
||||
|
@ -25,10 +25,26 @@ begin
|
||||
if not EMSSupported then exit;
|
||||
|
||||
conf := GetEMSConf;
|
||||
conf.Load;
|
||||
try
|
||||
conf.Load;
|
||||
except
|
||||
try
|
||||
conf.SelfTestFailed := EMSVersion;
|
||||
conf.SelfTestActive := False;
|
||||
conf.SelfTestError := 'load error';
|
||||
conf.Save;
|
||||
except
|
||||
end;
|
||||
MessageDlg(EmsSelfTestErrCaption,
|
||||
format(EmsSelfTestFailedLastTime, [LineEnding]),
|
||||
mtError, [mbOK], 0);
|
||||
exit;
|
||||
end;
|
||||
|
||||
if conf.SelfTestActive then begin
|
||||
conf.SelfTestFailed := EMSVersion;
|
||||
conf.SelfTestActive := False;
|
||||
conf.SelfTestError := 'failed last time';
|
||||
conf.Save;
|
||||
MessageDlg(EmsSelfTestErrCaption,
|
||||
format(EmsSelfTestFailedLastTime, [LineEnding]),
|
||||
@ -50,6 +66,7 @@ begin
|
||||
if not ok then begin
|
||||
conf.SelfTestFailed := EMSVersion;
|
||||
conf.SelfTestActive := False;
|
||||
conf.SelfTestError := SelfTestErrorMsg;
|
||||
conf.Save;
|
||||
MessageDlg(EmsSelfTestErrCaption,
|
||||
format(EmsSelfTestFailed, [LineEnding, SelfTestErrorMsg]),
|
||||
@ -58,6 +75,7 @@ begin
|
||||
end;
|
||||
|
||||
conf.SelfTestActive := False;
|
||||
conf.SelfTestError := '';
|
||||
conf.Save;
|
||||
|
||||
EditorMacroPlayerClass := TEMSEditorMacro;
|
||||
|
Loading…
Reference in New Issue
Block a user