Ram Watch - revert "fix" to watch count display, make watch list count update in appropriate places, don't count separators in watch count, fix cosmetically be showing "watch" instead of "watches" when there is 1 address

This commit is contained in:
adelikat 2012-06-09 21:57:00 +00:00
parent 376ffd3ba4
commit c0d5437ff4
1 changed files with 21 additions and 1 deletions

View File

@ -88,7 +88,8 @@ namespace BizHawk.MultiClient
WatchListView.BlazingFast = true;
WatchListView.Refresh();
WatchListView.BlazingFast = false;
WatchCountLabel.Text = watchList.Count.ToString() + " watches";
}
public void AddWatch(Watch w)
@ -280,6 +281,7 @@ namespace BizHawk.MultiClient
{
watchList.Clear();
DisplayWatchList();
UpdateWatchCount();
currentFile = "";
changes = false;
MessageLabel.Text = "";
@ -293,6 +295,20 @@ namespace BizHawk.MultiClient
return WatchCommon.SaveWchFile(path, Domain.Name, watchList);
}
private void UpdateWatchCount()
{
int count = 0;
foreach (Watch w in watchList)
{
if (!(w.type == atype.SEPARATOR))
{
count++;
}
}
WatchCountLabel.Text = count.ToString() + (count == 1 ? " watch" : " watches");
}
public bool LoadWatchFile(string path, bool append)
{
string domain = "";
@ -306,6 +322,7 @@ namespace BizHawk.MultiClient
}
changes = false;
MessageLabel.Text = Path.GetFileNameWithoutExtension(path);
UpdateWatchCount();
Global.Config.RecentWatches.Add(path);
SetMemoryDomain(WatchCommon.GetDomainPos(domain));
return true;
@ -339,6 +356,7 @@ namespace BizHawk.MultiClient
watchList.Add(r.watch);
Changes();
DisplayWatchList();
UpdateWatchCount();
}
}
@ -387,6 +405,7 @@ namespace BizHawk.MultiClient
DisplayWatchList();
}
UpdateValues();
UpdateWatchCount();
}
void DuplicateWatch()
@ -411,6 +430,7 @@ namespace BizHawk.MultiClient
}
}
UpdateValues();
UpdateWatchCount();
}
void MoveUp()