2013-09-01 18:36:43 +02:00
|
|
|
#include "proxypluginwrappers.h"
|
2018-04-25 17:25:12 +01:00
|
|
|
|
2013-09-01 18:36:43 +02:00
|
|
|
#include "gilock.h"
|
2018-04-20 16:39:58 +01:00
|
|
|
#include <QUrl>
|
2015-11-08 23:15:55 +00:00
|
|
|
#include <QWidget>
|
2018-04-25 17:25:12 +01:00
|
|
|
#include "pycatch.h"
|
2018-04-22 00:59:42 +01:00
|
|
|
#include "sipApiAccess.h"
|
2013-09-01 18:36:43 +02:00
|
|
|
|
2016-11-27 16:54:19 +02:00
|
|
|
namespace boost
|
|
|
|
|
{
|
2016-12-12 05:13:08 -08:00
|
|
|
// See bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2852624
|
|
|
|
|
#if (_MSC_VER == 1900)
|
2016-11-27 16:54:19 +02:00
|
|
|
template<> const volatile MOBase::IOrganizer* get_pointer(const volatile MOBase::IOrganizer* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IModInterface* get_pointer(const volatile MOBase::IModInterface* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IPluginGame* get_pointer(const volatile MOBase::IPluginGame* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IProfile* get_pointer(const volatile MOBase::IProfile* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IModList* get_pointer(const volatile MOBase::IModList* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IPluginList* get_pointer(const volatile MOBase::IPluginList* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IDownloadManager* get_pointer(const volatile MOBase::IDownloadManager* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IModRepositoryBridge* get_pointer(const volatile MOBase::IModRepositoryBridge* p) { return p; }
|
2016-12-12 05:13:08 -08:00
|
|
|
#endif
|
2016-11-27 16:54:19 +02:00
|
|
|
}
|
2013-09-01 18:36:43 +02:00
|
|
|
|
|
|
|
|
using namespace MOBase;
|
|
|
|
|
|
|
|
|
|
|
2018-04-19 00:42:24 +01:00
|
|
|
#define COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(class_name) \
|
|
|
|
|
bool class_name::init(MOBase::IOrganizer *moInfo) \
|
|
|
|
|
{ \
|
|
|
|
|
try { \
|
|
|
|
|
return this->get_override("init")(boost::python::ptr(moInfo)); \
|
|
|
|
|
} PYCATCH; \
|
|
|
|
|
} \
|
|
|
|
|
\
|
|
|
|
|
QString class_name::name() const \
|
|
|
|
|
{ \
|
|
|
|
|
try { \
|
|
|
|
|
return this->get_override("name")().as<QString>(); \
|
|
|
|
|
} PYCATCH; \
|
|
|
|
|
} \
|
|
|
|
|
\
|
|
|
|
|
QString class_name::author() const \
|
|
|
|
|
{ \
|
|
|
|
|
try { \
|
|
|
|
|
return this->get_override("author")().as<QString>(); \
|
|
|
|
|
} PYCATCH; \
|
|
|
|
|
} \
|
|
|
|
|
\
|
|
|
|
|
QString class_name::description() const \
|
|
|
|
|
{ \
|
|
|
|
|
try { \
|
|
|
|
|
return this->get_override("description")().as<QString>(); \
|
|
|
|
|
} PYCATCH; \
|
|
|
|
|
} \
|
|
|
|
|
\
|
|
|
|
|
MOBase::VersionInfo class_name::version() const \
|
|
|
|
|
{ \
|
|
|
|
|
try { \
|
|
|
|
|
return this->get_override("version")().as<MOBase::VersionInfo>(); \
|
|
|
|
|
} PYCATCH; \
|
|
|
|
|
} \
|
|
|
|
|
\
|
|
|
|
|
bool class_name::isActive() const \
|
|
|
|
|
{ \
|
|
|
|
|
try { \
|
|
|
|
|
return this->get_override("isActive")().as<bool>(); \
|
|
|
|
|
} PYCATCH; \
|
|
|
|
|
} \
|
|
|
|
|
\
|
|
|
|
|
QList<MOBase::PluginSetting> class_name::settings() const \
|
|
|
|
|
{ \
|
|
|
|
|
try { \
|
|
|
|
|
return this->get_override("settings")().as<QList<MOBase::PluginSetting>>(); \
|
|
|
|
|
} PYCATCH; \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// end COMMON_I_PLUGIN_WRAPPER_DEFINITIONS
|
2016-01-10 19:50:19 +01:00
|
|
|
/////////////////////////////
|
|
|
|
|
/// IPlugin Wrapper
|
2018-04-17 21:07:42 +01:00
|
|
|
|
|
|
|
|
|
2018-04-19 00:42:24 +01:00
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginWrapper)
|
2016-01-10 19:50:19 +01:00
|
|
|
/// end IPlugin Wrapper
|
2013-09-01 18:36:43 +02:00
|
|
|
/////////////////////////////////////
|
2018-04-19 00:50:28 +01:00
|
|
|
/// IPluginDiagnose Wrapper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginDiagnoseWrapper)
|
|
|
|
|
|
|
|
|
|
std::vector<unsigned int> IPluginDiagnoseWrapper::activeProblems() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
GILock lock;
|
|
|
|
|
|
|
|
|
|
return this->get_override("activeProblems")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginDiagnoseWrapper::shortDescription(unsigned int key) const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("shortDescription")(key);
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginDiagnoseWrapper::fullDescription(unsigned int key) const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("fullDescription")(key);
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginDiagnoseWrapper::hasGuidedFix(unsigned int key) const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("hasGuidedFix")(key);
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginDiagnoseWrapper::startGuidedFix(unsigned int key) const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
GILock lock;
|
|
|
|
|
|
|
|
|
|
this->get_override("startGuidedFix")(key);
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginDiagnoseWrapper::invalidate()
|
|
|
|
|
{
|
|
|
|
|
IPluginDiagnose::invalidate();
|
|
|
|
|
}
|
|
|
|
|
/// end IPluginDiagnose Wrapper
|
|
|
|
|
/////////////////////////////////////
|
2018-04-19 02:09:27 +01:00
|
|
|
/// IPluginFileMapper Wrapper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginFileMapperWrapper)
|
|
|
|
|
|
|
|
|
|
MappingType IPluginFileMapperWrapper::mappings() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("mappings")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
/// end IPluginFileMapper Wrapper
|
|
|
|
|
/////////////////////////////////////
|
2018-04-17 23:03:08 +01:00
|
|
|
/// IPluginGame Wrapper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::gameName() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("gameName")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginGameWrapper::initializeProfile(const QDir & directory, ProfileSettings settings) const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
this->get_override("initializeProfile")(directory, settings);
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::savegameExtension() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("savegameExtension")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::savegameSEExtension() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("savegameSEExtension")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginGameWrapper::isInstalled() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("isInstalled")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QIcon IPluginGameWrapper::gameIcon() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("gameIcon")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDir IPluginGameWrapper::gameDirectory() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("gameDirectory")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDir IPluginGameWrapper::dataDirectory() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("dataDirectory")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginGameWrapper::setGamePath(const QString & path)
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
this->get_override("setGamePath")(path);
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDir IPluginGameWrapper::documentsDirectory() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("documentsDirectory")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDir IPluginGameWrapper::savesDirectory() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("savesDirectory")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QList<MOBase::ExecutableInfo> IPluginGameWrapper::executables() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("executables")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::steamAPPId() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("steamAPPId")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IPluginGameWrapper::primaryPlugins() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("primaryPlugins")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IPluginGameWrapper::gameVariants() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("gameVariants")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginGameWrapper::setGameVariant(const QString & variant)
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
this->get_override("setGameVariant")(variant);
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::binaryName() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("binaryName")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::gameShortName() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("gameShortName")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IPluginGameWrapper::validShortNames() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("validShortNames")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::gameNexusName() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("gameNexusName")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IPluginGameWrapper::iniFiles() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("iniFiles")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IPluginGameWrapper::DLCPlugins() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("DLCPlugins")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IPluginGameWrapper::CCPlugins() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("CCPlugins")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IPluginGame::LoadOrderMechanism IPluginGameWrapper::loadOrderMechanism() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
2018-04-25 17:25:12 +01:00
|
|
|
return this->get_override("loadOrderMechanism")();
|
2018-04-17 23:08:16 +01:00
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IPluginGame::SortMechanism IPluginGameWrapper::sortMechanism() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-18 12:31:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("sortMechanism")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int IPluginGameWrapper::nexusModOrganizerID() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("nexusModOrganizerID")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int IPluginGameWrapper::nexusGameID() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("nexusGameID")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginGameWrapper::looksValid(QDir const & dir) const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("looksValid")(dir);
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::gameVersion() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("gameVersion")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::getLauncherName() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("getLauncherName")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
2018-04-19 00:42:24 +01:00
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginGameWrapper)
|
2018-04-17 23:03:08 +01:00
|
|
|
|
|
|
|
|
std::map<std::type_index, boost::any> IPluginGameWrapper::featureList() const
|
|
|
|
|
{
|
2018-04-25 17:25:12 +01:00
|
|
|
GILock lock;
|
2018-04-17 23:08:16 +01:00
|
|
|
try {
|
|
|
|
|
return this->get_override("_featureList")();
|
|
|
|
|
} PYCATCH;
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
/// end IPluginGame Wrapper
|
|
|
|
|
/////////////////////////////////////
|
2013-09-01 18:36:43 +02:00
|
|
|
/// IPluginInstallerCustom Wrapper
|
|
|
|
|
|
|
|
|
|
|
2018-04-19 00:42:24 +01:00
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginInstallerCustomWrapper)
|
2013-09-01 18:36:43 +02:00
|
|
|
|
|
|
|
|
unsigned int IPluginInstallerCustomWrapper::priority() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("priority")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginInstallerCustomWrapper::isManualInstaller() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("isManualInstaller")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-16 23:04:03 +02:00
|
|
|
bool IPluginInstallerCustomWrapper::isArchiveSupported(const DirectoryTree &) const
|
2013-09-01 18:36:43 +02:00
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
//return this->get_override("isArchiveSupported")(tree);
|
|
|
|
|
return false;
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginInstallerCustomWrapper::isArchiveSupported(const QString &archiveName) const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("isArchiveSupported")(archiveName);
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::set<QString> IPluginInstallerCustomWrapper::supportedExtensions() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
2014-11-09 14:01:48 +01:00
|
|
|
return this->get_override("supportedExtensions")().as<std::set<QString>>();
|
2013-09-01 18:36:43 +02:00
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IPluginInstaller::EInstallResult IPluginInstallerCustomWrapper::install(GuessedValue<QString> &modName, const QString &archiveName,
|
2018-04-17 22:31:53 +01:00
|
|
|
const QString &version, int modID)
|
2013-09-01 18:36:43 +02:00
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("install")(modName, archiveName, version, modID);
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void IPluginInstallerCustomWrapper::setParentWidget(QWidget *parent)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
this->get_override("setParentWidget")(parent);
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
2018-04-17 21:07:42 +01:00
|
|
|
/// end IPluginInstallerCustom Wrapper
|
|
|
|
|
/////////////////////////////
|
2018-04-20 16:39:58 +01:00
|
|
|
/// IPluginModPage Wrapper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginModPageWrapper)
|
|
|
|
|
|
|
|
|
|
QString IPluginModPageWrapper::displayName() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("displayName")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QIcon IPluginModPageWrapper::icon() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("icon")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QUrl IPluginModPageWrapper::pageURL() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("pageURL")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginModPageWrapper::useIntegratedBrowser() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("useIntegratedBrowser")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginModPageWrapper::handlesDownload(const QUrl & pageURL, const QUrl & downloadURL, MOBase::ModRepositoryFileInfo & fileInfo) const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("handlesDownload")(pageURL, downloadURL, fileInfo);
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginModPageWrapper::setParentWidget(QWidget * widget)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
this->get_override("setParentWidget")(widget);
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
/// end IPluginModPage Wrapper
|
|
|
|
|
/////////////////////////////
|
2018-04-22 00:34:59 +01:00
|
|
|
/// IPluginPreview Wrapper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginPreviewWrapper)
|
|
|
|
|
|
|
|
|
|
std::set<QString> IPluginPreviewWrapper::supportedExtensions() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("supportedExtensions")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QWidget *IPluginPreviewWrapper::genFilePreview(const QString &fileName, const QSize &maxSize) const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
boost::python::object pyVersion = this->get_override("genFilePreview")(fileName, maxSize);
|
|
|
|
|
// We need responsibility for deleting the QWidget to be transferred to C++
|
|
|
|
|
sipAPI()->api_transfer_to(pyVersion.ptr(), 0);
|
|
|
|
|
return boost::python::extract<QWidget *>(pyVersion)();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
/// end IPluginPreview Wrapper
|
|
|
|
|
/////////////////////////////
|
2018-04-17 21:07:42 +01:00
|
|
|
/// IPluginTool Wrapper
|
2013-09-01 18:36:43 +02:00
|
|
|
|
|
|
|
|
|
2018-04-19 00:42:24 +01:00
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginToolWrapper)
|
2018-04-17 21:07:42 +01:00
|
|
|
|
|
|
|
|
QString IPluginToolWrapper::displayName() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("displayName")().as<QString>();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginToolWrapper::tooltip() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("tooltip")().as<QString>();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QIcon IPluginToolWrapper::icon() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
return this->get_override("icon")().as<QIcon>();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginToolWrapper::setParentWidget(QWidget *parent)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
this->get_override("setParentWidget")(parent);
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginToolWrapper::display() const
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
GILock lock;
|
|
|
|
|
|
|
|
|
|
this->get_override("display")();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// end IPluginTool Wrapper
|