def setupPlanTable(self): self.__ui.twBusinessPlan.setHorizontalHeaderLabels( ['Type', 'Amount', 'Name', 'Description', 'Weekly', 'Envelope']) for i in range(ItemType.ItemsCount): self.__ui.cbItemType.addItem(ItemType.desc(i), i) self.__ui.cbItemType.setCurrentIndex(1) for i in range(Frequency.ItemsCount): self.__ui.cbItemFrequency.addItem(Frequency.desc(i), i) self.__ui.cbItemFrequency.setCurrentIndex(4)
def addRowForPlanItem(self, item): tw = self.__ui.twBusinessPlan row = tw.rowCount() tw.setRowCount(row + 1) tw.setItem(row, 0, self.itemWithId(ItemType.desc(item.type), item.id)) tw.setItem(row, 1, self.itemWithId(str(item.amount), item.id)) tw.setItem(row, 2, self.itemWithId(item.name, item.id)) tw.setItem(row, 3, self.itemWithId(Frequency.desc(item.freq), item.id)) tw.setItem(row, 4, self.itemWithId(str(item.weeklyValue), item.id)) for env in self.__envMgr.envelopes.values(): if env.name == item.name: tw.setItem(row, 5, self.itemWithId('Existing', item.id)) return else: tw.setItem(row, 5, self.itemWithId('New', item.id))