Beispiel #1
0
 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())
Beispiel #2
0
 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())
Beispiel #3
0
	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)
Beispiel #4
0
	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)
Beispiel #5
0
	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
Beispiel #6
0
    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
Beispiel #7
0
 def setData(self, column, value):
     if (column == 0):
         self.unitData.desc = units._toUtf8(value.toString())
Beispiel #8
0
 def changed(self, row, col):
     string = units._toUtf8(self.cellWidget(row, 0).currentText())
     self.updateData(self.attributeList[row], string)
     self.delegateView.getAttributeData()
Beispiel #9
0
	def setData(self, column, value):
		if(column == 0):
			self.unitData.desc = units._toUtf8(value.toString())
Beispiel #10
0
	def changed(self, row, col):
		string = units._toUtf8(self.cellWidget(row, 0).currentText())
		self.updateData(self.attributeList[row], string)
		self.delegateView.getAttributeData()