From 569284c5af2ea1a113e052ab2442868b04ac8a28 Mon Sep 17 00:00:00 2001 From: Pascale Noyret Date: Mon, 7 Nov 2011 10:37:53 +0000 Subject: [PATCH] bugs 2005 + 1981 --- InterfaceQT4/qtCommun.py | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/InterfaceQT4/qtCommun.py b/InterfaceQT4/qtCommun.py index 205c0f54..e142d111 100644 --- a/InterfaceQT4/qtCommun.py +++ b/InterfaceQT4/qtCommun.py @@ -113,18 +113,18 @@ class QTPanelTBW1(QTPanel): def __init__(self,node, parent = None): self.editor = parent self.node = node - self.alpha = 0 + if not(hasattr(self.node,'alpha')): self.node.alpha = 0 self.BuildLBMCPermis() self.AppelleBuildLBRegles() if hasattr(self,'BAlpha'): self.connect(self.BAlpha,SIGNAL("clicked()"),self.BAlphaPressed) def BAlphaPressed (self): - if self.alpha == 0 : - self.alpha=1 + if self.node.alpha == 0 : + self.node.alpha=1 self.BAlpha.setText("Tri Cata") else : - self.alpha=0 + self.node.alpha=0 self.BAlpha.setText("Tri Alpha") self.BuildLBMCPermis() @@ -137,12 +137,9 @@ class QTPanelTBW1(QTPanel): liste_mc=self.node.item.get_liste_mc_ordonnee(genea,jdc.cata_ordonne_dico) if ((len(liste_mc) < 10) and (hasattr(self,'BAlpha'))): self.BAlpha.hide() - if self.alpha == 1 : - liste_mc.sort() - for aMc in liste_mc: - self.LBMCPermis.addItem( aMc) - if len(liste_mc) !=0: - self.LBMCPermis.setCurrentItem(self.LBMCPermis.item(0)) + if self.node.alpha == 1 : liste_mc.sort() + for aMc in liste_mc: self.LBMCPermis.addItem( aMc) + if len(liste_mc) !=0: self.LBMCPermis.setCurrentItem(self.LBMCPermis.item(0)) def DefMC(self,item): @@ -197,12 +194,19 @@ class QTPanelTBW2(QTPanel): self.LBNouvCommande.clear() jdc=self.node.item.object.get_jdc_root() + + listeGroupes,dictGroupes=jdc.get_groups() + if "CACHE" in dictGroupes.keys(): + aExclure=dictGroupes["CACHE"] + else: + aExclure=() if self.editor.mode_nouv_commande == "alpha": self.RBalpha.setChecked(True) self.RBGroupe.setChecked(False) listeCmd = jdc.get_liste_cmd() for aCmd in listeCmd: - self.LBNouvCommande.addItem( aCmd ) + if aCmd not in aExclure : + self.LBNouvCommande.addItem( aCmd ) elif self.editor.mode_nouv_commande== "groupe" : self.RBGroupe.setChecked(True) self.RBalpha.setChecked(False) @@ -215,6 +219,7 @@ class QTPanelTBW2(QTPanel): self.LBNouvCommande.addItem( texte ) self.LBNouvCommande.addItem( " " ) for aCmd in listeCmd: + if aCmd not in aExclure : self.LBNouvCommande.addItem( aCmd) self.LBNouvCommande.addItem( " " ) elif self.editor.mode_nouv_commande== "initial" : @@ -360,9 +365,13 @@ class ViewText(Ui_dView,QDialog): def saveFile(self): #recuperation du nom du fichier + if self.editor != None : + dir=elf.editor.appliEficas.CONFIGURATION.savedir + else: + dir='/tmp' fn = QFileDialog.getSaveFileName(None, self.trUtf8("Save File"), - self.editor.appliEficas.CONFIGURATION.savedir) + dir) if fn.isNull() : return ulfile = os.path.abspath(unicode(fn)) self.editor.appliEficas.CONFIGURATION.savedir=os.path.split(ulfile)[0] -- 2.39.2