Salome HOME
Merge remote branch 'origin/V7_dev' into V8_0_0_BR
[modules/smesh.git] / src / Tools / padder / spadderpy / gui / plugindialog.py
index ab6869288a0edcfea3f88603839d865deadb8204..20ad1b8c5d6cb12901f683d1e5f901e1f2c8f47b 100644 (file)
@@ -1,10 +1,10 @@
 # -*- coding: iso-8859-1 -*-
-# Copyright (C) 2011-2013  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
@@ -50,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
 
@@ -87,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()
 
@@ -140,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)
@@ -211,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):
@@ -393,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_()