C2025-007 ROEditor - PROMPT to Confirm Deletion

When deleting a group or an RO in the RO Editor, consider adding a prompte for the user asking if they are sure they want to delete the ro/group.  Perhaps also add text to the message saying they may want to consider creating a zip file of the RO folder prior to deleting ROs/groups.
This commit is contained in:
Matthew Schill 2025-01-22 12:45:27 -05:00
parent 565779c9c8
commit 96e61aea2b

View File

@ -2398,20 +2398,26 @@ namespace ROEditor
*/ */
private void menuRODelete_Click(object sender, System.EventArgs e) private void menuRODelete_Click(object sender, System.EventArgs e)
{ {
bool success=false; string msgstr = "It is recommended that you may wish to create a backup zip of your RO folder prior to performing deletions.\n\nAre you sure you wish to delete the selected RO/RO Group?";
XmlNode nd = (XmlNode) roTreeView.SelectedNode.Tag;
if (nd.ParentNode.Name == "RO_Root") DialogResult AnswerYN = MessageBox.Show(msgstr, "Deleting ROs/RO Group", MessageBoxButtons.YesNo);
success = myrodb.RODB_DeleteGroup(nd,null,null); if (AnswerYN == DialogResult.Yes)
else
success = myrodb.RODB_DeleteRO(nd);
if (success == true)
{ {
// remove from xml tree & the tree control bool success = false;
XmlNode parent = nd.ParentNode; XmlNode nd = (XmlNode)roTreeView.SelectedNode.Tag;
parent.RemoveChild(nd); if (nd.ParentNode.Name == "RO_Root")
updateRoListView(roTreeView.SelectedNode.Parent); success = myrodb.RODB_DeleteGroup(nd, null, null);
roTreeView.SelectedNode.Remove(); else
roTreeView.Refresh(); success = myrodb.RODB_DeleteRO(nd);
if (success == true)
{
// remove from xml tree & the tree control
XmlNode parent = nd.ParentNode;
parent.RemoveChild(nd);
updateRoListView(roTreeView.SelectedNode.Parent);
roTreeView.SelectedNode.Remove();
roTreeView.Refresh();
}
} }
} }