Jedi code format: when formating fails, pop up Messages window improved, Issue #41146. Based on patch by Bruno K.

This commit is contained in:
DomingoGP 2024-09-17 18:51:32 +02:00
parent e5159ea7a2
commit 7a0867281e
2 changed files with 11 additions and 4 deletions

View File

@ -80,6 +80,8 @@ type
procedure DoRegistrySettings(Sender: TObject); procedure DoRegistrySettings(Sender: TObject);
procedure DoFormatSettings(Sender: TObject); procedure DoFormatSettings(Sender: TObject);
procedure DoAbout(Sender: TObject); procedure DoAbout(Sender: TObject);
class procedure ShowIdeMessages;
end; end;
@ -340,7 +342,7 @@ begin
end; end;
finally finally
if fcConverter.ConvertError and (IDEMessagesWindow<>nil) then if fcConverter.ConvertError and (IDEMessagesWindow<>nil) then
IDEMessagesWindow.ShowOnTop; ShowIdeMessages;
fcConverter.Free; fcConverter.Free;
end; end;
end; end;
@ -387,7 +389,7 @@ begin
end; end;
finally finally
if fcConverter.ConvertError and (IDEMessagesWindow<>nil) then if fcConverter.ConvertError and (IDEMessagesWindow<>nil) then
IDEMessagesWindow.ShowOnTop; ShowIdeMessages;
fcConverter.Free; fcConverter.Free;
end; end;
end; end;
@ -404,6 +406,11 @@ begin
end; end;
end; end;
class procedure TJcfIdeMain.ShowIdeMessages;
begin
LazarusIDE.DoShowMessagesView({PutOnTop} True);
end;
procedure TJcfIdeMain.DoRegistrySettings(Sender: TObject); procedure TJcfIdeMain.DoRegistrySettings(Sender: TObject);
var var
lcAbout: TfmRegistrySettings; lcAbout: TfmRegistrySettings;

View File

@ -85,7 +85,7 @@ implementation
uses uses
{ local } { local }
JcfLog, JcfRegistrySettings, diffmerge, jcfbaseConsts; JcfLog, JcfRegistrySettings, diffmerge, jcfbaseConsts, JcfIdeMain;
constructor TEditorConverter.Create; constructor TEditorConverter.Create;
begin begin
@ -131,7 +131,7 @@ begin
Inc(fiConvertCount); Inc(fiConvertCount);
end end
else if IDEMessagesWindow<>nil then else if IDEMessagesWindow<>nil then
IDEMessagesWindow.ShowOnTop; TJcfIdeMain.ShowIdeMessages;
end; end;
function TEditorConverter.ReadFromIDE(const pcUnit: TSourceEditorInterface): string; function TEditorConverter.ReadFromIDE(const pcUnit: TSourceEditorInterface): string;