From: nds Date: Wed, 24 Feb 2016 15:37:22 +0000 (+0300) Subject: Clean history message for the case when there is nothing to be deleted. X-Git-Tag: V_2.2.0~75 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e7df788b6775ede4d90fb4579ab5c3e630e2a88f;p=modules%2Fshaper.git Clean history message for the case when there is nothing to be deleted. --- diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 57928b4b8..c754c7de3 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1305,6 +1305,21 @@ void XGUI_Workshop::cleanHistory() QString aText = QString(tr("Unused features are the following: %1.\nThese features will be deleted.\nWould you like to continue?") .arg(anUnusedNames)); + /*QString aText; + if (anUnusedNames.isEmpty()) { + aMessageBox.setStandardButtons(QMessageBox::Ok); + aMessageBox.setDefaultButton(QMessageBox::Ok); + + aText = QString(tr("All features are relevant, there is nothing to be deleted")); + } + else { + aMessageBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes); + aMessageBox.setDefaultButton(QMessageBox::No); + + aText = QString(tr("Unused features are the following: %1.\nThese features will be deleted.\nWould you like to continue?") + .arg(anUnusedNames)); + }*/ + aMessageBox.setText(aText); if (aMessageBox.exec() == QMessageBox::No) return; @@ -1322,6 +1337,26 @@ void XGUI_Workshop::cleanHistory() operationMgr()->abortOperation(operationMgr()->currentOperation()); } } + else { + QString anActionId = "CLEAN_HISTORY_CMD"; + QString aDescription = contextMenuMgr()->action(anActionId)->text(); + + QMessageBox aMessageBox(desktop()); + aMessageBox.setWindowTitle(aDescription); + aMessageBox.setIcon(QMessageBox::Warning); + aMessageBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes); + aMessageBox.setDefaultButton(QMessageBox::No); + + QString aText; + aMessageBox.setStandardButtons(QMessageBox::Ok); + aMessageBox.setDefaultButton(QMessageBox::Ok); + + aText = QString(tr("All features are relevant, there is nothing to be deleted")); + aMessageBox.setText(aText); + + if (aMessageBox.exec() == QMessageBox::No) + return; + } } //**************************************************************