]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Added 'New' function in salome.gui.selectvars interface
authorbarate <barate>
Fri, 11 Feb 2011 14:45:21 +0000 (14:45 +0000)
committerbarate <barate>
Fri, 11 Feb 2011 14:45:21 +0000 (14:45 +0000)
src/GUI_PY/SelectVarsDialog.ui
src/GUI_PY/selectvars.py

index 504f32ebe0a8df921c224680d61eb49e97c71d7b..6327787b1633305770eb96446b93752ebd930514 100644 (file)
         </widget>
        </item>
        <item>
-        <widget class="QPushButton" name="pushButton_8">
+        <widget class="QPushButton" name="newInputVarButton">
          <property name="text">
           <string>New...</string>
          </property>
         </widget>
        </item>
        <item>
-        <widget class="QPushButton" name="pushButton_4">
+        <widget class="QPushButton" name="newOutputVarButton">
          <property name="text">
           <string>New...</string>
          </property>
index 5900192e7ffcd03c23f8a202de2a20799f9cb49c..6756268882a5f9d8c77c703313ec3b576fb968fa 100644 (file)
@@ -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 = []