def _setUser(self, name): from user import UserDialog g_userInfo = GetUserInfo() g_userInfo.setUser(name) self.textUser.SetLabel(name) util.config.set('APP', 'user', name)
def showRecord(self,evt): from user import GetUserInfo, RecordListDialog userInfo = GetUserInfo() if not userInfo.getCurUser(): return dlg = RecordListDialog(self, -1, _("Record List"), size=(350, 200)) dlg.CenterOnScreen() dlg.ShowModal() dlg.Destroy()
def finish(self, evt): res = self.board.checkValid() if res: msg = _('Congratulations! You had finish this Sudoku!') self.spendTimer.Stop() g_userInfo = GetUserInfo() g_userInfo.setRecord(self.puzzleID, self.spendTime) else: msg = _('Hey man! Your answer is wrong... try again!') dlg = wx.MessageDialog(None, msg, _('Information'), style=wx.OK) dlg.ShowModal() dlg.Destroy()