]> git.mxchange.org Git - flightgear.git/commitdiff
pkg: Expose install callbacks to Nasal.
authorThomas Geymayer <tomgey@gmail.com>
Tue, 10 Jun 2014 21:52:36 +0000 (23:52 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Tue, 10 Jun 2014 21:53:57 +0000 (23:53 +0200)
src/Network/HTTPClient.cxx

index 134c38f929164576a5cc264513bcdd19df120a32..74db1473bd18ba3b78733999da9e4c10425ab309 100644 (file)
@@ -236,13 +236,21 @@ void FGHTTPClient::postinit()
   .method("uninstall", &f_package_uninstall)
   .method("lprop", &pkg::Package::getLocalisedProp);
   
+  typedef pkg::Install* (pkg::Install::*InstallCallback)
+                        (const pkg::Install::Callback&);
+  typedef pkg::Install* (pkg::Install::*ProgressCallback)
+                        (const pkg::Install::ProgressCallback&);
   NasalInstall::init("Install")
   .member("revision", &pkg::Install::revsion)
   .member("pkg", &pkg::Install::package)
   .member("path", &pkg::Install::path)
   .member("hasUpdate", &pkg::Install::hasUpdate)
   .method("startUpdate", &pkg::Install::startUpdate)
-  .method("uninstall", &pkg::Install::uninstall);
+  .method("uninstall", &pkg::Install::uninstall)
+  .method("done", static_cast<InstallCallback>(&pkg::Install::done))
+  .method("fail", static_cast<InstallCallback>(&pkg::Install::fail))
+  .method("always", static_cast<InstallCallback>(&pkg::Install::always))
+  .method("progress", static_cast<ProgressCallback>(&pkg::Install::progress));
   
   pkg::Root* packageRoot = globals->packageRoot();
   if (packageRoot) {