Salome HOME
linux/windows
[tools/eficas.git] / InterfaceQT4 / viewManager.py
index 7edd5b1c33889326ad1e2e28766c264fa9b78945..c393cf34cb49e420699003c37ddaf377500b6c97 100644 (file)
@@ -37,6 +37,7 @@ class MyTabview:
        self.doubles = {}
 
        self.myQtab = self.appliEficas.myQtab
+       self.myQtab.connect(self.myQtab, SIGNAL('tabCloseRequested(int)'), self.closeTab)
        if self.appliEficas.multi== True:
           self.myQtab.connect(self.myQtab,SIGNAL("currentChanged(int)"),self.indexChanged)
         
@@ -77,6 +78,9 @@ class MyTabview:
        if maPage : self.myQtab.setTabText(self.myQtab.indexOf(maPage),os.path.basename(fichier))
        return result
 
+   def closeTab(self):
+       self.handleClose()
+
    def handleClose(self,doitSauverRecent = 1,texte=tr('&Quitter')):
        if doitSauverRecent : self.appliEficas.sauveRecents()
        index=self.myQtab.currentIndex()
@@ -172,6 +176,13 @@ class MyTabview:
        if index < 0 : return
        self.dict_editors[index].viewJdcSource()
 
+   def handlegestionParam(self):
+       index=self.myQtab.currentIndex()
+       if index < 0 : 
+          QMessageBox.warning( self.appliEficas,tr(u"Creation Parametre indisponible"),tr(u"les parametres sont lies a un jeu de donnees"))
+          return
+       self.dict_editors[index].gestionParam()
+
    def handleViewJdcRapport(self):
        index=self.myQtab.currentIndex()
        if index < 0 : return
@@ -199,6 +210,24 @@ class MyTabview:
            self.myQtab.setTabText(index,fileName)
        return ok
 
+   def sauveLigneCurrentEditor(self):
+       index=self.myQtab.currentIndex()
+       if index < 0 : return
+       editor=self.dict_editors[index]
+       if editor in self.doubles.keys() :
+           QMessageBox.warning(
+                     None,
+                     tr("Fichier Duplique"),
+                     tr("Le fichier ne sera pas sauvegarde."),
+                     tr("&Annuler"))
+           return
+       ok, newName = editor.sauveLigneFile()
+       if ok :
+           fileName=os.path.basename(unicode(newName))
+           self.myQtab.setTabText(index,fileName)
+       return ok
+
+
    def saveAsCurrentEditor(self):
        index=self.myQtab.currentIndex()
        editor=self.dict_editors[index]
@@ -262,7 +291,7 @@ class MyTabview:
 #PNPNPNPN --> a affiner
         if fichier is None:
             self.untitledCount += 1
-            self.myQtab.addTab(win, tr("Fichier non encore nommé ", self.untitledCount))
+            self.myQtab.addTab(win, tr("Fichier non encore nomme ", self.untitledCount))
             #self.myQtab.addTab(win, str(self.appliEficas.code))
         else:
             liste=fichier.split('/')