瀏覽代碼

a few tweaks

David Rose 16 年之前
父節點
當前提交
a36bc45d08
共有 2 個文件被更改,包括 9 次插入1 次删除
  1. 1 1
      direct/src/p3d/AppRunner.py
  2. 8 0
      direct/src/p3d/DWBPackageInstaller.py

+ 1 - 1
direct/src/p3d/AppRunner.py

@@ -804,7 +804,7 @@ class AppRunner(DirectObject):
         plugin takes down the splash window when it sees the
         plugin takes down the splash window when it sees the
         onwindowopen notification. """
         onwindowopen notification. """
 
 
-        self.sendRequest('notify', message)
+        self.sendRequest('notify', message.lower())
 
 
     def evalScript(self, expression, needsResponse = False):
     def evalScript(self, expression, needsResponse = False):
         """ Evaluates an arbitrary JavaScript expression in the global
         """ Evaluates an arbitrary JavaScript expression in the global

+ 8 - 0
direct/src/p3d/DWBPackageInstaller.py

@@ -13,6 +13,11 @@ class DWBPackageInstaller(DirectWaitBar, PackageInstaller):
     Specify updateText = True (the default) to update the text label
     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
     with the name of the package or False to leave it up to you to set
     it.
     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):
     def __init__(self, appRunner, parent = None, **kw):
@@ -30,6 +35,7 @@ class DWBPackageInstaller(DirectWaitBar, PackageInstaller):
             ('text_scale',     0.1,                None),
             ('text_scale',     0.1,                None),
             ('perPackage',     False,              None),
             ('perPackage',     False,              None),
             ('updateText',     True,               None),
             ('updateText',     True,               None),
+            ('finished',       None,               None),
             )
             )
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
         DirectWaitBar.__init__(self, parent, **kw)
         DirectWaitBar.__init__(self, parent, **kw)
@@ -84,3 +90,5 @@ class DWBPackageInstaller(DirectWaitBar, PackageInstaller):
 
 
         self.hide()
         self.hide()
         
         
+        if self['finished']:
+            self['finished'](success)