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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk selection features added. #1383

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
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
49 changes: 49 additions & 0 deletions GUI/Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions GUI/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,45 @@ private void FocusMod(string key, bool exactMatch)
this.AddStatusMessage("Not found");
}
}

private void selectAllInstalledModsToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (InstalledModule installedMod in CurrentInstance.Registry.InstalledModules)
{
MarkModForInstall(installedMod.identifier, false);
}
ChangeSet = mainModList.ComputeUserChangeSet();
ModList.Refresh();
}

private void deselectAllSelectedModsToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in ModList.Rows)
{
var mod = ((GUIMod)row.Tag);
if (row.Cells[0] is DataGridViewCheckBoxCell && (bool)row.Cells[0].Value)
{
MarkModForInstall(mod.Identifier, true);//(bool)row.Cells[0].Value);
}
}
ChangeSet = mainModList.ComputeUserChangeSet();
ApplyToolButton.Enabled = ChangeSet != null && (ChangeSet.Any());
ModList.Refresh();
}

private void RecommendedModsToggleCheckbox_CheckedChanged(object sender, EventArgs e)
{
var state = ((CheckBox)sender).Checked;
foreach (ListViewItem item in RecommendedModsListView.Items)
{
if (item.Checked != state)
{
item.Checked = state;
}
}
RecommendedModsListView.Refresh();
}

}

public class GUIUser : NullUser
Expand Down
2 changes: 2 additions & 0 deletions GUI/MainInstall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,14 @@ private void UpdateRecommendedDialog(Dictionary<string, List<string>> mods, bool
RecommendedDialogLabel.Text =
"The following modules have been recommended by one or more of the chosen modules:";
RecommendedModsListView.Columns[1].Text = "Recommended by:";
RecommendedModsToggleCheckbox.Text = "(De-)select all recommended mods.";
}
else
{
RecommendedDialogLabel.Text =
"The following modules have been suggested by one or more of the chosen modules:";
RecommendedModsListView.Columns[1].Text = "Suggested by:";
RecommendedModsToggleCheckbox.Text = "(De-)select all suggested mods.";
}


Expand Down