WstImportDlg: fix opening generated files in editor (Thanks Juha Maninnen)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3181 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
f1b0922aa1
commit
58be34c928
@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||||
ExtCtrls, Buttons, ActnList, logger_intf;
|
ExtCtrls, Buttons, ActnList, logger_intf {$IFDEF WST_IDE}, LCLVersion {$ENDIF};
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ implementation
|
|||||||
|
|
||||||
uses DOM, XMLRead, wst_fpc_xml, pastree, pascal_parser_intf, wsdl_parser, source_utils,
|
uses DOM, XMLRead, wst_fpc_xml, pastree, pascal_parser_intf, wsdl_parser, source_utils,
|
||||||
generator, metadata_generator, binary_streamer, wst_resources_utils
|
generator, metadata_generator, binary_streamer, wst_resources_utils
|
||||||
{$IFDEF WST_IDE},LazIDEIntf{$ENDIF},locators,xsd_parser;
|
{$IFDEF WST_IDE},LazIDEIntf, ProjectIntf {$ENDIF},locators,xsd_parser;
|
||||||
|
|
||||||
type
|
type
|
||||||
TSourceType = xgoInterface .. xgoBinder;
|
TSourceType = xgoInterface .. xgoBinder;
|
||||||
@ -280,14 +280,13 @@ var
|
|||||||
tree : TwstPasTreeContainer;
|
tree : TwstPasTreeContainer;
|
||||||
oldCursor : TCursor;
|
oldCursor : TCursor;
|
||||||
srcMgnr : ISourceManager;
|
srcMgnr : ISourceManager;
|
||||||
i : Integer;
|
|
||||||
genOptions : TGenOptions;
|
genOptions : TGenOptions;
|
||||||
fileSet : TSourceTypes;
|
fileSet : TSourceTypes;
|
||||||
|
destPath : string;
|
||||||
{$IFDEF WST_IDE}
|
{$IFDEF WST_IDE}
|
||||||
j, c : Integer;
|
i, j, c : Integer;
|
||||||
srcItm : ISourceStream;
|
srcItm : ISourceStream;
|
||||||
trueOpenFlags, openFlags : TOpenFlags;
|
trueOpenFlags, openFlags : TOpenFlags;
|
||||||
destPath : string;
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
oldCursor := Screen.Cursor;
|
oldCursor := Screen.Cursor;
|
||||||
@ -297,28 +296,25 @@ begin
|
|||||||
try
|
try
|
||||||
genOptions := GetOptions();
|
genOptions := GetOptions();
|
||||||
fileSet := genOptions - [xgoWrappedParameter,xgoDocAsComments];
|
fileSet := genOptions - [xgoWrappedParameter,xgoDocAsComments];
|
||||||
srcMgnr := GenerateSource(
|
destPath := IncludeTrailingPathDelimiter(edtOutputDir.Text);
|
||||||
tree,fileSet,otFileSystem,IncludeTrailingPathDelimiter(edtOutputDir.Text),
|
srcMgnr := GenerateSource(tree, fileSet, otFileSystem, destPath,
|
||||||
@ShowStatusMessage,
|
@ShowStatusMessage, genOptions);
|
||||||
genOptions
|
|
||||||
);
|
|
||||||
ShowStatusMessage(mtInfo,'');
|
ShowStatusMessage(mtInfo,'');
|
||||||
{$IFDEF WST_IDE}
|
{$IFDEF WST_IDE}
|
||||||
{openFlags := [ofRevert];
|
{$IF lcl_fullversion >= 1030000}
|
||||||
|
openFlags := [ofRevert];
|
||||||
if edtAddToProject.Checked then begin
|
if edtAddToProject.Checked then begin
|
||||||
Include(openFlags, ofAddToProject);
|
Include(openFlags, ofAddToProject);
|
||||||
end;
|
end;
|
||||||
destPath := IncludeTrailingPathDelimiter(edtOutputDir.Text);
|
|
||||||
c := srcMgnr.GetCount();
|
c := srcMgnr.GetCount();
|
||||||
for i := 0 to Pred(c) do begin
|
for i := 0 to Pred(c) do begin
|
||||||
srcItm := srcMgnr.GetItem(i);
|
srcItm := srcMgnr.GetItem(i);
|
||||||
trueOpenFlags := openFlags;
|
trueOpenFlags := openFlags;
|
||||||
for j := 0 to Pred(LazarusIDE.ActiveProject.FileCount) do begin
|
if Assigned( LazarusIDE.ActiveProject.FindFile(srcItm.GetFileName(), [pfsfOnlyProjectFiles]) ) then
|
||||||
if AnsiSameText(srcItm.GetFileName(),ExtractFileName(LazarusIDE.ActiveProject.Files[j].Filename)) then
|
Exclude(trueOpenFlags, ofAddToProject);
|
||||||
trueOpenFlags := trueOpenFlags - [ofAddToProject];
|
LazarusIDE.DoOpenEditorFile(destPath + srcItm.GetFileName(), -1, -1, trueOpenFlags);
|
||||||
end;
|
end;
|
||||||
LazarusIDE.DoOpenEditorFile(destPath + srcItm.GetFileName(),-1,trueOpenFlags);
|
{$ENDIF}
|
||||||
end;}
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
finally
|
finally
|
||||||
srcMgnr := nil;
|
srcMgnr := nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user