From: barate Date: Fri, 11 Feb 2011 14:45:21 +0000 (+0000) Subject: Added 'New' function in salome.gui.selectvars interface X-Git-Tag: V6_3_0a1~65 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a08d67f42cd4f37b8400184d66eb1d8d402e9f15;p=modules%2Fgui.git Added 'New' function in salome.gui.selectvars interface --- diff --git a/src/GUI_PY/SelectVarsDialog.ui b/src/GUI_PY/SelectVarsDialog.ui index 504f32ebe..6327787b1 100644 --- a/src/GUI_PY/SelectVarsDialog.ui +++ b/src/GUI_PY/SelectVarsDialog.ui @@ -118,7 +118,7 @@ - + New... @@ -215,7 +215,7 @@ - + New... diff --git a/src/GUI_PY/selectvars.py b/src/GUI_PY/selectvars.py index 5900192e7..675626888 100644 --- a/src/GUI_PY/selectvars.py +++ b/src/GUI_PY/selectvars.py @@ -21,6 +21,7 @@ # from PyQt4 import QtGui, QtCore +from PyQt4.QtCore import Qt import salome from salome.kernel.studyedit import getStudyEditor @@ -42,9 +43,11 @@ class MySelectVarsDialog(Ui_SelectVarsDialog, QtGui.QDialog): self.connect(self.selectButton, QtCore.SIGNAL("clicked()"), self.initSelectedVarList) self.connect(self.addInputVarButton, QtCore.SIGNAL("clicked()"), self.addSelectedInputVar) self.connect(self.removeInputVarButton, QtCore.SIGNAL("clicked()"), self.removeSelectedInputVar) + self.connect(self.newInputVarButton, QtCore.SIGNAL("clicked()"), self.newInputVar) self.connect(self.addOutputVarButton, QtCore.SIGNAL("clicked()"), self.addSelectedOutputVar) self.connect(self.removeOutputVarButton, QtCore.SIGNAL("clicked()"), self.removeSelectedOutputVar) - + self.connect(self.newOutputVarButton, QtCore.SIGNAL("clicked()"), self.newOutputVar) + def initSelectedVarList(self): entries = salome.sg.getAllSelected() if len(entries) != 1 : @@ -75,6 +78,11 @@ class MySelectVarsDialog(Ui_SelectVarsDialog, QtGui.QDialog): for item in self.selectedInputVarListWidget.selectedItems(): self.selectedInputVarListWidget.takeItem(self.selectedInputVarListWidget.row(item)) + def newInputVar(self): + newItem = QtGui.QListWidgetItem("TO EDIT!") + newItem.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEditable|Qt.ItemIsUserCheckable|Qt.ItemIsEnabled) + self.selectedInputVarListWidget.addItem(newItem); + def addSelectedOutputVar(self): for item in self.allOutputVarListWidget.selectedItems(): self.selectedOutputVarListWidget.addItem(QtGui.QListWidgetItem(item)) @@ -83,6 +91,11 @@ class MySelectVarsDialog(Ui_SelectVarsDialog, QtGui.QDialog): for item in self.selectedOutputVarListWidget.selectedItems(): self.selectedOutputVarListWidget.takeItem(self.selectedOutputVarListWidget.row(item)) + def newOutputVar(self): + newItem = QtGui.QListWidgetItem("TO EDIT!") + newItem.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEditable|Qt.ItemIsUserCheckable|Qt.ItemIsEnabled) + self.selectedOutputVarListWidget.addItem(newItem); + def getSelectedVarLists(self): inputVarList = [] outputVarList = []