]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Clean history message for the case when there is nothing to be deleted.
authornds <nds@opencascade.com>
Wed, 24 Feb 2016 15:37:22 +0000 (18:37 +0300)
committernds <nds@opencascade.com>
Wed, 24 Feb 2016 15:37:22 +0000 (18:37 +0300)
src/XGUI/XGUI_Workshop.cpp

index 57928b4b84341d8a55ad7e8ea92d33531e8884bd..c754c7de3663bf108d0b52fbb6aa61595655f509 100755 (executable)
@@ -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;
+  }
 }
 
 //**************************************************************