From 581129b6d50857d5056a349ea432e92c971d633b Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Thu, 20 Jan 2011 00:17:49 +0000 Subject: [PATCH] Ram Watch - implement quick save function --- BizHawk.MultiClient/RamWatch.cs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/BizHawk.MultiClient/RamWatch.cs b/BizHawk.MultiClient/RamWatch.cs index cef5ba349d..d6dfecab97 100644 --- a/BizHawk.MultiClient/RamWatch.cs +++ b/BizHawk.MultiClient/RamWatch.cs @@ -15,12 +15,13 @@ namespace BizHawk.MultiClient { //TODO: //Recent files & autoload - //Keep track of changes to watch list in order to prompt the user to save changes + //Keep track of changes to watch list in order to prompt the user to save changes, also use this to enable/disable things like quick save //implement separator feature //Display address as hex - List watchList = new List(); - + List watchList = new List(); + string currentWatchFile = ""; + public RamWatch() { InitializeComponent(); @@ -54,6 +55,7 @@ namespace BizHawk.MultiClient //TODO: ask to save changes if necessary watchList.Clear(); DisplayWatchList(); + currentWatchFile = ""; } private bool SaveWatchFile(string path) @@ -93,6 +95,8 @@ namespace BizHawk.MultiClient using (StreamReader sr = file.OpenText()) { + currentWatchFile = path; + int count = 0; string s = ""; string temp = ""; @@ -214,7 +218,9 @@ namespace BizHawk.MultiClient private void saveToolStripMenuItem_Click(object sender, EventArgs e) { + if (string.Compare(currentWatchFile, "") == 0) return; + SaveWatchFile(currentWatchFileFile); //TODO: only do this if changes have been made } private FileInfo GetSaveFileFromUser() @@ -313,6 +319,15 @@ namespace BizHawk.MultiClient autoLoadToolStripMenuItem.Checked = true; else autoLoadToolStripMenuItem.Checked = false; + + if (string.Compare(currentWatchFile, "") == 0) + { + saveToolStripMenuItem.Enabled = false; + } + else + { + saveToolStripMenuItem.Enabled = true; + } } private void UpdateAutoLoadRamWatch()