Skip to content

Commit

Permalink
Merge pull request #20 from swittlich/main
Browse files Browse the repository at this point in the history
The OnProjectCreated method is now called when the project is created.
  • Loading branch information
HendrikMennen authored Oct 16, 2024
2 parents 0cf4624 + 04bd3f1 commit ad71cd1
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,19 @@ public async Task SaveAsync(FlexibleWindow window)
["Exclude"] = new JsonArray("build")
};
var root = new UniversalFpgaProjectRoot(projectFile, defaultProperties);

if (_fpgaService.Toolchains.FirstOrDefault(x => x.Name == _toolchainSetting.Value.ToString()) is { } tc)
root.Toolchain = tc;


if (_fpgaService.Loaders.FirstOrDefault(x => x.Name == _loaderSetting.Value.ToString()) is { } loader)
root.Loader = loader;


if (_fpgaService.Toolchains.FirstOrDefault(x => x.Name == _toolchainSetting.Value.ToString()) is { } tc) {
root.Toolchain = tc;
tc.OnProjectCreated(root);
}

await _manager.SaveProjectAsync(root);

_projectExplorerService.Insert(root);

_projectExplorerService.ActiveProject = root;

if (_fpgaService.Templates.FirstOrDefault(x => x.Name == _templateSetting.Value.ToString()) is { } template)
Expand Down

0 comments on commit ad71cd1

Please sign in to comment.