From e7df788b6775ede4d90fb4579ab5c3e630e2a88f Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 24 Feb 2016 18:37:22 +0300 Subject: [PATCH] Clean history message for the case when there is nothing to be deleted. --- src/XGUI/XGUI_Workshop.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) 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; + } } //************************************************************** -- 2.39.2