mirror of https://gitlab.com/basile.b/dexed.git
projects groups, store config index when item is a DUB project
This commit is contained in:
parent
acebde858c
commit
aa79f2671d
|
@ -26,13 +26,16 @@ type
|
||||||
*)
|
*)
|
||||||
TProjectGroupItem = class(TCollectionItem)
|
TProjectGroupItem = class(TCollectionItem)
|
||||||
private
|
private
|
||||||
|
fConfigIndex: integer;
|
||||||
fFilename: string;
|
fFilename: string;
|
||||||
fProj: ICECommonProject;
|
fProj: ICECommonProject;
|
||||||
fGroup: TProjectGroup;
|
fGroup: TProjectGroup;
|
||||||
fAsyncMode: TCEProjectAsyncMode;
|
fAsyncMode: TCEProjectAsyncMode;
|
||||||
|
function storeConfigIndex: boolean;
|
||||||
published
|
published
|
||||||
property filename: string read fFilename write fFilename;
|
property filename: string read fFilename write fFilename;
|
||||||
property asyncMode: TCEProjectAsyncMode read fAsyncMode write fAsyncMode;
|
property asyncMode: TCEProjectAsyncMode read fAsyncMode write fAsyncMode;
|
||||||
|
property configurationIndex: integer read fConfigIndex write fConfigIndex stored storeConfigIndex;
|
||||||
public
|
public
|
||||||
property project: ICECommonProject read fProj;
|
property project: ICECommonProject read fProj;
|
||||||
procedure lazyLoad;
|
procedure lazyLoad;
|
||||||
|
@ -191,7 +194,15 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProjectGroup.projChanged(project: ICECommonProject);
|
procedure TProjectGroup.projChanged(project: ICECommonProject);
|
||||||
|
var
|
||||||
|
itm: TProjectGroupItem;
|
||||||
begin
|
begin
|
||||||
|
if assigned(project) and project.inGroup and (project.getFormat = pfDub) then
|
||||||
|
begin
|
||||||
|
itm := Self.addItem(project.filename);
|
||||||
|
if assigned(itm) then
|
||||||
|
itm.configurationIndex:=project.getActiveConfigurationIndex;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProjectGroup.projClosing(project: ICECommonProject);
|
procedure TProjectGroup.projClosing(project: ICECommonProject);
|
||||||
|
@ -261,12 +272,15 @@ begin
|
||||||
fFreeStanding := nil;
|
fFreeStanding := nil;
|
||||||
result.fProj.activate;
|
result.fProj.activate;
|
||||||
end;
|
end;
|
||||||
|
result.configurationIndex:=result.fProj.getActiveConfigurationIndex;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProjectGroup.getProject(ix: Integer): ICECommonProject;
|
function TProjectGroup.getProject(ix: Integer): ICECommonProject;
|
||||||
begin
|
begin
|
||||||
item[ix].lazyLoad;
|
item[ix].lazyLoad;
|
||||||
exit(item[ix].fProj);
|
result := item[ix].project;
|
||||||
|
if result.getFormat = pfDub then
|
||||||
|
result.setActiveConfigurationIndex(item[ix].configurationIndex);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProjectGroup.findProject(const fname: string): ICECommonProject;
|
function TProjectGroup.findProject(const fname: string): ICECommonProject;
|
||||||
|
@ -349,6 +363,7 @@ begin
|
||||||
for i:= 0 to fItems.Count-1 do
|
for i:= 0 to fItems.Count-1 do
|
||||||
getItem(i).fGroup := self;
|
getItem(i).fGroup := self;
|
||||||
doChanged;
|
doChanged;
|
||||||
|
fModified := false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProjectGroup.saveGroup(const fname: string);
|
procedure TProjectGroup.saveGroup(const fname: string);
|
||||||
|
@ -370,6 +385,7 @@ begin
|
||||||
getItem(i).fFilename := ExtractRelativepath(n, getItem(i).fFilename);
|
getItem(i).fFilename := ExtractRelativepath(n, getItem(i).fFilename);
|
||||||
fBasePath := n;
|
fBasePath := n;
|
||||||
saveToFile(fname);
|
saveToFile(fname);
|
||||||
|
fModified := false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProjectGroup.closeGroup;
|
procedure TProjectGroup.closeGroup;
|
||||||
|
@ -422,6 +438,8 @@ begin
|
||||||
begin
|
begin
|
||||||
fProj := loadProject(absoluteFilename, true);
|
fProj := loadProject(absoluteFilename, true);
|
||||||
fProj.inGroup(true);
|
fProj.inGroup(true);
|
||||||
|
if fProj.getFormat = pfDub then
|
||||||
|
fProj.setActiveConfigurationIndex(fConfigIndex);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -433,6 +451,11 @@ begin
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TProjectGroupItem.storeConfigIndex: boolean;
|
||||||
|
begin
|
||||||
|
exit(fProj.getFormat = pfDub);
|
||||||
|
end;
|
||||||
|
|
||||||
function TProjectGroupItem.absoluteFilename: string;
|
function TProjectGroupItem.absoluteFilename: string;
|
||||||
begin
|
begin
|
||||||
if fGroup.fBasePath = '' then
|
if fGroup.fBasePath = '' then
|
||||||
|
|
Loading…
Reference in New Issue