Skip to content

Commit

Permalink
Merge #2242 Allow uninstallation of mods while Incompatible filter is…
Browse files Browse the repository at this point in the history
… selected
  • Loading branch information
politas committed Jan 6, 2018
2 parents 7ee9bfe + eec6dd2 commit 6709d30
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
### Bugfixes
- [GUI] Check provides for optional dependencies in GUI (#2240 by: HebaruSan; reviewed: politas)
- [GUI] Update registry at start of GUI if available_modules is empty (#2241 by: HebaruSan; reviewed: politas)
- [GUI] Allow uninstallation of mods while Incompatible filter is selected (#2242 by: HebaruSan; reviewed: politas)

## v1.24.0-PRE1 (McCandless)

Expand Down
56 changes: 27 additions & 29 deletions GUI/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -701,46 +701,44 @@ private void ModList_CellMouseDoubleClick(object sender, DataGridViewCellMouseEv

private async void ModList_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
if (mainModList.ModFilter == GUIModFilter.Incompatible)
return;

var row_index = e.RowIndex;
var column_index = e.ColumnIndex;
int row_index = e.RowIndex;
int column_index = e.ColumnIndex;

if (row_index < 0 || column_index < 0)
return;

var registry_manager = RegistryManager.Instance(CurrentInstance);

var grid = sender as DataGridView;
DataGridView grid = sender as DataGridView;
DataGridViewRow row = grid?.Rows[row_index];
DataGridViewCell gridCell = row?.Cells[column_index];

var row = grid.Rows[row_index];
var grid_view_cell = row.Cells[column_index];

if (grid_view_cell is DataGridViewLinkCell)
if (gridCell is DataGridViewLinkCell)
{
var cell = grid_view_cell as DataGridViewLinkCell;
Process.Start(cell.Value.ToString());
// Launch URLs if found in grid
DataGridViewLinkCell cell = gridCell as DataGridViewLinkCell;
string cmd = cell?.Value.ToString();
if (!string.IsNullOrEmpty(cmd))
Process.Start(cmd);
}
else if (column_index < 2)
{
var gui_mod = (GUIMod)row.Tag;
switch (column_index)
GUIMod gui_mod = row?.Tag as GUIMod;
if (gui_mod != null)
{
case 0:
gui_mod.SetInstallChecked(row);
if (gui_mod.IsInstallChecked)
last_mod_to_have_install_toggled.Push(gui_mod);

break;

case 1:
gui_mod.SetUpgradeChecked(row);
break;
switch (column_index)
{
case 0:
gui_mod.SetInstallChecked(row);
if (gui_mod.IsInstallChecked)
last_mod_to_have_install_toggled.Push(gui_mod);
break;
case 1:
gui_mod.SetUpgradeChecked(row);
break;
}
await UpdateChangeSetAndConflicts(
RegistryManager.Instance(CurrentInstance).registry
);
}

var registry = registry_manager.registry;
await UpdateChangeSetAndConflicts(registry);
}
}

Expand Down

0 comments on commit 6709d30

Please sign in to comment.