From a36bc45d08504654a10b0f82fb965d22e1d4638b Mon Sep 17 00:00:00 2001 From: David Rose Date: Sun, 25 Oct 2009 21:39:41 +0000 Subject: [PATCH] a few tweaks --- direct/src/p3d/AppRunner.py | 2 +- direct/src/p3d/DWBPackageInstaller.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/direct/src/p3d/AppRunner.py b/direct/src/p3d/AppRunner.py index 2cd47fa762..cda84c5e25 100644 --- a/direct/src/p3d/AppRunner.py +++ b/direct/src/p3d/AppRunner.py @@ -804,7 +804,7 @@ class AppRunner(DirectObject): plugin takes down the splash window when it sees the onwindowopen notification. """ - self.sendRequest('notify', message) + self.sendRequest('notify', message.lower()) def evalScript(self, expression, needsResponse = False): """ Evaluates an arbitrary JavaScript expression in the global diff --git a/direct/src/p3d/DWBPackageInstaller.py b/direct/src/p3d/DWBPackageInstaller.py index c1df7a1bc8..43ee9fb71d 100644 --- a/direct/src/p3d/DWBPackageInstaller.py +++ b/direct/src/p3d/DWBPackageInstaller.py @@ -13,6 +13,11 @@ class DWBPackageInstaller(DirectWaitBar, PackageInstaller): Specify updateText = True (the default) to update the text label with the name of the package or False to leave it up to you to set it. + + You can specify a callback function with finished = func; this + function will be called, with one boolean parameter, when the + download has completed. The parameter will be true on success, or + false on failure. """ def __init__(self, appRunner, parent = None, **kw): @@ -30,6 +35,7 @@ class DWBPackageInstaller(DirectWaitBar, PackageInstaller): ('text_scale', 0.1, None), ('perPackage', False, None), ('updateText', True, None), + ('finished', None, None), ) self.defineoptions(kw, optiondefs) DirectWaitBar.__init__(self, parent, **kw) @@ -84,3 +90,5 @@ class DWBPackageInstaller(DirectWaitBar, PackageInstaller): self.hide() + if self['finished']: + self['finished'](success)