Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke GUI update calls in SetupDefaultSearch() descendants #3380

Merged
merged 1 commit into from
May 24, 2021
Merged
Changes from all commits
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
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