comparison FrmMain.cs @ 66:68d4f7499212

Re #176: Bug when saving recently edited army * Make save button available whether army has previously been saved or not (partly for usability and partly to try to trigger bug) Bug seems to occur when opening an army as the first action, adding a unit and saving it, but not when creating a new army as the first action, then loading an old army as the second action, then adding a unit and saving it
author IBBoard <dev@ibboard.co.uk>
date Sat, 26 Sep 2009 09:51:53 +0000
parents c4181adba7df
children 75cf9b6608f5
comparison
equal deleted inserted replaced
65:c4181adba7df 66:68d4f7499212
1005 { 1005 {
1006 bttnUndo.ToolTipText = menuItemsUndo[0].Text; 1006 bttnUndo.ToolTipText = menuItemsUndo[0].Text;
1007 undoMenu.MenuItems.AddRange(menuItemsUndo); 1007 undoMenu.MenuItems.AddRange(menuItemsUndo);
1008 } 1008 }
1009 1009
1010 bool canSave = loadedFilePath != null; 1010 bttnSaveArmy.Enabled = commandStack.IsDirty() && CurrentArmy!=null;
1011 bttnSaveArmy.Enabled = commandStack.IsDirty() && CurrentArmy!=null && canSave; 1011 miSaveArmy.Enabled = commandStack.IsDirty() && CurrentArmy!=null;
1012 miSaveArmy.Enabled = commandStack.IsDirty() && CurrentArmy!=null && canSave;
1013 } 1012 }
1014 1013
1015 private void miSaveArmy_Click(object sender, System.EventArgs e) 1014 private void miSaveArmy_Click(object sender, System.EventArgs e)
1016 { 1015 {
1017 SaveCurrentArmy(); 1016 SaveCurrentArmy();