Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Yafc.Model/Model/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ public override ModelObject? ownerObject {
internal set => throw new NotSupportedException();
}

public void AssureFirstPage() {
if (pages.Count == 0) {
ProjectPage firstPage = new ProjectPage(this, typeof(ProductionTable));
pages.Add(firstPage);
pagesByGuid[firstPage.guid] = firstPage;

displayPages.Add(firstPage.guid);
}
}

private void UpdatePageMapping() {
hiddenPages = 0;
pagesByGuid.Clear();
Expand Down
10 changes: 1 addition & 9 deletions Yafc/Windows/MainScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,7 @@ private void SetProject(Project project) {
this.project = project;
if (project.justCreated) {
_ = ShowPseudoScreen(new MilestonesPanel());
}

if (project.pages.Count == 0) {
ProjectPage firstPage = new ProjectPage(project, typeof(ProductionTable));
project.pages.Add(firstPage);
}

if (project.displayPages.Count == 0) {
project.displayPages.Add(project.pages[0].guid);
project.AssureFirstPage();
}

// Hack to activate all page solvers for the summary view
Expand Down