2013-05-17 20:44:40 +02:00
|
|
|
#include "proxypluginwrappers.h"
|
|
|
|
|
#include <boost/python.hpp>
|
|
|
|
|
#include <utility.h>
|
2013-06-05 09:51:48 +02:00
|
|
|
#include "error.h"
|
|
|
|
|
#include "gilock.h"
|
2013-05-17 20:44:40 +02:00
|
|
|
|
|
|
|
|
namespace bpy = boost::python;
|
|
|
|
|
|
|
|
|
|
using namespace MOBase;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define PYCATCH catch (const bpy::error_already_set &) { reportPythonError(); throw MyException("unhandled exception"); }\
|
|
|
|
|
catch (...) { throw MyException("An unknown exception was thrown in python code"); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////
|
|
|
|
|
/// IPluginTool Wrapper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool IPluginToolWrapper::init(MOBase::IOrganizer *moInfo)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("init")(bpy::ptr(moInfo));
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginToolWrapper::name() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("name")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginToolWrapper::author() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("author")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginToolWrapper::description() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("description")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MOBase::VersionInfo IPluginToolWrapper::version() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("version")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginToolWrapper::isActive() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("isActive")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QList<MOBase::PluginSetting> IPluginToolWrapper::settings() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("settings")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginToolWrapper::displayName() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("displayName")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginToolWrapper::tooltip() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("tooltip")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QIcon IPluginToolWrapper::icon() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("icon")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginToolWrapper::setParentWidget(QWidget *parent)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
this->get_override("setParentWidget")(parent);
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginToolWrapper::display() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
2013-06-05 09:51:48 +02:00
|
|
|
GILock lock;
|
|
|
|
|
|
2013-05-17 20:44:40 +02:00
|
|
|
this->get_override("display")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// end IPluginTool Wrapper
|
|
|
|
|
/////////////////////////////////////
|
|
|
|
|
/// IPluginInstallerCustom Wrapper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool IPluginInstallerCustomWrapper::init(MOBase::IOrganizer *moInfo)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("init")(bpy::ptr(moInfo));
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginInstallerCustomWrapper::name() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("name")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginInstallerCustomWrapper::author() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("author")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginInstallerCustomWrapper::description() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("description")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MOBase::VersionInfo IPluginInstallerCustomWrapper::version() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("version")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginInstallerCustomWrapper::isActive() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("isActive")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QList<MOBase::PluginSetting> IPluginInstallerCustomWrapper::settings() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("settings")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned int IPluginInstallerCustomWrapper::priority() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("priority")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginInstallerCustomWrapper::isManualInstaller() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("isManualInstaller")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginInstallerCustomWrapper::isArchiveSupported(const DirectoryTree &tree) const
|
|
|
|
|
{
|
|
|
|
|
try {
|
2013-06-08 22:23:25 +02:00
|
|
|
//return this->get_override("isArchiveSupported")(tree);
|
|
|
|
|
return false;
|
2013-05-17 20:44:40 +02:00
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginInstallerCustomWrapper::isArchiveSupported(const QString &archiveName) const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("isArchiveSupported")(archiveName);
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::set<QString> IPluginInstallerCustomWrapper::supportedExtensions() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("supportedExtensions")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2013-06-05 09:51:48 +02:00
|
|
|
IPluginInstaller::EInstallResult IPluginInstallerCustomWrapper::install(GuessedValue<QString> &modName, const QString &archiveName,
|
|
|
|
|
const QString &version, int modID)
|
2013-05-17 20:44:40 +02:00
|
|
|
{
|
|
|
|
|
try {
|
2013-06-05 09:51:48 +02:00
|
|
|
return this->get_override("install")(modName, archiveName, version, modID);
|
2013-05-17 20:44:40 +02:00
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void IPluginInstallerCustomWrapper::setParentWidget(QWidget *parent)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
this->get_override("setParentWidget")(parent);
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|