def showAddSpell(self): Dialog = QtGui.QDialog() asw = AddSpellWindow(self.db) asw.setupUi(Dialog) if Dialog.exec_(): spell_dict = asw.generate_spell_dict() self.db.add_spell_dict(spell_dict) self.reloadModel()
def showEditSpell(self): spellIndex = self.spellselections.currentIndex() spellIndex = self.filtermodel.mapToSource(spellIndex) spell = self.model.itemFromIndex(spellIndex).spell Dialog = QtGui.QDialog() asw = AddSpellWindow(self.db) asw.setupUi(Dialog) asw.loadSpell(spell) if Dialog.exec_(): spell_dict = asw.generate_spell_dict() self.db.add_spell_dict(spell_dict) self.db.delete_empty() self.reloadModel()