]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
Ask to save the jobs before exit.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Tue, 30 Jan 2018 16:15:16 +0000 (17:15 +0100)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Tue, 30 Jan 2018 16:15:16 +0000 (17:15 +0100)
src/engine/BL_JobsManager.hxx
src/genericgui/BL_GenericGui.cxx
src/genericgui/BL_GenericGui.hxx
src/salomegui/BL_SalomeGui.cxx

index 8a60afb495fccc580990ed7c0a8756f6b62fe007..ad7abfe64827dcd2a0ce78e9dc6994e8c3435e86 100644 (file)
@@ -80,6 +80,8 @@ namespace BL{
       static void launcher_event_remove_job_thread(void * object_ptr);
       void launcher_event_update_job_state(const std::string & data);
 
+      bool emptyJobsList() {return _jobs.empty();}
+
       struct thread_info
       {
         BL::JobsManager * object_ptr;
index 71acc291ed03bc62a1b006309d1bdc95e89be373..c24789524ff0b9b20953f04a35e289406d42218d 100644 (file)
@@ -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
index 72775f6b1bcc3fbbf64e2dd753197b6134b55e66..95ec293d6c3e2ad81effe0569f45562f56a1de7c 100644 (file)
@@ -67,6 +67,7 @@ namespace BL
 
       void reset_job_selection();
 
+      void saveIfNeeded();
 
     public slots:
       void create_job();
index 0bd4106a1a2618ed8e8b8484ff48551be36e623e..f2cdbe82e8ae988dafaf5bb6e0710a1da0d8ccd5 100644 (file)
@@ -54,6 +54,7 @@ BL::SalomeGui::studyClosed()
 {
   if (_gengui)
   {
+    _gengui->saveIfNeeded();
     _gengui->deleteDockWidget();
     delete _gengui;
     _gengui = NULL;