-# Copyright (C) 2009-2011 EDF R&D
+# Copyright (C) 2009-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
import os
import logging
-from PyQt4 import QtCore, QtGui
+from PyQt5 import QtCore, QtGui, QtWidgets
import salome
import SALOME
"GENERICSOLVER", "def_case_name" )
pid = sgPyQt.addPreference( "Default creation mode", gid, SalomePyQt.PT_Selector,
"GENERICSOLVER", "creation_mode" )
- strings = QStringList()
+ strings = QtCore.QStringList()
strings.append( "Default name" )
strings.append( "Generate name" )
strings.append( "Ask name" )
indexes = []
- indexes.append( QVariant(0) )
- indexes.append( QVariant(1) )
- indexes.append( QVariant(2) )
- sgPyQt.setPreferenceProperty( pid, "strings", QVariant( strings ) )
- sgPyQt.setPreferenceProperty( pid, "indexes", QVariant( indexes ) )
+ indexes.append( QtCore.QVariant(0) )
+ indexes.append( QtCore.QVariant(1) )
+ indexes.append( QtCore.QVariant(2) )
+ sgPyQt.setPreferenceProperty( pid, "strings", QtCore.QVariant( strings ) )
+ sgPyQt.setPreferenceProperty( pid, "indexes", QtCore.QVariant( indexes ) )
pass
# called when module is activated
def CreateCase():
logger.debug("GENERICSOLVERGUI.CreateCase : enter")
default_case_name = str( sgPyQt.stringSetting( "GENERICSOLVER", "def_case_name",
- GUIcontext.DEFAULT_CASE_NAME ).trimmed() )
+ GUIcontext.DEFAULT_CASE_NAME ).strip() )
global __id__
try:
if sgPyQt.action( GUIcontext.OPTION_3_ID ).isChecked():
name, ok = QtGui.QInputDialog.getText(sgPyQt.getDesktop(),
"Create case",
"Enter case name:",
- QtGui.QLineEdit.Normal,
+ QtWidgets.QLineEdit.Normal,
default_case_name )
if not ok: return
- name = str( name.trimmed() )
+ name = str( name.strip() )
elif sgPyQt.action( GUIcontext.OPTION_2_ID ).isChecked():
# generate object name
__id__ = __id__ + 1
ed.setAttributeValue(varL, "AttributeReal", 1.5)
varI = ed.createItem(case, "I", typeId = GUIcontext.VARIABLE_ID)
ed.setAttributeValue(varI, "AttributeReal", 2.e-6)
-
+
inputVarList = [study_exchange_vars.Variable("E"),
study_exchange_vars.Variable("F"),
study_exchange_vars.Variable("L"),
error = exc.details.text
solver_engine.Finalize()
-
+
if error is not None:
QtGui.QMessageBox.critical(sgPyQt.getDesktop(), "Error", error)
elif param_output.returnCode != 0:
sobj = ed.study.FindObjectID(entry)
assert sobj
oldvalue = ed.getAttributeValue(sobj, "AttributeReal", 0.0)
- name, ok = QtGui.QInputDialog.getText(sgPyQt.getDesktop(),
+ name, ok = QtWidgets.QInputDialog.getText(sgPyQt.getDesktop(),
"Set a value",
"Enter new value:",
- QtGui.QLineEdit.Normal,
+ QtWidgets.QLineEdit.Normal,
str(oldvalue) )
- value = float( name.trimmed() )
+ value = float( name.strip() )
if not ok or not value: return
ed.setAttributeValue(sobj, "AttributeReal", value)
salome.sg.updateObjBrowser(0)