From 731851a564e2ea8558ad183a73a099e1cfe7b20c Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Mon, 14 Nov 2016 13:13:05 +0100 Subject: [PATCH] 13685 --- InterfaceQT4/gereListe.py | 5 +++-- InterfaceQT4/monSelectVal.py | 16 +++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/InterfaceQT4/gereListe.py b/InterfaceQT4/gereListe.py index 4181974c..6dd0ae1e 100644 --- a/InterfaceQT4/gereListe.py +++ b/InterfaceQT4/gereListe.py @@ -23,7 +23,7 @@ import traceback from determine import monEnvQT5 if monEnvQT5: - from PyQt5.QtWidgets import QLineEdit, QLabel + from PyQt5.QtWidgets import QLineEdit, QLabel, QFileDialog from PyQt5.QtCore import QEvent, Qt from PyQt5.QtGui import QIcon, QPalette else : @@ -254,11 +254,12 @@ class GereListe: def selectInFile(self): - init=QString( self.editor.CONFIGURATION.savedir) + init=str( self.editor.CONFIGURATION.savedir) fn = QFileDialog.getOpenFileName(self.node.appliEficas, tr("Fichier de donnees"), init, tr('Tous les Fichiers (*)',)) + if monEnvQT5 : fn=fn[0] if fn == None : return if fn == "" : return ulfile = os.path.abspath(unicode(fn)) diff --git a/InterfaceQT4/monSelectVal.py b/InterfaceQT4/monSelectVal.py index 4fc9f223..8a6a2fbe 100644 --- a/InterfaceQT4/monSelectVal.py +++ b/InterfaceQT4/monSelectVal.py @@ -21,14 +21,17 @@ # Modules Eficas from desSelectVal import Ui_DSelVal -from determine import monEnvQT5 +from Extensions.i18n import tr +from determine import monEnvQT5 if monEnvQT5: - from PyQt5.QtWidgets import QDialog - from PyQt5.QtCore import QTimer + from PyQt5.QtWidgets import QDialog, QFileDialog + from PyQt5.QtCore import QTimer, Qt + from PyQt5.QtGui import QPalette else : from PyQt4.QtGui import * from PyQt4.QtCore import * + from PyQt4.QtGui import QPalette class DSelVal(Ui_DSelVal,QDialog): def __init__(self,parent ,modal ) : @@ -73,10 +76,9 @@ class MonSelectVal(DSelVal): def messageAChanger(self): message=self.parent.editor.sb.currentMessage() mapalette=self.sb.palette() - from PyQt4.QtGui import QPalette - mapalette.setColor( QPalette.WindowText, self.parent.editor.couleur ) - self.sb.setPalette( mapalette ); - self.sb.setText(tr(message)) + mapalette.setColor( QPalette.Text,Qt.red ) + self.sb.setPalette( mapalette ) + self.sb.setText(message) QTimer.singleShot(3000, self.efface) def efface(self): -- 2.39.2