self.tree.node_selected= self
if self.editor.first :
- self.editor.splitter.setSizes((400,1400,400))
+ #self.editor.splitter.setSizes((400,1400,400))
if not(isinstance(self.fenetre,MonChoixCommande)): self.editor.first=False
self.tree.inhibeExpand=True
self.tree.expandItem(self)
def update_node_texte(self):
""" Met a jour les noms des SD et valeurs des mots-cles """
- print "kkkkkkkkkkkk"
- print self.item.GetText()
value = self.item.GetText()
self.setText(1, value)
from determine import monEnvQT5
if monEnvQT5:
- from PyQt5.QtWidgets import QWidget, QMessageBox, QFileDialog, QApplication
+ from PyQt5.QtWidgets import QWidget, QMessageBox, QFileDialog, QApplication, QSplitter
from PyQt5.QtGui import QPalette
from PyQt5.QtCore import QProcess, QFileInfo, QTimer, Qt, QDir, QSize
else :
DictExtensions= {"MAP" : ".map"}
+
class JDCEditor(Ui_baseWidget,QWidget):
#----------------------------------------------------------------------------------------------------------#
QWidget.__init__(self,None)
+ self.i=0
self.setupUi(self)
+ self.inhibeSplitter=0
self.widgetOptionnel=None
self.fenetreCentraleAffichee=None
self.dejaDansPlieTout=False
self.widgetTree=None
self.appliEficas.resize(1440,self.appliEficas.height())
else :
- self.appliEficas.resize(2000,self.appliEficas.height())
+ self.appliEficas.resize(1800,self.appliEficas.height())
self.version_code = session.d_env.cata
self.format = self.appliEficas.format_fichier
self.dict_reels={}
+ self.splitterSizes = [320,1320,320]
+ self.oldSizeWidgetOptionnel = 320
self.liste_simp_reel=[]
self.ihm="QT"
if jdc_item:
self.tree = browser.JDCTree( jdc_item, self )
self.appliEficas.construitMenu()
- self.splitterSizes = []
-
+ self.saveSplitterSizes()
+ #if monEnvQT5:
+ # self.splitter./s
+ #else :
#-------------------# Pour execution avec output et error dans le bash
if (self.QWParent.edit != "couper"):
try:
if noeudOuColler == self.tree.racine :
- print 1
child=noeudOuColler.doPastePremier(noeudACopier)
else :
- print 2
child=noeudACopier.doPaste(noeudOuColler,pos)
if child==None or child==0:
QMessageBox.critical( self,tr( "Copie refusee"),tr('Eficas n a pas reussi a copier l objet'))
self.nomMaillage="A_partir_de_SMESH"
self.openfile.close()
- #-----------------------------
- def saveSplitterSizes(self):
- #----------------------------
- if self.splitter != None : self.splitterSizes = self.splitter.sizes()
-
- #-----------------------------
- def restoreSplitterSizes(self):
- #----------------------------
- if hasattr(self,'splitterSizes') :
- lenSizes = len(self.splitterSizes)
- if lenSizes > 0 :
- if self.splitter != None and self.splitter.count() >= lenSizes :
- newSizes = self.splitter.sizes()
- newSizes[:len(self.splitterSizes)-1] = self.splitterSizes[:len(self.splitterSizes)-1]
- newSizes[len(newSizes)-1] = self.splitterSizes[len(self.splitterSizes)-1]
- self.splitter.setSizes(newSizes)
-
- #-----------------------------
- def restoreTailleTree(self):
- #----------------------------
- if hasattr(self,'splitterSizes') and self.splitterSizes != [] :
- nbFenetre=len(self.splitter.sizes())
- if nbFenetre == len(self.splitterSizes) :
- self.splitter.setSizes(self.splitterSizes)
- return
-
- if self.widgetOptionnel==None:
- print "kkkkkkkkkkkkkk"
- #
- #PN
+ #-------------------------------------
+ def saveSplitterSizes(self,event=None):
+ #------------------------------------
+ if self.inhibeSplitter : return
+ if not hasattr(self,'splitter') : return
+ print "______________________"
+ print "saveSplitterSizes"
+ print self.splitterSizes
+ if self.splitterSizes[2] != 0 : self.oldSizeWidgetOptionnel = self.splitterSizes[2]
+ for i in range(len(self.splitter.sizes())):
+ self.splitterSizes[i] = self.splitter.sizes()[i]
+ self.splitter.widget(i).resizeEvent=self.saveSplitterSizes
+ print self.splitterSizes
+ print "______________________"
+
+
+ #-----------------------------------------
+ def restoreSplitterSizes(self,nbWigdet=3):
+ #----------------------------------------
+ self.inhibeSplitter = 1
+ self.i+=1
+ if not(hasattr(self,'splitter')) : return
+ newSizes=self.splitterSizes[:nbWigdet]
+ self.splitter.setSizes(newSizes)
+ print self.splitterSizes
+ self.inhibeSplitter = 0
+
+ #------------------------
+ def fermeOptionnel(self):
+ #------------------------
+ if self.widgetOptionnel == None : return
+
+ self.inhibeSplitter=1
+ self.splitterSizes[1] = self.splitterSizes[1] + self.splitterSizes[2]
+ if self.splitterSizes[2]!=0 : self.oldSizeWidgetOptionnel = self.splitterSizes[2]
+ self.splitterSizes[2]=0
+
+ self.widgetOptionnel.setParent(None)
+ self.widgetOptionnel.close()
+ self.widgetOptionnel.deleteLater()
+ self.widgetOptionnel=None
+ self.inhibeSplitter=0
+ self.restoreSplitterSizes(2)
+
+ #------------------------
+ def ajoutOptionnel(self):
+ #------------------------
+ #print "ajoutOptionnel"
+ #print self.splitterSizes
+ self.splitterSizes[2] = self.oldSizeWidgetOptionnel
+ self.splitterSizes[1] = self.splitterSizes[1] - self.splitterSizes[2]
+ self.inhibeSplitter=0
+ self.restoreSplitterSizes(3)
#-----------------------------
import re
from determine import monEnvQT5
if monEnvQT5:
- from PyQt5.QtWidgets import QToolButton
+ from PyQt5.QtWidgets import QToolButton, QToolTip
else :
from PyQt4.QtGui import *
from PyQt4.QtCore import *
def mousePressEvent(self, event):
#print "dans mousePressEvent"
if self.parent.node.item.object.isvalid() :
- myToolTip=QString(tr("objet valide"))
+ myToolTip=tr("objet valide")
QToolTip.showText(event.globalPos(),myToolTip )
else :
t=""
t=l
else :
t=t+'\n'+l
- myToolTip=QString(t)
+ myToolTip=tr(t)
QToolTip.showText(event.globalPos(),myToolTip )
self.listeAffichageWidget=[]
self.inhibe=0
self.ensure=0
+ editor.inhibeSplitter=1
Groupe.__init__(self,node,editor,None,etape.definition,etape,1,self)
+ editor.inhibeSplitter=0
if node.item.get_fr() != "" : self.labelDoc.setText(node.item.get_fr())
else : self.labelDoc.close()
if self.editor.code == "CARMELCND" :
self.RBPoubelle.close() # JDC Fige
return # Pas de MC Optionnels pour Carmel
+
from monWidgetOptionnel import MonWidgetOptionnel
- #if hasattr(self.editor,'widgetOptionnel') :
if self.editor.widgetOptionnel!= None :
self.monOptionnel=self.editor.widgetOptionnel
- self.editor.restoreSplitterSizes()
else :
self.monOptionnel=MonWidgetOptionnel(self)
self.editor.widgetOptionnel=self.monOptionnel
+ self.editor.inhibeSplitter=1
self.editor.splitter.addWidget(self.monOptionnel)
- #self.editor.restoreSplitterSizes()
+ self.editor.inhibeSplitter=0
+ self.editor.ajoutOptionnel()
self.afficheOptionnel()
- #print "fin init de widget Commande"
+
+ self.editor.restoreSplitterSizes()
+ print "fin init de widget Commande"
def donnePremier(self):
else :
self.connect(self.bAvant,SIGNAL("clicked()"), self.afficheAvant)
self.connect(self.bApres,SIGNAL("clicked()"), self.afficheApres)
+ self.editor.fermeOptionnel()
+
def afficheApres(self):
self.node.selectApres()
self.racine=self.node.tree.racine
self.monOptionnel=None
- #self.editor.restoreSplitterSizes()
+ self.editor.fermeOptionnel()
#print "fin init de widget Commande"
"""
"""
def __init__(self,parentQt):
- #print "dans init de monWidgetOptionnel ", parentQt, parentQt.node.item.nom
+ print "dans init de monWidgetOptionnel ", parentQt, parentQt.node.item.nom
QWidget.__init__(self,None)
self.setupUi(self)
self.dicoCb={}
self.cb=None
self.parentQt=parentQt
#self.connect(self.bAjoutMC,SIGNAL("clicked()"), self.ajoutMC)
- #print "fin init de monWidgetOptionnel ", parentQt, parentQt.node.item.nom
-
-
-
+ #self.parentQt.editor.splitterSizes[1]-=self.parentQt.editor.splitterSizes[2]
+ #print self.parentQt.editor.splitterSizes
+ self.parentQt.editor.splitterSizes[2]=self.parentQt.editor.oldSizeWidgetOptionnel
+ if self.parentQt.editor.splitterSizes[2] == 0 : self.parentQt.editor.splitterSizes[2] = 400
+ self.parentQt.editor.restoreSplitterSizes()
+ print "fin init de monWidgetOptionnel ", parentQt, parentQt.node.item.nom
+
def affiche(self,liste):
print "dans Optionnel ____ affiche", liste
#print "dans Optionnel __ ajout de ", maListe
self.parentMC.ajoutMC(maListe)
- def hide(self):
- self.parentQt.editor.saveSplitterSizes()
- QWidget.hide(self)
from gereIcones import FacultatifOuOptionnel
from determine import monEnvQT5
if monEnvQT5:
- from PyQt5.QtWidgets import QWidget
+ from PyQt5.QtWidgets import QWidget, QMessageBox
else :
from PyQt4.QtGui import *
from PyQt4.QtCore import *
self.connect(self.bVerifie,SIGNAL("clicked()"), self.verifiePressed)
self.editor.affiche_infos("")
-
- if self.editor.widgetOptionnel!= None :
- self.editor.widgetOptionnel.close()
- self.editor.widgetOptionnel=None
-
-
+ self.editor.fermeOptionnel()
def afficheCatalogue(self):
localisation.localise(app,langue)
self.setupUi(self)
+ if self.code in ['MAP',] : self.resize(1440,self.height())
+ else : self.resize(1800,self.height())
icon = QIcon(self.repIcon+"/parametres.png")
self.actionParametres.setIcon(icon)
if fn is None: fn = tr('Noname')
if monEnvQT5 :
msgBox = QMessageBox(None)
- msgBox.setWindowTitle(tr("Fichier Duplique"))
+ msgBox.setWindowTitle(tr("Fichier Modifie"))
msgBox.setText(tr("Le fichier ne sera pas sauvegarde."))
- msgBox.addButton(texte,0)
- msgBox.addButton(tr("&Annuler"),1)
+ msgBox.addButton(tr("&Sauvegarder"),1)
+ msgBox.addButton(tr("&Quitter sans sauvegarder"),0)
res=msgBox.exec_()
else :
res = QMessageBox.warning(self.appliEficas,
tr("Le fichier %s n a pas ete sauvegarde.",str(fn)),
tr("&Sauvegarder"),
tr(texte),
- tr("&Annuler") )
+ tr("&Quitter sans sauvegarder") )
if res == 0:
(ok, newName) = editor.saveFile()
if ok:
<property name="styleSheet">
<string notr="true"/>
</property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <property name="spacing">
- <number>3</number>
- </property>
+ <layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>0</number>
</property>
- <item>
+ <item row="0" column="0">
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
+ <property name="handleWidth">
+ <number>3</number>
+ </property>
<widget class="QWidget" name="widgetTree" native="true">
<property name="styleSheet">
<string notr="true">background:rgb(247,247,247);
</widget>
</widget>
</item>
- <item>
+ <item row="1" column="0">
<widget class="QLabel" name="labelCommentaire">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<height>518</height>
</rect>
</property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
<property name="spacing">
<number>0</number>
</property>
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
<property name="topMargin">
<number>0</number>
</property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
<property name="bottomMargin">
<number>0</number>
</property>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
<item>
<layout class="QVBoxLayout" name="commandesLayout">
<property name="spacing">
</layout>
<zorder>scrollAreaCommandes</zorder>
<zorder>frameAffichage</zorder>
- <zorder></zorder>
- <zorder>frame_2</zorder>
- <zorder>frame_2</zorder>
- <zorder></zorder>
</widget>
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
font : 'times' 9px</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
<item>
<widget class="QFrame" name="frame_2">
<property name="sizePolicy">
<property name="spacing">
<number>0</number>
</property>
- <property name="margin">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
<number>0</number>
</property>
<item>
<x>0</x>
<y>0</y>
<width>279</width>
- <height>124</height>
+ <height>131</height>
</rect>
</property>
<property name="sizePolicy">
<property name="styleSheet">
<string notr="true">QComboBox{combobox-popup:0;}</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <property name="spacing">
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="leftMargin">
<number>0</number>
</property>
- <property name="margin">
+ <property name="topMargin">
<number>0</number>
</property>
- <item>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
<widget class="QFrame" name="frameEntete">
<property name="minimumSize">
<size>
</property>
</widget>
</item>
- <item>
+ <item row="1" column="0">
<widget class="QTabWidget" name="myQtab">
<property name="styleSheet">
<string notr="true">background-color:rgb(224,223,222)</string>
<x>0</x>
<y>0</y>
<width>1676</width>
- <height>30</height>
+ <height>25</height>
</rect>
</property>
<widget class="QMenu" name="menuFichier">
<action name="action_Nouveau">
<property name="icon">
<iconset theme="document-new">
- <normaloff/>
- </iconset>
+ <normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>&Nouveau</string>
<action name="actionOuvrir">
<property name="icon">
<iconset theme="document-open">
- <normaloff/>
- </iconset>
+ <normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>&Ouvrir</string>
<action name="actionEnregistrer">
<property name="icon">
<iconset theme="document-save">
- <normaloff/>
- </iconset>
+ <normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Enregistrer</string>
<action name="actionEnregistrer_sous">
<property name="icon">
<iconset theme="document-save-as">
- <normaloff/>
- </iconset>
+ <normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Enregistrer sous</string>
<action name="actionCouper">
<property name="icon">
<iconset theme="edit-cut">
- <normaloff/>
- </iconset>
+ <normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Couper</string>
<action name="actionCopier">
<property name="icon">
<iconset theme="edit-copy">
- <normaloff/>
- </iconset>
+ <normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Copier</string>
<action name="actionColler">
<property name="icon">
<iconset theme="edit-paste">
- <normaloff/>
- </iconset>
+ <normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Coller</string>
<action name="actionSupprimer">
<property name="icon">
<iconset theme="edit-delete">
- <normaloff/>
- </iconset>
+ <normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Supprimer</string>
<action name="actionRechercher">
<property name="icon">
<iconset theme="edit-find">
- <normaloff/>
- </iconset>
+ <normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Rechercher</string>