Salome HOME
Merge remote branch 'origin/V7_dev' into V8_0_0_BR
[modules/smesh.git] / src / Tools / MGCleanerPlug / MGCleanerMonViewText.py
index 698bb7ad21ffb3e6ab4f7c40893c62685c4db26e..81a2c26a825038d139a3e0900b521ebda0d58d52 100644 (file)
@@ -1,10 +1,10 @@
 # -*- coding: utf-8 -*-
-# Copyright (C) 2007-2013  EDF R&D
+# Copyright (C) 2013-2015  EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 import string,types,os
 import traceback
 
-from PyQt4 import *
-from PyQt4.QtGui import *
-from PyQt4.QtCore import *
+from qtsalome import *
 
 # Import des panels
 
-from MGCleanerViewText import Ui_ViewExe
+from MGCleanerViewText_ui import Ui_ViewExe
 
 class MGCleanerMonViewText(Ui_ViewExe, QDialog):
     """
@@ -39,35 +37,18 @@ class MGCleanerMonViewText(Ui_ViewExe, QDialog):
         self.setupUi(self)
         self.resize( QSize(1000,600).expandedTo(self.minimumSizeHint()) )
         #self.connect( self.PB_Ok,SIGNAL("clicked()"), self, SLOT("close()") )
-        self.connect( self.PB_Ok,SIGNAL("clicked()"), self.theClose )
-        self.connect( self.PB_Save,SIGNAL("clicked()"), self.saveFile )
+        self.PB_Ok.clicked.connect( self.theClose )
+        self.PB_Save.clicked.connect( self.saveFile )
         self.PB_Save.setToolTip("Save trace in log file")
         self.PB_Ok.setToolTip("Close view")
         self.monExe=QProcess(self)
 
-        self.connect(self.monExe, SIGNAL("readyReadStandardOutput()"), self.readFromStdOut )
-        self.connect(self.monExe, SIGNAL("readyReadStandardError()"), self.readFromStdErr )
+        self.monExe.readyReadStandardOutput.connect( self.readFromStdOut )
+        self.monExe.readyReadStandardError.connect( self.readFromStdErr )
       
         # Je n arrive pas a utiliser le setEnvironment du QProcess
         # fonctionne hors Salome mais pas dans Salome ???
         cmds=''
-        try :
-          LICENCE_FILE=os.environ["DISTENE_LICENCE_FILE_FOR_MGCLEANER"]
-        except:
-          LICENCE_FILE=''
-        try :
-          PATH=os.environ["DISTENE_PATH_FOR_MGCLEANER"]
-        except:
-          PATH=''
-        if LICENCE_FILE != '': 
-          cmds+='source '+LICENCE_FILE+'\n'
-        else:
-          cmds+="# $DISTENE_LICENCE_FILE_FOR_MGCLEANER NOT SET\n"
-        if PATH != '': 
-          cmds+='export PATH='+PATH+':$PATH\n'
-        else:
-          cmds+="# $DISTENE_PATH_FOR_MGCLEANER NOT SET\n"
-        #cmds+='env\n'
         cmds+='rm -f '+self.parent().fichierOut+'\n'
         cmds+=txt+'\n'
         cmds+='echo END_OF_MGCleaner\n'
@@ -100,11 +81,11 @@ class MGCleanerMonViewText(Ui_ViewExe, QDialog):
 
     def readFromStdErr(self):
         a=self.monExe.readAllStandardError()
-        self.TB_Exe.append(QString.fromUtf8(a.data(),len(a)))
+        self.TB_Exe.append(unicode(a.data()))
 
     def readFromStdOut(self) :
         a=self.monExe.readAllStandardOutput()
-        aa=QString.fromUtf8(a.data(),len(a))
+        aa=unicode(a.data())
         self.TB_Exe.append(aa)
         if "END_OF_MGCleaner" in aa:
           self.parent().enregistreResultat()