def detectSubtypes(self): if windows.askUser( "Change Subtypes", "Software will set default subtypes.\n" "Subtypes of most items will be changed", ): upgradeDB.findSubTypes(dao.getAllItems())
def saveXML(self): for_namalsk = False if windows.askUser("Export Types.xml", "Are you exporting for namalsk map?"): for_namalsk = True xmlPath = windows.saveAsFile("xml", "w+") if xmlPath is not None: xmlWriter.update(xmlPath, self.selectedMods, namalsk=for_namalsk)
def checkForDatabase(self): try: dao.getNominalByType("weapon") self.connectionOK = True except Exception: self.window.withdraw() self.openConnectionWindow() self.window.deiconify() try: dao.getSubtypes() except Exception: windows.showUpgradeError(self.window) if windows.askUser("Upgrade", "Do you want to upgrade your Database?"): self.upgradeDB()
def deleteSel(self): if windows.askUser( "Delete Item", "Are you sure you want to delete selected Item?" ): dao.deleteItem(self.getSelectedValues(self.tree.focus())["name"]) self.updateDisplay(dao.reExecuteLastQuery())