diff --git a/src/runner/proxypluginwrappers.cpp b/src/runner/proxypluginwrappers.cpp index 90ce3cd..f618af9 100644 --- a/src/runner/proxypluginwrappers.cpp +++ b/src/runner/proxypluginwrappers.cpp @@ -290,6 +290,10 @@ std::map IPluginGameWrapper::featureList() const #define COMMON_I_PLUGIN_INSTALLER_WRAPPER_DEFINITIONS(class_name) \ unsigned int class_name::priority() const { return basicWrapperFunctionImplementation(this, "priority"); } \ bool class_name::isManualInstaller() const { return basicWrapperFunctionImplementation(this, "isManualInstaller"); } \ +void class_name::onInstallationStart(QString const& archive, MOBase::IModInterface* currentMod) { \ + basicWrapperFunctionImplementationWithDefault(this, &class_name::onInstallationStart_Default, "onInstallationStart", archive, boost::python::ptr(currentMod)); } \ +void class_name::onInstallationEnd(EInstallResult result, MOBase::IModInterface* newMod) { \ + basicWrapperFunctionImplementationWithDefault(this, &class_name::onInstallationEnd_Default, "onInstallationEnd", result, boost::python::ptr(newMod)); } \ bool class_name::isArchiveSupported(std::shared_ptr tree) const { return basicWrapperFunctionImplementation(this, "isArchiveSupported", tree); } /// end IPluginInstaller macro diff --git a/src/runner/proxypluginwrappers.h b/src/runner/proxypluginwrappers.h index 0c77ab4..07b9264 100644 --- a/src/runner/proxypluginwrappers.h +++ b/src/runner/proxypluginwrappers.h @@ -137,6 +137,12 @@ using IPluginInstaller::parentWidget; \ using IPluginInstaller::manager; \ virtual unsigned int priority() const override; \ virtual bool isManualInstaller() const override; \ +virtual void onInstallationStart(QString const& archive, MOBase::IModInterface* currentMod) override; \ +void onInstallationStart_Default(QString const& archive, MOBase::IModInterface* currentMod) { \ + return IPluginInstaller::onInstallationStart(archive, currentMod); } \ +virtual void onInstallationEnd(EInstallResult result, MOBase::IModInterface* newMod) override; \ +void onInstallationEnd_Default(EInstallResult result, MOBase::IModInterface* newMod) { \ + return IPluginInstaller::onInstallationEnd(result, newMod); } \ virtual bool isArchiveSupported(std::shared_ptr tree) const override; diff --git a/src/runner/pythonrunner.cpp b/src/runner/pythonrunner.cpp index 834cb9d..eea14b6 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -820,12 +820,16 @@ BOOST_PYTHON_MODULE(mobase) bpy::class_, boost::noncopyable>("IPluginInstaller", bpy::no_init) .def("isArchiveSupported", &IPluginInstaller::isArchiveSupported, bpy::arg("tree")) .def("priority", &IPluginInstaller::priority) + .def("onInstallationStart", &IPluginInstaller::onInstallationStart, (bpy::arg("archive"), bpy::arg("current_mod"))) + .def("onInstallationEnd", &IPluginInstaller::onInstallationEnd, (bpy::arg("result"), bpy::arg("new_mod"))) .def("isManualInstaller", &IPluginInstaller::isManualInstaller) .def("setParentWidget", &IPluginInstaller::setParentWidget, bpy::arg("parent")) .def("setInstallationManager", &IPluginInstaller::setInstallationManager, bpy::arg("manager")) ; bpy::class_, boost::noncopyable>("IPluginInstallerSimple") + .def("onInstallationStart", &IPluginInstaller::onInstallationStart, (bpy::arg("archive"), bpy::arg("current_mod"))) + .def("onInstallationEnd", &IPluginInstaller::onInstallationEnd, (bpy::arg("result"), bpy::arg("new_mod"))) // Note: Keeping the variant here even if we always return a tuple to be consistent with the wrapper and // have proper stubs generation. .def("install", +[](IPluginInstallerSimple* p, GuessedValue& modName, std::shared_ptr& tree, QString& version, int& nexusID) @@ -838,6 +842,8 @@ BOOST_PYTHON_MODULE(mobase) ; bpy::class_, boost::noncopyable>("IPluginInstallerCustom") + .def("onInstallationStart", &IPluginInstaller::onInstallationStart, (bpy::arg("archive"), bpy::arg("current_mod"))) + .def("onInstallationEnd", &IPluginInstaller::onInstallationEnd, (bpy::arg("result"), bpy::arg("new_mod"))) // Needs to add both otherwize boost does not understand: .def("isArchiveSupported", &IPluginInstaller::isArchiveSupported, bpy::arg("tree")) .def("isArchiveSupported", &IPluginInstallerCustom::isArchiveSupported, bpy::arg("archive_name"))