Salome HOME
PyQt5/PyQt4 support
authorrnv <rnv@opencascade.com>
Tue, 26 Jan 2016 14:59:54 +0000 (17:59 +0300)
committerrnv <rnv@opencascade.com>
Tue, 26 Jan 2016 14:59:54 +0000 (17:59 +0300)
src/ATOMGENGUI/ATOMGENGUI.py

index 91737316cbb948fe3b66ad7cc25e895e1efff046..c53953b3c668b93126556c2e888f2b6446bcad3e 100644 (file)
@@ -17,8 +17,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from PyQt4.QtGui import *
-from PyQt4.QtCore import *
+from qtsalome import *
 
 from omniORB import CORBA
 from SALOME_NamingServicePy import *
@@ -198,7 +197,7 @@ def activate():
     # connect selection
     selection = __study_data_map__[ studyId ][ "selection" ]
     selection.ClearIObjects()
-    QObject.connect( selection, SIGNAL( "currentSelectionChanged()" ), selectionChanged )
+    Connect( selection, "currentSelectionChanged()", selectionChanged ) 
     global myRunDlg
     if myRunDlg:
         myRunDlg.close()
@@ -215,7 +214,7 @@ def deactivate():
     studyId = myStudy._get_StudyId()
     selection = __study_data_map__[ studyId ][ "selection" ]
     selection.ClearIObjects()
-    QObject.disconnect( selection, SIGNAL( "currentSelectionChanged()" ), selectionChanged )
+    Disconnect( selection, "currentSelectionChanged()", selectionChanged )
     global myRunDlg
     if myRunDlg:
         myRunDlg.close()
@@ -305,9 +304,9 @@ class RunDlg(QDialog, Ui_RunDlg):
 
         selection = __study_data_map__[ myStudy._get_StudyId() ][ "selection" ]
         if not self.allCheck.isChecked():
-            QObject.connect( selection, SIGNAL( "currentSelectionChanged()" ), self.selectionChanged )
+            Connect( selection, "currentSelectionChanged()", self, "selectionChanged()" )
         else:
-            QObject.disconnect( selection, SIGNAL( "currentSelectionChanged()" ), self.selectionChanged )
+            Disconnect( selection, "currentSelectionChanged()", self, "selectionChanged()" )
         pass
 
     def selectionChanged(self):
@@ -388,14 +387,16 @@ def onImportXml():
     Import XML file action slot
     """
     print "--> onImportXml() is started"
-    filters = QStringList()
+    filters = []
     filters.append( tr( "XML_FILES" ) )
     fileName = sgPyQt.getFileName( sgPyQt.getDesktop(),
                                    "",
                                    filters,
                                    tr( "IMPORT_XML" ),
                                    True )
-    if not fileName.isEmpty():
+    fileName = unicode(fileName)
+
+    if len(fileName) > 0 :
         if not _getEngine().importXmlFile( str( fileName ) ):
             warning( "IMPORT_ERROR" )
         else:
@@ -408,14 +409,16 @@ def onExportXml():
     Export XML file action slot
     """
     print "--> onExportXml() is started"
-    filters = QStringList()
+    filters = []
     filters.append( tr( "XML_FILES" ) )
     fileName = sgPyQt.getFileName( sgPyQt.getDesktop(),
                                    "",
                                    filters,
                                    tr( "EXPORT_XML" ),
                                    False )
-    if not fileName.isEmpty():
+    fileName = unicode(fileName)
+
+    if len(fileName) > 0 :
         if not _getEngine().exportXmlFile( str( fileName ) ):
             warning( "EXPORT_ERROR" )
     print "--> onExportXml() is finished"