Salome HOME
Copyright update 2020
[modules/jobmanager.git] / src / genericgui / BL_GenericGui.cxx
index 71acc291ed03bc62a1b006309d1bdc95e89be373..54764bdd11173966e14be1af681f0bf2c1362a8e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009-2016  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2020  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -26,6 +26,7 @@
 #include <QSplitter>
 #include <QStandardItemModel>
 #include <QVBoxLayout>
+#include <QMessageBox>
 
 #ifdef WNT
 #undef ERROR
@@ -624,3 +625,17 @@ BL::GenericGui::updateButtonsStatesSingleSelection()
     DEBTRACE("ERROR in updateButtonsStates !!!!!!");
   }
 }
+
+void
+BL::GenericGui::saveIfNeeded()
+{
+  if(!_jobs_manager->emptyJobsList())
+  {
+    if(QMessageBox::question (0,
+                              tr("List of jobs in JOBMANAGER."),
+                              tr("Do you want to save the list of jobs?"),
+                              QMessageBox::Yes | QMessageBox::No,
+                              QMessageBox::No) == QMessageBox::Yes)
+      _jobs_manager->save_jobs_button();
+  }
+}
\ No newline at end of file