Skip to content

Commit

Permalink
Merge #3380 Invoke GUI update calls in SetupDefaultSearch() descendants
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed May 24, 2021
2 parents 0cd4f17 + befd8b1 commit 549bf98
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## v1.30.3

### Bugfixes

- [GUI] Invoke GUI update calls in SetupDefaultSearch() descendants (#3380 by: DasSkelett; reviewed: HebaruSan)

## v1.30.2 (Hawking)

### Features
Expand Down
45 changes: 26 additions & 19 deletions GUI/Controls/ManageMods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,38 +361,45 @@ public void Filter(SavedSearch search)
var searches = search.Values.Select(s => ModSearch.Parse(s,
Main.Instance.ManageMods.mainModList.ModuleLabels.LabelsFor(Main.Instance.CurrentInstance.Name).ToList()
)).ToList();
EditModSearches.SetSearches(searches);

// Ask the configuration which columns to show.
foreach (DataGridViewColumn col in ModGrid.Columns)
Util.Invoke(ModGrid, () =>
{
// Some columns are always shown, and others are handled by UpdateModsList()
if (col.Name != "Installed" && col.Name != "UpdateCol" && col.Name != "ReplaceCol")
EditModSearches.SetSearches(searches);
// Ask the configuration which columns to show.
foreach (DataGridViewColumn col in ModGrid.Columns)
{
col.Visible = !Main.Instance.configuration.HiddenColumnNames.Contains(col.Name);
// Some columns are always shown, and others are handled by UpdateModsList()
if (col.Name != "Installed" && col.Name != "UpdateCol" && col.Name != "ReplaceCol")
{
col.Visible = !Main.Instance.configuration.HiddenColumnNames.Contains(col.Name);
}
}
}
// If these columns aren't hidden by the user, show them if the search includes installed modules
setInstalledColumnsVisible(!SearchesExcludeInstalled(searches));
// If these columns aren't hidden by the user, show them if the search includes installed modules
setInstalledColumnsVisible(!SearchesExcludeInstalled(searches));
});
}

public void SetSearches(List<ModSearch> searches)
{
mainModList.SetSearches(searches);
EditModSearches.SetSearches(searches);

// Ask the configuration which columns to show.
foreach (DataGridViewColumn col in ModGrid.Columns)
Util.Invoke(ModGrid, () =>
{
// Some columns are always shown, and others are handled by UpdateModsList()
if (col.Name != "Installed" && col.Name != "UpdateCol" && col.Name != "ReplaceCol")
mainModList.SetSearches(searches);
EditModSearches.SetSearches(searches);
// Ask the configuration which columns to show.
foreach (DataGridViewColumn col in ModGrid.Columns)
{
col.Visible = !Main.Instance.configuration.HiddenColumnNames.Contains(col.Name);
// Some columns are always shown, and others are handled by UpdateModsList()
if (col.Name != "Installed" && col.Name != "UpdateCol" && col.Name != "ReplaceCol")
{
col.Visible = !Main.Instance.configuration.HiddenColumnNames.Contains(col.Name);
}
}
}
setInstalledColumnsVisible(!SearchesExcludeInstalled(searches));
setInstalledColumnsVisible(!SearchesExcludeInstalled(searches));
});
}

private static readonly string[] installedColumnNames = new string[]
Expand Down

0 comments on commit 549bf98

Please sign in to comment.