diff --git a/GUI/Main.cs b/GUI/Main.cs index b2858176bf..4aff6f041c 100644 --- a/GUI/Main.cs +++ b/GUI/Main.cs @@ -469,11 +469,9 @@ private void MarkAllUpdatesToolButton_Click(object sender, EventArgs e) foreach (DataGridViewRow row in ModList.Rows) { var mod = (GUIMod)row.Tag; - if (mod.HasUpdate && row.Cells[1] is DataGridViewCheckBoxCell) + if (mod.HasUpdate) { MarkModForUpdate(mod.Identifier); - mod.SetUpgradeChecked(row, true); - ApplyToolButton.Enabled = true; } } @@ -496,8 +494,6 @@ private void MarkAllUpdatesToolButton_Click(object sender, EventArgs e) } ModList.Refresh(); - - } public void UpdateModContentsTree(CkanModule module, bool force = false) diff --git a/GUI/MainModList.cs b/GUI/MainModList.cs index 22a8e21d41..3e35980c56 100644 --- a/GUI/MainModList.cs +++ b/GUI/MainModList.cs @@ -223,19 +223,12 @@ public void MarkModForUpdate(string identifier) { Util.Invoke(this, () => _MarkModForUpdate(identifier)); } - - + public void _MarkModForUpdate(string identifier) { - foreach (DataGridViewRow row in ModList.Rows) - { - var mod = (GUIMod) row.Tag; - if (mod.Identifier == identifier) - { - (row.Cells[1] as DataGridViewCheckBoxCell).Value = true; - break; - } - } + DataGridViewRow row = mainModList.full_list_of_mod_rows[identifier]; + var mod = (GUIMod)row.Tag; + mod.SetUpgradeChecked(row, true); } private void ModList_SelectedIndexChanged(object sender, EventArgs e)