def loadWrestler(self, evt): if self.notebookWin.isDirty(): dlg = wxMessageDialog(self, formattedStrings["BUILDER_IS_DIRTY_MSG"], style=wxYES_NO|wxNO_DEFAULT|\ wxICON_EXCLAMATION) if dlg.ShowModal() == wxID_NO: dlg.Destroy() return dlg.Destroy() wrestlerDic = dblib.getWrestlerData() wrestlers = [] for filename in wrestlerDic.keys(): wrestler = wrestlerDic[filename] nameSet = getattr(wrestler, "nameSet", "") wrestlers.append((wrestler.name, nameSet, filename)) dlg = SelectDialog("Select Wrestler", wrestlers, "Select Wrestler To Load", single_select=1, parent=self) if dlg.ShowModal() == wxID_OK: wrestler = wrestlerDic[dlg.GetSelection()] self.notebookWin.loadWrestler(wrestler) self.setDirty(0) dlg.Destroy()
def showTournamentGUI(cb): tourneyDialog = TourneyStartDialog() if tourneyDialog.ShowModal() == wxID_OK: mods = dblib.getWrestlerData() modVals = mods.values() modVals.sort(cmpFunc) names = [] for modVal in modVals: names.append("%s - %s" % (modVal.name, getattr(modVal, "nameSet", ""))) numTeams = int(tourneyDialog.numTeamsCtrl.GetValue()) teamSize = int(tourneyDialog.teamSizeCtrl.GetValue()) tourneyName = tourneyDialog.nameCtrl.GetValue() network = 0 frame = wxFrame(None, -1, "Tournament Setup", size=(1024, 768)) selgui = SelectionGUI(frame, tourneyName, names, numTeams, teamSize, cb, network) frame.Center() util.setIcon(frame) frame.Show(1)
def _getWrestlerFiles(self): self.wrestlers = getWrestlerData()