Fix logout, add notice to Bug Report site, add bug report site to ToontownGlobals.

This commit is contained in:
DenialMC 2015-05-06 10:36:27 +03:00
parent 16f2f39160
commit a617cf7252
5 changed files with 20 additions and 41 deletions

View file

@ -826,39 +826,6 @@ class OTPClientRepository(ClientRepositoryBase):
self.notify.info('sending clientLogout') self.notify.info('sending clientLogout')
messenger.send('clientLogout') messenger.send('clientLogout')
@report(types=['args'], dConfigParam='teleport')
def detectLeaks(self, okTasks = None, okEvents = None):
if not True:
return
leakedTasks = self.detectLeakedTasks(okTasks)
leakedEvents = self.detectLeakedEvents(okEvents)
leakedIvals = self.detectLeakedIntervals()
leakedGarbage = self.detectLeakedGarbage()
if leakedTasks or leakedEvents or leakedIvals or leakedGarbage:
errorCode = base.getExitErrorCode()
if __debug__ and not PythonUtil.configIsToday('temp-disable-leak-detection'):
logFunc = self.notify.error
allowExit = False
else:
logFunc = self.notify.warning
allowExit = False
if base.config.GetBool('direct-gui-edit', 0):
logFunc('There are leaks: %s tasks, %s events, %s ivals, %s garbage cycles\nLeaked Events may be due to direct gui editing' % (leakedTasks,
leakedEvents,
leakedIvals,
leakedGarbage))
else:
logFunc('There are leaks: %s tasks, %s events, %s ivals, %s garbage cycles' % (leakedTasks,
leakedEvents,
leakedIvals,
leakedGarbage))
if allowExit:
self.notify.info('Allowing client to leave, panda error code %s' % errorCode)
else:
base.userExit()
else:
self.notify.info('There are no leaks detected.')
def detectLeakedGarbage(self, callback = None): def detectLeakedGarbage(self, callback = None):
if not __debug__: if not __debug__:
return 0 return 0

View file

@ -426,8 +426,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
base.localAvatarName = None base.localAvatarName = None
loader.abortBulkLoad() loader.abortBulkLoad()
base.transitions.noTransitions() base.transitions.noTransitions()
if self._userLoggingOut:
self.detectLeaks(okTasks=[], okEvents=['destroy-ToontownLoadingScreenTitle', 'destroy-ToontownLoadingScreenTip', 'destroy-ToontownLoadingScreenWaitBar'])
return return
def enterGameOff(self): def enterGameOff(self):

View file

@ -9,7 +9,7 @@ import ShtikerPage
from otp.speedchat import SCColorScheme from otp.speedchat import SCColorScheme
from otp.speedchat import SCStaticTextTerminal from otp.speedchat import SCStaticTextTerminal
from otp.speedchat import SpeedChat from otp.speedchat import SpeedChat
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer, ToontownGlobals
from toontown.toontowngui import TTDialog from toontown.toontowngui import TTDialog
import webbrowser import webbrowser
@ -713,6 +713,7 @@ class ExtraOptionsTabPage(DirectFrame):
def __init__(self, parent = aspect2d): def __init__(self, parent = aspect2d):
self.parent = parent self.parent = parent
self.currentSizeIndex = None self.currentSizeIndex = None
self.dialog = None
DirectFrame.__init__(self, parent=self.parent, relief=None, pos=(0.0, 0.0, 0.0), scale=(1.0, 1.0, 1.0)) DirectFrame.__init__(self, parent=self.parent, relief=None, pos=(0.0, 0.0, 0.0), scale=(1.0, 1.0, 1.0))
@ -721,6 +722,10 @@ class ExtraOptionsTabPage(DirectFrame):
def destroy(self): def destroy(self):
self.parent = None self.parent = None
if self.dialog:
self.dialog.destroy()
del self.dialog
DirectFrame.destroy(self) DirectFrame.destroy(self)
def load(self): def load(self):
@ -740,7 +745,7 @@ class ExtraOptionsTabPage(DirectFrame):
self.cogLevel_toggleButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=button_image_scale, text='', text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord), command=self.__doToggleCogLevelGui) self.cogLevel_toggleButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=button_image_scale, text='', text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord), command=self.__doToggleCogLevelGui)
self.cogLevel_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight)) self.cogLevel_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight))
self.bugReportButton = DirectButton(parent=self, relief=None, text=TTLocalizer.BugReportButton, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=button_image_scale, text_pos=(0, -0.01), text_fg=(0, 0, 0, 1), self.bugReportButton = DirectButton(parent=self, relief=None, text=TTLocalizer.BugReportButton, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=button_image_scale, text_pos=(0, -0.01), text_fg=(0, 0, 0, 1),
command=self.openBrowser, pos=(0.0, 0.0, -0.6), text_scale=(0.045)) command=self.showReportNotice, pos=(0.0, 0.0, -0.6), text_scale=(0.045))
gui.removeNode() gui.removeNode()
guiButton.removeNode() guiButton.removeNode()
@ -769,6 +774,12 @@ class ExtraOptionsTabPage(DirectFrame):
self.cogLevel_label['text'] = TTLocalizer.CogLevelLabelOn if settings['cogLevel'] else TTLocalizer.CogLevelLabelOff self.cogLevel_label['text'] = TTLocalizer.CogLevelLabelOn if settings['cogLevel'] else TTLocalizer.CogLevelLabelOff
self.cogLevel_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['cogLevel'] else TTLocalizer.OptionsPageToggleOn self.cogLevel_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['cogLevel'] else TTLocalizer.OptionsPageToggleOn
def openBrowser(self): def showReportNotice(self):
url = 'https://bugs.launchpad.net/toontown-united/+filebug' self.dialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.BugReportNotice, command=self.confirmBugReport)
webbrowser.open(url, new=2, autoraise=True) self.dialog.show()
def confirmBugReport(self, value):
if value > 0:
webbrowser.open(ToontownGlobals.BugReportSite, new=2, autoraise=True)
self.dialog.destroy()

View file

@ -8870,6 +8870,7 @@ FriendSecretSuccess = 'Congratulations! You are now True Friends with %s!'
HouseNames = ("Bungalow", "Tiki", "Teepee", "Castle", "Cupcake", "Cabin") HouseNames = ("Bungalow", "Tiki", "Teepee", "Castle", "Cupcake", "Cabin")
CatalogPurchaseHouseType = "When you buy a new house type, the current one is replaced by it. To recover the old type, you'll need to buy it back. Continue?" CatalogPurchaseHouseType = "When you buy a new house type, the current one is replaced by it. To recover the old type, you'll need to buy it back. Continue?"
BugReportButton = 'Report a Bug' BugReportButton = 'Report a Bug'
BugReportNotice = 'Attention!\n\nThis button will open a browser which will send you to a third party bug tracker website. This site requires an Ubuntu One account to login. It may ask you to create an account.\n\nAre you sure you want to continue?'
# Buffs # Buffs
buffIdStrings = { buffIdStrings = {

View file

@ -1641,3 +1641,5 @@ PropIdToColor = [
(0.96, 0.356, 0.839, 1), (0.96, 0.356, 0.839, 1),
(0.196, 0.917, 0.929, 1) (0.196, 0.917, 0.929, 1)
] ]
BugReportSite = 'https://bugs.launchpad.net/toontown-united/+filebug'