self.removeCallbackId(callbackId)
self.setCallbackId(callbackId)
- def fileSave(self):
- """
- @overload
- """
- qtEficas.Appli.fileSave(self)
- index = self.viewmanager.myQtab.currentIndex()
- if index > -1 :
- self.notifyObserver(EficasEvent.EVENT_TYPES.SAVE)
+ def adaoFileSave(self, adao_case):
+
+ ok = qtEficas.Appli.fileSave(self)
+ if ok:
+ index = self.viewmanager.myQtab.currentIndex()
+ adao_case.name = str(self.viewmanager.myQtab.tabText(index)) # Utilisation de str() pour passer d'un Qstring à un string
+ adao_case.eficas_editor = self.viewmanager.dict_editors[index]
+ adao_case.filename = str(self.viewmanager.dict_editors[index].fichier)
+ self.notifyObserver(EficasEvent.EVENT_TYPES.SAVE, callbackId=adao_case)
def fileSaveAs(self):
"""
toolbar button). The actionId value is the ID associated to the item.
"""
pass
- print "OnGUIEvent", actionId
ctx = _setContext( sgPyQt.getStudyId() )
ctx.adaoCaseManager.processGUIEvent(actionId)
# Ajout du cas
self.cases[adao_case.name] = adao_case
+ # Sauvegarde d'un cas
+ # 1: la fonction saveAdaoCase est appelée par le GUI SALOME
+ # 2: la fonction _processEficasSaveEvent est appelée par le manager EFICAS
+ def saveAdaoCase(self):
+ adaoLogger.debug("Sauvegarde du cas s'il y a modification")
+ salomeStudyItem = adaoGuiHelper.getSelectedItem()
+ for case_name, adao_case in self.cases.iteritems():
+ if adao_case.salome_study_item.GetID() == salomeStudyItem.GetID():
+ self.eficas_manager.adaoFileSave(adao_case)
+ break
-
-
-
-
-
-
-
+ def _processEficasSaveEvent(self, eficasWrapper, eficasEvent):
+ adao_case = eficasEvent.callbackId
+ # On met à jour l'étude
+ adaoStudyEditor.updateItem(adao_case.salome_study_id, adao_case.salome_study_item, adao_case)
+ # Affichage correct dans l'étude
+ adaoGuiHelper.refreshObjectBrowser()
+ adaoGuiHelper.selectItem(adao_case.salome_study_item.GetID())
+ # Ajout du cas
+ self.cases[adao_case.name] = adao_case
# Gestion des évènements venant du manager Eficas
__processOptions={
studyEditor = studyedit.getStudyEditor(salomeStudyId)
- if salomeStudyItem.GetName()[:-2] != adaoCase.get_name():
- itemName = adaoCase.get_name()
- itemValue = adaoCase.get_filename()
+ if salomeStudyItem.GetName()[:-2] != adaoCase.name:
+ itemName = adaoCase.name
+ itemValue = adaoCase.filename
else:
itemName = salomeStudyItem.GetName()
itemValue = adaoCase.get_filename()