コード例 #1
0
ファイル: ChapterView.py プロジェクト: zhlikezhz/tools
 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())
コード例 #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())
コード例 #3
0
ファイル: MainWin.py プロジェクト: zhlikezhz/tools
	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)
コード例 #4
0
ファイル: MainWin.py プロジェクト: zhlikezhz/tools
	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)
コード例 #5
0
ファイル: AttributeView.py プロジェクト: zhlikezhz/tools
	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
コード例 #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
コード例 #7
0
ファイル: StoryView.py プロジェクト: zhlikezhz/tools
 def setData(self, column, value):
     if (column == 0):
         self.unitData.desc = units._toUtf8(value.toString())
コード例 #8
0
 def changed(self, row, col):
     string = units._toUtf8(self.cellWidget(row, 0).currentText())
     self.updateData(self.attributeList[row], string)
     self.delegateView.getAttributeData()
コード例 #9
0
ファイル: StoryView.py プロジェクト: zhlikezhz/tools
	def setData(self, column, value):
		if(column == 0):
			self.unitData.desc = units._toUtf8(value.toString())
コード例 #10
0
ファイル: AttributeView.py プロジェクト: zhlikezhz/tools
	def changed(self, row, col):
		string = units._toUtf8(self.cellWidget(row, 0).currentText())
		self.updateData(self.attributeList[row], string)
		self.delegateView.getAttributeData()