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

Don't Force Apply button active when no update selected #2429

Merged
merged 2 commits into from
May 1, 2018
Merged
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
6 changes: 1 addition & 5 deletions GUI/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand All @@ -496,8 +494,6 @@ private void MarkAllUpdatesToolButton_Click(object sender, EventArgs e)
}

ModList.Refresh();


}

public void UpdateModContentsTree(CkanModule module, bool force = false)
Expand Down
15 changes: 4 additions & 11 deletions GUI/MainModList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down