From 0e286717a6adf4c696a4778318a668dfba18987a Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Tue, 10 Jun 2014 23:52:36 +0200 Subject: [PATCH] pkg: Expose install callbacks to Nasal. --- src/Network/HTTPClient.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Network/HTTPClient.cxx b/src/Network/HTTPClient.cxx index 134c38f92..74db1473b 100644 --- a/src/Network/HTTPClient.cxx +++ b/src/Network/HTTPClient.cxx @@ -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(&pkg::Install::done)) + .method("fail", static_cast(&pkg::Install::fail)) + .method("always", static_cast(&pkg::Install::always)) + .method("progress", static_cast(&pkg::Install::progress)); pkg::Root* packageRoot = globals->packageRoot(); if (packageRoot) {