From 851c1d20b9ae5fe79bca76118eb9f62a78494e5c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 9 Apr 2021 00:55:20 +0300 Subject: [PATCH 49/49] Ruledit: Delete "Edit Values" dialog when ruleset item is deleted See osdn #41957 Signed-off-by: Marko Lindqvist --- tools/ruledit/tab_building.cpp | 6 +++++- tools/ruledit/tab_unit.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/ruledit/tab_building.cpp b/tools/ruledit/tab_building.cpp index 31c9f6f328..7fe2f63624 100644 --- a/tools/ruledit/tab_building.cpp +++ b/tools/ruledit/tab_building.cpp @@ -209,7 +209,7 @@ void tab_building::name_given() **************************************************************************/ void tab_building::delete_now() { - if (selected != 0) { + if (selected != nullptr) { requirers_dlg *requirers; requirers = ui->create_requirers(improvement_rule_name(selected)); @@ -219,6 +219,10 @@ void tab_building::delete_now() selected->ruledit_disabled = true; + if (selected->ruledit_dlg != nullptr) { + ((edit_impr *)selected->ruledit_dlg)->done(0); + } + refresh(); update_bldg_info(nullptr); } diff --git a/tools/ruledit/tab_unit.cpp b/tools/ruledit/tab_unit.cpp index 61066da6f8..d17febca55 100644 --- a/tools/ruledit/tab_unit.cpp +++ b/tools/ruledit/tab_unit.cpp @@ -204,7 +204,7 @@ void tab_unit::name_given() **************************************************************************/ void tab_unit::delete_now() { - if (selected != 0) { + if (selected != nullptr) { requirers_dlg *requirers; requirers = ui->create_requirers(utype_rule_name(selected)); @@ -214,6 +214,10 @@ void tab_unit::delete_now() selected->ruledit_disabled = true; + if (selected->ruledit_dlg != nullptr) { + ((edit_utype *)selected->ruledit_dlg)->done(0); + } + refresh(); update_utype_info(nullptr); } -- 2.30.2