def setData(self, column, value): if column == 0: value1 = units._toUtf8(value.toString()) typeList = units.getTypelist() for unitType in typeList: if unitType["val"] == value1: self.unitData.type = unitType["key"] elif column == 1: pass # self.unitData.attrib['renwu'] = units._toUtf8(value.toString()) elif column == 2: self.unitData.sentence = units._toUtf8(value.toString())
def setData(self, column, value): if (column == 0): value1 = units._toUtf8(value.toString()) typeList = units.getTypelist() for unitType in typeList: if (unitType['val'] == value1): self.unitData.type = unitType['key'] elif (column == 1): pass #self.unitData.attrib['renwu'] = units._toUtf8(value.toString()) elif (column == 2): self.unitData.sentence = units._toUtf8(value.toString())
def saveToLua(self): filename = QtGui.QFileDialog.getSaveFileName(self, "save story to lua", ".", "story file(*.lua)") if(filename.isEmpty() == False and self.storyMgr != None): filename = units._toUtf8(filename) self.storyMgr.save2Lua(filename)
def getAttributeData(self): unitData = StoryData.UnitData('element') index = self.typeCombo.currentIndex() if(self.lock == False): typeList = units.getTypelist() unitData.type = typeList[index]['val'] unitData.attrib = self.attributeView.getData() unitData.sentence = units._toUtf8(self.dialogEdit.toPlainText()) self.chapterView.setAttbribute(unitData)
def getData(self): data = {} for attr in self.attributeList: string = '' if(attr.type == 'combo'): showValue = units._toUtf8(self.cellWidget(attr.row, 0).currentText()) if(attr.hasParent == True): parentRow = attr.parentRow showParentName = units._toUtf8(self.cellWidget(parentRow, 0).currentText()) string = attr.getChildSaveValue(showValue, showParentName) else: string = attr.getChildSaveValue(showValue) elif(attr.type == 'text'): string = units._toUtf8(self.item(attr.row, 0).text()) if(len(string) > 0): data[attr.getSaveValue()] = string return data
def getData(self): data = {} for attr in self.attributeList: string = '' if (attr.type == 'combo'): showValue = units._toUtf8( self.cellWidget(attr.row, 0).currentText()) if (attr.hasParent == True): parentRow = attr.parentRow showParentName = units._toUtf8( self.cellWidget(parentRow, 0).currentText()) string = attr.getChildSaveValue(showValue, showParentName) else: string = attr.getChildSaveValue(showValue) elif (attr.type == 'text'): string = units._toUtf8(self.item(attr.row, 0).text()) if (len(string) > 0): data[attr.getSaveValue()] = string return data
def setData(self, column, value): if (column == 0): self.unitData.desc = units._toUtf8(value.toString())
def changed(self, row, col): string = units._toUtf8(self.cellWidget(row, 0).currentText()) self.updateData(self.attributeList[row], string) self.delegateView.getAttributeData()
def setData(self, column, value): if(column == 0): self.unitData.desc = units._toUtf8(value.toString())