From 1e1fc89697aa5a25d41dabc88a6373f701782971 Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 20 Apr 2011 14:22:21 +0000 Subject: [PATCH] Mantis issue 0021110: Low efficiency of the explode. --- src/EntityGUI/EntityGUI_SubShapeDlg.cxx | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/EntityGUI/EntityGUI_SubShapeDlg.cxx b/src/EntityGUI/EntityGUI_SubShapeDlg.cxx index 368a04c01..9fbc5775b 100644 --- a/src/EntityGUI/EntityGUI_SubShapeDlg.cxx +++ b/src/EntityGUI/EntityGUI_SubShapeDlg.cxx @@ -203,7 +203,29 @@ void EntityGUI_SubShapeDlg::closeEvent(QCloseEvent* e) void EntityGUI_SubShapeDlg::ClickOnOk() { setIsApplyAndClose(true); - if (ClickOnApply()) + + SUIT_Session::session()->activeApplication()->putInfo(""); + + /* Explode all sub shapes */ + bool isOk = true; + if (isAllSubShapes()) { + /* More than 30 subshapes : ask confirmation */ + unsigned int nb = NumberOfSubShapes(myShape, shapeType()); + if (nb > 30) { + const QString caption = tr("GEOM_CONFIRM"); + const QString text = tr("GEOM_CONFIRM_INFO").arg(nb); + const QString button0 = tr("GEOM_BUT_EXPLODE"); + const QString button1 = tr("GEOM_BUT_CANCEL"); + + if (QMessageBox::warning(this, caption, text, button0, button1) != 0) + isOk = false; /* aborted */ + } + } + + if (isOk) + isOk = onAccept(); + + if (isOk) ClickOnCancel(); } -- 2.39.2