X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2Fpadder%2Fspadderpy%2Fgui%2Finputdialog.py;h=376a90039291f4cfd258687f099285b9b8a7c4db;hp=6920b43d5c8b77fc7faf1a74881c9416dcb010b8;hb=a17b36970bc61da1d664453c615754997c925b18;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce diff --git a/src/Tools/padder/spadderpy/gui/inputdialog.py b/src/Tools/padder/spadderpy/gui/inputdialog.py index 6920b43d5..376a90039 100644 --- a/src/Tools/padder/spadderpy/gui/inputdialog.py +++ b/src/Tools/padder/spadderpy/gui/inputdialog.py @@ -1,10 +1,10 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2011-2013 EDF R&D +# Copyright (C) 2011-2016 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 @@ -30,8 +30,7 @@ from salome.smesh.smeshstudytools import SMeshStudyTools from omniORB import CORBA -from PyQt4.QtCore import QObject, SIGNAL, SLOT -from PyQt4.QtGui import QIcon, QStandardItemModel, QStandardItem, QMessageBox +from qtsalome import QIcon, QStandardItemModel, QStandardItem, QMessageBox, pyqtSignal from inputframe_ui import Ui_InputFrame from inputdata import InputData @@ -42,6 +41,8 @@ GROUPNAME_MAXLENGTH=8 class InputDialog(GenericDialog): TBL_HEADER_LABEL=["Input Mesh", "Output group name"] + + inputValidated = pyqtSignal() def __init__(self, parent=None, name="InputDialog", modal=0): """ @@ -100,9 +101,9 @@ class InputDialog(GenericDialog): # The click on btnSmeshObject (signal clicked() emitted by the # button btnSmeshObject) is connected to the slot # onSelectSmeshObject, etc ... - self.connect(self.__ui.btnSmeshObject, SIGNAL('clicked()'), self.onSelectSmeshObject ) - self.connect(self.__ui.btnAddInput, SIGNAL('clicked()'), self.onAddInput ) - self.connect(self.__ui.btnDeleteInput, SIGNAL('clicked()'), self.onDeleteInput ) + self.__ui.btnSmeshObject.clicked.connect( self.onSelectSmeshObject ) + self.__ui.btnAddInput.clicked.connect( self.onAddInput ) + self.__ui.btnDeleteInput.clicked.connect( self.onDeleteInput ) # Set up the model of the Qt table list self.__inputModel = QStandardItemModel(0,2) @@ -148,7 +149,7 @@ class InputDialog(GenericDialog): # been validated so that it can process the event GenericDialog.accept(self) if self.wasOk(): - self.emit(SIGNAL('inputValidated()')) + self.inputValidated.emit() def onSelectSmeshObject(self): ''' @@ -188,10 +189,10 @@ class InputDialog(GenericDialog): creates a new entry in the list of input data, or updates this entry if it already exists. """ - meshName = str(self.__ui.txtSmeshObject.text().trimmed()) + meshName = str(self.__ui.txtSmeshObject.text()).strip() meshObject = self.__selectedMesh meshType = self.__ui.cmbMeshType.currentIndex() - groupName = str(self.__ui.txtGroupName.text().trimmed()) + groupName = str(self.__ui.txtGroupName.text()).strip() self.__addInputInGui(meshName, meshObject, meshType, groupName) self.__addInputInMap(meshName, meshObject, meshType, groupName) @@ -331,10 +332,9 @@ class InputDialog(GenericDialog): # def TEST_InputDialog(): import sys - from PyQt4.QtCore import QObject, SIGNAL, SLOT - from PyQt4.QtGui import QApplication + from qtsalome import QApplication app = QApplication(sys.argv) - QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()")) + app.lastWindowClosed.connect( app.quit ) dlg=InputDialog() dlg.displayAndWait() @@ -343,10 +343,9 @@ def TEST_InputDialog(): def TEST_InputDialog_setData(): import sys - from PyQt4.QtCore import QObject, SIGNAL, SLOT - from PyQt4.QtGui import QApplication + from qtsalome import QApplication app = QApplication(sys.argv) - QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()")) + app.lastWindowClosed.connect( app.quit ) dlg=InputDialog()