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)
"""
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
+
'NEW_DATASSIMCASE_ID',
'OPEN_DATASSIMCASE_ID',
'EDIT_DATASSIMCASE_POP_ID',
- 'DELETE_DATASSIMCASE_POP_ID',
+ 'REMOVE_DATASSIMCASE_POP_ID',
'YACS_EXPORT_POP_ID',
],offset=950)
# 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
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 !"
: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))