]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Tout ok sauf la gestion de la duplication...
authorAndré <andre.ribes@edf.fr>
Wed, 28 Apr 2010 16:28:51 +0000 (18:28 +0200)
committerAndré <andre.ribes@edf.fr>
Wed, 28 Apr 2010 16:28:51 +0000 (18:28 +0200)
src/daSalome/daGUI/daEficasWrapper/datassimEficasWrapper.py
src/daSalome/daGUI/daEficasWrapper/eficasWrapper.py.in
src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py
src/daSalome/daGUI/daGuiImpl/studyedit.py

index 8b83a7c52070111aca7b866f7f3111bf54196432..9f27c153a14677abfe1e91ab674d1ee78044e4ab 100644 (file)
@@ -82,9 +82,9 @@ class DatassimEficasWrapper(EficasWrapper):
       if self.__close_editor is None:
         index = self.viewmanager.myQtab.currentIndex()
         editor = self.viewmanager.dict_editors[index]
-        return str(editor.fichier)
+        return editor.fichier
       else:
-        return str(self.__close_editor.fichier)
+        return self.__close_editor.fichier
 
     def Openfile(self, filename):
       self.viewmanager.handleOpen(fichier=filename)
@@ -140,5 +140,9 @@ class DatassimEficasWrapper(EficasWrapper):
       """
       while len(self.viewmanager.dict_editors) > 0:
         self.viewmanager.myQtab.setCurrentIndex(0)
-        res = self.fileClose()
-        if res==2 : return res   # l utilsateur a annule
+        if self.viewmanager.myQtab.currentIndex() == 0:
+          res = self.fileClose()
+          if res==2 : return res   # l utilsateur a annule
+        else:
+          return 0
+
index c680e4e347c91f42c17c74f4607cc39a7d4a486e..3b62d7452a059a523b95bfe81d63e6a398938d7b 100644 (file)
@@ -203,11 +203,9 @@ class EficasWrapper(qtEficas.Appli):
         eficas after a first close operation inside SALOME.
         @overload
         """
-        logger.debug("#### Handle closeEvent")
-
         # Get the data and notify the observers of the event
         # _TODO_ get data
-        self.notifyObserver(EficasEvent.EVENT_TYPES.CLOSE)
+        #self.notifyObserver(EficasEvent.EVENT_TYPES.CLOSE)
         self.fileCloseAll()
 
         # This is to prevent from bug when reopen eficas after a first close
index 744b168b1b43ddc239d899ceb6d40cbf64f2ec8d..e6c9ccf88c3286f21c35ca8ece10a7598459e8a2 100644 (file)
@@ -51,7 +51,7 @@ UI_ELT_IDS = Enumerate([
         'NEW_DATASSIMCASE_ID',
         'OPEN_DATASSIMCASE_ID',
         'EDIT_DATASSIMCASE_POP_ID',
-        'DELETE_DATASSIMCASE_POP_ID',
+        'REMOVE_DATASSIMCASE_POP_ID',
         'YACS_EXPORT_POP_ID',
         ],offset=950)
 
@@ -88,13 +88,13 @@ class DatassimGuiUiComponentBuilder:
 
         # the following action are used in context popup
         a = sgPyQt.createAction( UI_ELT_IDS.EDIT_DATASSIMCASE_POP_ID, "Edit case", "Edit case", "Edit the selected study case", "" )
-        a = sgPyQt.createAction( UI_ELT_IDS.DELETE_DATASSIMCASE_POP_ID, "Delete case", "Delete case", "Delete the selected study case", "" )
+        a = sgPyQt.createAction( UI_ELT_IDS.REMOVE_DATASSIMCASE_POP_ID, "Remove case", "Remove case", "Remove the selected study case", "" )
         a = sgPyQt.createAction( UI_ELT_IDS.YACS_EXPORT_POP_ID, "Export to YACS", "Export to YACS", "Generate a YACS graph executing this case", "" )
 
     def createPopupMenuOnItem(self,popup,salomeSudyId, item):
         if datassimStudyEditor.isValidDatassimCaseItem(salomeSudyId, item):
           popup.addAction( sgPyQt.action( UI_ELT_IDS.EDIT_DATASSIMCASE_POP_ID ) )
-          popup.addAction( sgPyQt.action( UI_ELT_IDS.DELETE_DATASSIMCASE_POP_ID ) )
+          popup.addAction( sgPyQt.action( UI_ELT_IDS.REMOVE_DATASSIMCASE_POP_ID ) )
           popup.addAction( sgPyQt.action( UI_ELT_IDS.YACS_EXPORT_POP_ID ) )
 
         return popup
@@ -163,9 +163,10 @@ class DatassimGuiActionImpl(EficasObserver):
       case_key = (salomeStudyId, salomeStudyItem.GetName())
       try:
         case = __cases__[case_key]
-        self.__dlgEficasWrapper.Openfile(case.get_filename())
-        callbackId = [salomeStudyId, salomeStudyItem]
-        self.__dlgEficasWrapper.setCallbackId(callbackId)
+        if case.get_filename() is not None and case.get_name() != "new_case":
+          self.__dlgEficasWrapper.Openfile(case.get_filename())
+          callbackId = [salomeStudyId, salomeStudyItem]
+          self.__dlgEficasWrapper.setCallbackId(callbackId)
         self.__dlgEficasWrapper.show()
       except:
         print "Oups - cannot edit case !"
index f513b14920035319f03271dba78bc589e3deefdc..074a1065f028193355b9a172d31fe6a6fbe7d6d6 100644 (file)
@@ -296,7 +296,7 @@ class StudyEditor:
         :type  typeId: integer
         :param typeId: item type (attribute 'AttributeLocalID').
         """
-        print "setItem (ID=%s): name=%s, fileType=%s, fileName=%s, comment=%s, icon=%s, IOR=%s" % (item.GetID(), name, fileType, fileName, comment, icon, IOR)
+        #print "setItem (ID=%s): name=%s, fileType=%s, fileName=%s, comment=%s, icon=%s, IOR=%s" % (item.GetID(), name, fileType, fileName, comment, icon, IOR)
         # Explicit cast is necessary for unicode to string conversion
         if name is not None:
             self.builder.SetName(item, str(name))