diff --git a/src/runner/pythonrunner.cpp b/src/runner/pythonrunner.cpp index b9e01f4..f4afa4f 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -74,7 +74,7 @@ struct ModRepositoryFileInfo_to_python_dict PyDict_SetItemString(res, "description", bpy::incref(bpy::object(info.description.toUtf8().constData()).ptr())); PyDict_SetItemString(res, "categoryID", PyLong_FromLong(info.categoryID)); PyDict_SetItemString(res, "fileID", PyLong_FromLong(info.fileID)); - PyDict_SetItemString(res, "fileSize", PyLong_FromLong(info.fileSize)); + PyDict_SetItemString(res, "fileSize", PyLong_FromLong(static_cast(info.fileSize))); PyDict_SetItemString(res, "version", bpy::incref(bpy::object(info.version).ptr())); return bpy::incref(res); } @@ -724,10 +724,17 @@ BOOST_PYTHON_MODULE(mobase) .def("onFinishedRun", bpy::pure_virtual(&IOrganizer::onFinishedRun)) .def("onModInstalled", bpy::pure_virtual(&IOrganizer::onModInstalled)) .def("refreshModList", bpy::pure_virtual(&IOrganizer::refreshModList)) + .def("profile", bpy::pure_virtual(&IOrganizer::profile), bpy::return_value_policy()) .def("managedGame", bpy::pure_virtual(&IOrganizer::managedGame), bpy::return_value_policy()) .def("modsSortedByProfilePriority", bpy::pure_virtual(&IOrganizer::modsSortedByProfilePriority)) ; + bpy::class_("IProfile") + .def("name", bpy::pure_virtual(&IProfile::name)) + .def("absolutePath", bpy::pure_virtual(&IProfile::absolutePath)) + .def("localSavesEnabled", bpy::pure_virtual(&IProfile::localSavesEnabled)) + ; + bpy::class_("ModRepositoryBridge") .def(bpy::init()) .def("requestDescription", &ModRepositoryBridgeWrapper::requestDescription) diff --git a/src/runner/uibasewrappers.h b/src/runner/uibasewrappers.h index d58dee4..2e5c845 100644 --- a/src/runner/uibasewrappers.h +++ b/src/runner/uibasewrappers.h @@ -228,10 +228,18 @@ struct IOrganizerWrapper: MOBase::IOrganizer, boost::python::wrapper &func) { return this->get_override("onAboutToRun")(func); } virtual bool onFinishedRun(const std::function &func) { return this->get_override("onFinishedRun")(func); } virtual bool onModInstalled(const std::function &func) { return this->get_override("onModInstalled")(func); } + virtual MOBase::IProfile *profile() override { return this->get_override("profile")(); } virtual MOBase::IPluginGame const *managedGame() const { return this->get_override("managedGame")(); } virtual QStringList modsSortedByProfilePriority() const override { return this->get_override("modsSortedByProfilePriority")(); } }; +struct IProfileWrapper: MOBase::IProfile, boost::python::wrapper +{ + virtual QString name() const { return this->get_override("name")(); } + virtual QString absolutePath() const { return this->get_override("absolutePath")(); } + virtual bool localSavesEnabled() const { return this->get_override("localSavesEnabled")(); } +}; + struct IDownloadManagerWrapper: MOBase::IDownloadManager, boost::python::wrapper { virtual int startDownloadURLs(const QStringList &urls) { return this->get_override("downloadURLs")(urls); }