Ram Watch - implement quick save function

This commit is contained in:
andres.delikat 2011-01-20 00:17:49 +00:00
parent 8b4e356789
commit 581129b6d5
1 changed files with 18 additions and 3 deletions

View File

@ -15,12 +15,13 @@ namespace BizHawk.MultiClient
{ {
//TODO: //TODO:
//Recent files & autoload //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 //implement separator feature
//Display address as hex //Display address as hex
List<Watch> watchList = new List<Watch>(); List<Watch> watchList = new List<Watch>();
string currentWatchFile = "";
public RamWatch() public RamWatch()
{ {
InitializeComponent(); InitializeComponent();
@ -54,6 +55,7 @@ namespace BizHawk.MultiClient
//TODO: ask to save changes if necessary //TODO: ask to save changes if necessary
watchList.Clear(); watchList.Clear();
DisplayWatchList(); DisplayWatchList();
currentWatchFile = "";
} }
private bool SaveWatchFile(string path) private bool SaveWatchFile(string path)
@ -93,6 +95,8 @@ namespace BizHawk.MultiClient
using (StreamReader sr = file.OpenText()) using (StreamReader sr = file.OpenText())
{ {
currentWatchFile = path;
int count = 0; int count = 0;
string s = ""; string s = "";
string temp = ""; string temp = "";
@ -214,7 +218,9 @@ namespace BizHawk.MultiClient
private void saveToolStripMenuItem_Click(object sender, EventArgs e) 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() private FileInfo GetSaveFileFromUser()
@ -313,6 +319,15 @@ namespace BizHawk.MultiClient
autoLoadToolStripMenuItem.Checked = true; autoLoadToolStripMenuItem.Checked = true;
else else
autoLoadToolStripMenuItem.Checked = false; autoLoadToolStripMenuItem.Checked = false;
if (string.Compare(currentWatchFile, "") == 0)
{
saveToolStripMenuItem.Enabled = false;
}
else
{
saveToolStripMenuItem.Enabled = true;
}
} }
private void UpdateAutoLoadRamWatch() private void UpdateAutoLoadRamWatch()