From 4c733ea2ac53e7ff524413f7e1d76e5edf5bf044 Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Wed, 23 Feb 2011 03:35:13 +0000 Subject: [PATCH] Ram Search - fix graying out of Undo menu item, fix SaveUndo() so that it creates a copy of the searchList rather than being a reference to it --- BizHawk.MultiClient/tools/RamSearch.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/BizHawk.MultiClient/tools/RamSearch.cs b/BizHawk.MultiClient/tools/RamSearch.cs index 94790aa5d8..d2b2359ee1 100644 --- a/BizHawk.MultiClient/tools/RamSearch.cs +++ b/BizHawk.MultiClient/tools/RamSearch.cs @@ -24,11 +24,10 @@ namespace BizHawk.MultiClient //Option to always remove Ram Watch list from search list //Truncate from file toolstrip button //Save Dialog - user cancelling crashes, same for Ram Watch? - //Weddedlist & undoList are getting references instead of copies, somehow still works but there has to be some failures as a result, fix - //Add button to set copy current values to prev + //Add button to set copy current values to prev //After search everything goes pink - //**Limit number of digits in specific value based on data type, allow negative sign if signed values, and hex if hex values! - + //**Limit number of digits in specific value based on data type, allow negative sign if signed values, and hex if hex values! + //Search equal to previous value, eveyrthing will be pink afterward string systemID = "NULL"; List searchList = new List(); @@ -430,7 +429,9 @@ namespace BizHawk.MultiClient /// private void SaveUndo() { - undoList = new List(searchList); + undoList.Clear(); + for (int x = 0; x < searchList.Count; x++) + undoList.Add(new Watch(searchList[x])); } private void DoUndo() @@ -1333,9 +1334,9 @@ namespace BizHawk.MultiClient searchToolStripMenuItem.Enabled = true; if (undoList.Count == 0) - UndotoolStripButton.Enabled = false; - else - UndotoolStripButton.Enabled = true; + undoToolStripMenuItem.Enabled = false; + else + undoToolStripMenuItem.Enabled = true; ListView.SelectedIndexCollection indexes = SearchListView.SelectedIndices;