def editCurrentColorMap(self): self.newColorMapDia = QtGui.QDialog(self) self.addColorMapDia = colorMapDia() self.addColorMapDia.setupUi(self.newColorMapDia) self.newColorMapDia.show() currentColorMap = self.colorMapLabelMapDict[str(self.paraSelectDia.colorMapLabelComboBox.currentText())] self.addColorMapDia.labelLineEdit.setText(currentColorMap.label) self.addColorMapDia.minValLineEdit.setText(str(currentColorMap.minVal)) self.addColorMapDia.maxValLineEdit.setText(str(currentColorMap.maxVal)) listOfAllFiles = os.listdir(PATH_COLORMAPS) for name in listOfAllFiles: if name == ".svn": listOfAllFiles.remove(".svn") pass self.addColorMapDia.colorMapComboBox.addItems(listOfAllFiles) for i in range(self.addColorMapDia.colorMapComboBox.count()): if self.addColorMapDia.colorMapComboBox.itemText(i) == str(currentColorMap.fileName): self.addColorMapDia.colorMapComboBox.setCurrentIndex(i) self.addColorMapDia.colorMapToolButton.setIcon( QtGui.QIcon(os.path.join(PATH_ICONS, str(self.addColorMapDia.colorMapComboBox.currentText()) + ".png")) ) self.newColorMap = 0 self.connect(self.addColorMapDia.okayPushButton, QtCore.SIGNAL("clicked()"), self.okayColorMap) self.connect( self.addColorMapDia.colorMapComboBox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.updateColorMapToolDia, )
def addNewColorMap(self): self.newColorMapDia = QtGui.QDialog(self) self.addColorMapDia = colorMapDia() self.addColorMapDia.setupUi(self.newColorMapDia) self.newColorMapDia.show() listOfAllFiles = os.listdir(PATH_COLORMAPS) for name in listOfAllFiles: if name == '.svn': listOfAllFiles.remove('.svn') pass self.newColorMap = 1 self.addColorMapDia.colorMapComboBox.addItems(listOfAllFiles) self.addColorMapDia.colorMapToolButton.setIcon(QtGui.QIcon(os.path.join(PATH_ICONS,str(self.addColorMapDia.colorMapComboBox.currentText())+'.png'))) self.connect(self.addColorMapDia.okayPushButton,QtCore.SIGNAL('clicked()'),self.okayColorMap) self.connect(self.addColorMapDia.colorMapComboBox,QtCore.SIGNAL('currentIndexChanged(QString)'),self.updateColorMapToolDia)