From f2ec3520cf4530066bf9d780cf54a29945b4c7e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9?= Date: Wed, 28 Apr 2010 18:28:51 +0200 Subject: [PATCH] Tout ok sauf la gestion de la duplication... --- .../daGUI/daEficasWrapper/datassimEficasWrapper.py | 12 ++++++++---- .../daGUI/daEficasWrapper/eficasWrapper.py.in | 4 +--- src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py | 13 +++++++------ src/daSalome/daGUI/daGuiImpl/studyedit.py | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/daSalome/daGUI/daEficasWrapper/datassimEficasWrapper.py b/src/daSalome/daGUI/daEficasWrapper/datassimEficasWrapper.py index 8b83a7c..9f27c15 100644 --- a/src/daSalome/daGUI/daEficasWrapper/datassimEficasWrapper.py +++ b/src/daSalome/daGUI/daEficasWrapper/datassimEficasWrapper.py @@ -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 + diff --git a/src/daSalome/daGUI/daEficasWrapper/eficasWrapper.py.in b/src/daSalome/daGUI/daEficasWrapper/eficasWrapper.py.in index c680e4e..3b62d74 100644 --- a/src/daSalome/daGUI/daEficasWrapper/eficasWrapper.py.in +++ b/src/daSalome/daGUI/daEficasWrapper/eficasWrapper.py.in @@ -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 diff --git a/src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py b/src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py index 744b168..e6c9ccf 100644 --- a/src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py +++ b/src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py @@ -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 !" diff --git a/src/daSalome/daGUI/daGuiImpl/studyedit.py b/src/daSalome/daGUI/daGuiImpl/studyedit.py index f513b14..074a106 100644 --- a/src/daSalome/daGUI/daGuiImpl/studyedit.py +++ b/src/daSalome/daGUI/daGuiImpl/studyedit.py @@ -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)) -- 2.39.2