A hackish workaround to make Select All faster in the Cheat Dialog

This commit is contained in:
adelikat 2014-03-23 14:10:35 +00:00
parent 6d1675e54c
commit 8b6bf3fc89
2 changed files with 22 additions and 9 deletions

View File

@ -776,11 +776,21 @@ namespace BizHawk.Client.EmuHawk
selection = -1;
}
// Informs user that a select all event is in place, can be used in change events to wait until this is false
public bool SelectAllInProgress { get; set; }
public void SelectAll()
{
this.BeginUpdate();
SelectAllInProgress = true;
for (var i = 0; i < _itemCount; i++)
{
if (i == _itemCount - 1)
{
SelectAllInProgress = false;
}
this.SelectItem(i, true);
}

View File

@ -389,16 +389,19 @@ namespace BizHawk.Client.EmuHawk
private void DoSelectedIndexChange()
{
if (SelectedCheats.Any())
if (!CheatListView.SelectAllInProgress)
{
var cheat = SelectedCheats.First();
CheatEditor.SetCheat(cheat);
CheatGroupBox.Text = "Editing Cheat " + cheat.Name + " - " + cheat.AddressStr;
}
else
{
CheatEditor.ClearForm();
CheatGroupBox.Text = "New Cheat";
if (SelectedCheats.Any())
{
var cheat = SelectedCheats.First();
CheatEditor.SetCheat(cheat);
CheatGroupBox.Text = "Editing Cheat " + cheat.Name + " - " + cheat.AddressStr;
}
else
{
CheatEditor.ClearForm();
CheatGroupBox.Text = "New Cheat";
}
}
}