X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=InterfaceQT4%2FgereIcones.py;h=718626b3fd772f38476d5ca50385c9c12c18ed01;hb=e570dff249a11579eb7d33de376ed71be16d7261;hp=5667d4775f102f9dc92f2c0988b504bebcde6bf9;hpb=16d5922e798b1254eb558678612711d72ed38b32;p=tools%2Feficas.git diff --git a/InterfaceQT4/gereIcones.py b/InterfaceQT4/gereIcones.py index 5667d477..718626b3 100644 --- a/InterfaceQT4/gereIcones.py +++ b/InterfaceQT4/gereIcones.py @@ -38,29 +38,95 @@ class FacultatifOuOptionnel: except : pass if listeRegles==() and hasattr(self,"RBRegle"): self.RBRegle.close() - if isinstance(self,MonWidgetCommande):return - cle_doc = self.node.item.get_docu() - if cle_doc == None and hasattr(self,"RBInfo") : self.RBInfo.close() + cle_doc=None + if not hasattr(self,"RBInfo"):return + if isinstance(self,MonWidgetCommande) and self.editor.code =="MAP": + self.cle_doc = self.chercheDocMAP() + else : + self.cle_doc = self.node.item.get_docu() + if self.cle_doc == None : self.RBInfo.close() + else : self.connect (self.RBInfo,SIGNAL("clicked()"),self.viewDoc) + + def chercheDocMAP(self): + try : + clef=self.editor.CONFIGURATION.adresse+"/" + except : + return None + for k in self.editor.readercata.cata[0].JdC.dict_groupes.keys(): + if self.obj.nom in self.editor.readercata.cata[0].JdC.dict_groupes[k]: + clef+=k + break + clef+="/"+ self.obj.nom[0:-5].lower()+"/spec_"+self.obj.nom[0:-5].lower()+".html" + return clef - def setPoubelle(self): + def viewDoc(self): + try : + cmd="xdg-open "+self.cle_doc + os.system(cmd) + except: + QMessageBox.warning( self,tr( "Aide Indisponible"),tr( "l'aide n est pas installee ")) + + + def setIconePoubelle(self): if not(hasattr(self,"RBPoubelle")):return + icon1 = QtGui.QIcon() + repIcon=os.path.join(os.path.abspath(os.path.dirname(__file__)),'../Editeur/icons') if self.node.item.object.isoblig() : - icon1 = QtGui.QIcon() - icon1.addPixmap(QtGui.QPixmap("/home/A96028/Install_EficasV1/KarineEficas/Editeur/icons/deleteRondVide.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon1.addPixmap(QtGui.QPixmap(repIcon+"/deleteRondVide.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.RBPoubelle.setIcon(icon1) return + icon1.addPixmap(QtGui.QPixmap(repIcon+"/deleteRond.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.RBPoubelle.show() self.connect(self.RBPoubelle,SIGNAL("clicked()"),self.aDetruire) + def setIconesSalome(self): + if not (hasattr(self,"RBSalome")): return + from Accas import SalomeEntry + mc = self.node.item.get_definition() + mctype = mc.type[0] + enable_salome_selection = self.editor.salome and \ + (('grma' in repr(mctype)) or ('grno' in repr(mctype)) or ('SalomeEntry' in repr(mctype)) or \ + (hasattr(mctype, "enable_salome_selection") and mctype.enable_salome_selection)) + if enable_salome_selection: + self.connect(self.RBSalome,SIGNAL("pressed()"),self.BSalomePressed) + if not(('grma' in repr(mctype)) or ('grno' in repr(mctype))) or not(self.editor.salome): self.BView2D.close() + else : self.connect(self.RBSalomeVue,SIGNAL("clicked()"),self.BView2DPressed) + else: + self.RBSalome.close() + self.RBSalomeVue.close() + + + def setIconesFichier(self): + if not ( hasattr(self,"BFichier")): return + mc = self.node.item.get_definition() + mctype = mc.type[0] + if mctype == "Repertoire": + self.BRepertoire=self.BFichier + self.connect(self.BRepertoire,SIGNAL("clicked()"),self.BRepertoirePressed) + self.BVisuFichier.close() + else : + self.connect(self.BFichier,SIGNAL("clicked()"),self.BFichierPressed) + self.connect(self.BVisuFichier,SIGNAL("clicked()"),self.BFichierVisu) + + + + + def setRun(self): + if hasattr(self.editor.appliEficas, 'mesScripts'): + if self.tree.currentItem().item.get_nom() in self.appliEficas.mesScripts.dict_commandes.keys() : + print 'il faut programmer le self.ajoutScript()' + print '#PNPNPNPN' + return + if hasattr(self,"RBRun"): self.RBRun.close() + + def aDetruire(self): self.node.delete() - # Cas du mono-commande - if self.parentQt == None : self.afficheCatalogue() - else : self.parentQt.reaffiche() def setValide(self): + #print " c est le moment de gerer le passage au suivant" if not(hasattr (self,'RBValide')) : return icon = QIcon() if self.node.item.object.isvalid() : @@ -69,6 +135,18 @@ class FacultatifOuOptionnel: icon=QIcon(self.repIcon+"/ast-red-ball.png") self.RBValide.setIcon(icon) + # il faut chercher la bonne fenetre + def rendVisible(self): + print "je passe par rendVisible de FacultatifOuOptionnel" + print self + print self.node.fenetre + print "return pour etre sure" + return + #PNPN + newNode=self.node.treeParent.chercheNoeudCorrespondant(self.node.item.object) + print newNode + self.editor.fenetreCentraleAffichee.scrollAreaCommandes.ensureWidgetVisible(newNode.fenetre) + #newNode.fenetre.setFocus() class ContientIcones: