X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2Fpadder%2Fspadderpy%2Fgui%2Fplugindialog.py;h=20ad1b8c5d6cb12901f683d1e5f901e1f2c8f47b;hp=a8164a38e21cd43fbd7c5c4124e780dba8e64c79;hb=eb75a450cceabb83064e079ca4f907bde33b38de;hpb=1c3d4eccd17b112559ad4870a2a55a85f6a36b36 diff --git a/src/Tools/padder/spadderpy/gui/plugindialog.py b/src/Tools/padder/spadderpy/gui/plugindialog.py index a8164a38e..20ad1b8c5 100644 --- a/src/Tools/padder/spadderpy/gui/plugindialog.py +++ b/src/Tools/padder/spadderpy/gui/plugindialog.py @@ -1,10 +1,10 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2011-2012 EDF R&D +# Copyright (C) 2011-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 @@ -20,8 +20,7 @@ # Author : Guillaume Boulant (EDF) # -from PyQt4.QtGui import QDialog, QIcon -from PyQt4.QtCore import QObject, SIGNAL, SLOT, Qt +from qtsalome import QDialog, QIcon, Qt from plugindialog_ui import Ui_PluginDialog from inputdialog import InputDialog @@ -37,7 +36,8 @@ from salome.kernel.uiexception import AdminException from omniORB import CORBA import SMESH -import smesh +from salome.smesh import smeshBuilder +smesh = smeshBuilder.New(salome.myStudy) import MESHJOB gui_states = ["CAN_SELECT", "CAN_COMPUTE", "CAN_REFRESH", "CAN_PUBLISH"] @@ -49,7 +49,7 @@ all_states = run_states+end_states; # The SALOME launcher resource is specified by its name as defined in # the file CatalogResources.xml (see root directory of the # application). We could have a check box in the dialog to specify -# wether we want a local execution or a remote one. +# whether we want a local execution or a remote one. resource_name = "localhost" from salome.smesh.spadder.configreader import ConfigReader @@ -86,11 +86,11 @@ class PluginDialog(QDialog): self.__ui.btnClear.setIcon(icon) # Then, we can connect the slot to there associated button event - self.connect(self.__ui.btnInput, SIGNAL('clicked()'), self.onInput ) - self.connect(self.__ui.btnCompute, SIGNAL('clicked()'), self.onCompute ) - self.connect(self.__ui.btnRefresh, SIGNAL('clicked()'), self.onRefresh ) - self.connect(self.__ui.btnPublish, SIGNAL('clicked()'), self.onPublish ) - self.connect(self.__ui.btnClear, SIGNAL('clicked()'), self.onClear ) + self.__ui.btnInput.clicked.connect( self.onInput ) + self.__ui.btnCompute.clicked.connect( self.onCompute ) + self.__ui.btnRefresh.clicked.connect( self.onRefresh ) + self.__ui.btnPublish.clicked.connect( self.onPublish ) + self.__ui.btnClear.clicked.connect( self.onClear ) self.clear() @@ -139,7 +139,7 @@ class PluginDialog(QDialog): self.__inputDialog.windowFlags() | Qt.WindowStaysOnTopHint) # The signal inputValidated emited from inputDialog is # connected to the slot function onProcessInput: - self.connect(self.__inputDialog, SIGNAL('inputValidated()'), self.onProcessInput) + self.__inputDialog.inputValidated.connect( self.onProcessInput ) else: self.__ui.frameInput.setVisible(True) @@ -210,7 +210,7 @@ class PluginDialog(QDialog): name. This returns the filename. ''' filename=str("/tmp/padder_inputfile_"+meshName+".med") - meshObject.ExportToMEDX( filename, 0, SMESH.MED_V2_2, 1 ) + meshObject.ExportToMEDX( filename, 0, SMESH.MED_V2_2, 1, 1 ) return filename def clear(self): @@ -392,10 +392,9 @@ def getDialog(): # def TEST_PluginDialog(): import sys - from PyQt4.QtGui import QApplication - from PyQt4.QtCore import QObject, SIGNAL, SLOT + from qtsalome import QApplication app = QApplication(sys.argv) - QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()")) + app.lastWindowClosed.connect( app.quit ) dlg=PluginDialog() dlg.exec_()