Compare commits

..
Author SHA1 Message Date
Tannin b7edde6fa0 custom installers can now set the installation file (and the ncc installer now does) 2014-12-14 16:30:23 +01:00
Tannin 589325d91b - NCC installer can now discover files in other mods (thanks Reunion!) and knows the script extender version 2014-12-13 16:47:11 +01:00
Tannin 994018a491 minor fixes 2014-12-04 19:25:07 +01:00
Tannin 7c8fafc196 several bugfixes from the bugfix-wc that I forgot to backport 2014-11-26 20:21:33 +01:00
Tannin 29c66c621d - updated staging script to use qt5 and to fetch translations from transifex
- removed call to function unavailable in Windows XP
2014-11-11 23:48:22 +01:00
Tannin 7b5f01b49d - bsa parser will now cancel in case of a read error. Before, when attempting to parse a broken bsa it could take forever and continuously allocate memory
- better error message when bsa parsing fails
- slightly better support for font colors in bbcode converter
- configurator now also uses pyqt5
- bugfix: bsa hashing function converted backslashes to slashes instead of the other way around. hash calculation is still often wrong on folder names...
2014-11-09 14:01:48 +01:00
Tannin a738cef190 - moved the hook-recursion-protection to tls
- some code cleanup and consolidation
- hook.dll will now report all of its own exceptions
- some more logging during startup
- changed the way urls are encoded for download requests
- now displaying (one of the) process name(s) while waiting for a program to end
- bugfix: spawned processes were forced to leave the job
2014-09-29 20:35:35 +02:00
Tannin 2bf3ba0984 plugins can now query the list of masters for a plugin 2014-09-10 20:37:17 +02:00
Tannin b76c4a1869 - re-enabled building of loot_cli and started developing against the new api
- extended set of default categories
- more tolerand bbcode parser
- added a few colors for the bbcode parser
- more fixes to qt5 compatibility
- started work on ability to unloading (and thus re-loading) of plugins
- names of plugins are no longer localizable (because those names are also used to store settings)
- added settings to disable individual diagnosis settings
- path of dependencies is now configured in a .pri file instead of environment variablees
- bugfix: if the modid-input is canceled, the id was saved as -1 and wasn't re-requested from the user
- bugfix: moving files with the SHFileOperation-Api didn't update the vfs correctly (still not perfect but better)
- bugfix: attempt to remove the deleter-file seems to have caused error messages for some users
- bugfix: fixed a couple of cases that might have caused the tutorial to hang
2014-09-08 20:37:23 +02:00
Tannin ae8b6a39b0 - browser dialog now has a hidden url-field (for testing only)
- loot_cli is no longer part of this project. I will probably create a fork of loot that allows command-line usage instead
- loot integration now works with such a modified loot version
- integrated loot will now also integrate incompatibility messages in the MO UI
- overwrite-markers are now updated as the list order is changed
- fnis checker will now always allow the user to ignore fnis errors
- plugin interface now has a function to wait for handles returned from startApplication (which can be job or process handles)
- bugfix: non-mo mods sharing the name with regular mods now have a different internal name
- bugfix: using hotkeys the vanilla game-plugins could be moved
2014-07-27 18:34:32 +02:00
TheBloke 2dc9463951 pythonRunner.pro - formatting/consistency fixes
Same types of fixes as previous commit; missed this file.
2014-07-08 00:28:06 +01:00
TheBloke 1d4a4b485d .pro files - formatting/consistency fixes
Many small formatting changes to the majority of .pro files
 Consistent style for Qt version checking, using greaterThan(QT_MAJOR_VERSION, 4)
  This seems safest, as would continue to work for a future Qt 6 etc.
  Note that this makes redudundant the commit before this one, to organizer.pro
 Consistent indenting
 Moved some file configuration sections to be together with related sections
 Moved some installation-related sections (e.g. OUTDIR/DSTDIR) to be at the bottom,
  immediately before the related POST_LINK install lines.
 Similarly, in some cases separated out CONFIG(debug,.. checks into separate
  LIB/INCLUDE sections (high in file) and installation directory sections (low
   in file)
2014-07-07 23:32:18 +01:00
Tannin d5838c7560 - added pseudo-categories to filter for mo-managed vs. unmanaged mods
- deleted mods are now moved to the recycle bin instead of being deleted permanently
- reduced modinfo dialog for foreign mods
- foreign mods are now displayed with a pseudo-category
- added a signal when a plugin is moved
- bugfix: refreshing of directory structure for mods with bsas didn't work correctly when enabling a mod and on changing display of foreign mods
- bugfix: one mod in the list was assigned the same priority on the directory structure as the data directory
- bugfix: conflicts tab in the mod info dialog offered the hide option for files in bsas
2014-06-16 21:49:57 +02:00
Tannin 9cbf374166 - loot client now only updates the masterlist once per MO session
- new event to notify plugins of changed mod priority
- overwrite now shows up in the "checked" category instead of "unchecked"
- display of "foreign" mods can now be limited to only official content
- bugfix: bsa extraction dialog showed up even if the plugin was disabled
- bugfix: after detection of foreign mods the priority of the overwrite folder could get messed up
- bugfix: when displaying only the context menu for the mod list as a whole, the menu didn't disappear
- bugfix: MO crashed when trying to download via the integrated browser
2014-06-08 15:10:08 +02:00
Tannin f71bfff0e6 Merge 2014-05-28 14:23:11 +02:00
Tannin 8aa2ab4eac small bugfixes 2014-05-28 14:14:28 +02:00
Tannin 46a0ce9e38 - files in bsas are now only displayed in the data tab if they are managed by mo
- number of problems detected by MO is now displayed as a badge on the icon
- rephrased the explanation text on the Archives tab. unchecked plugin-loaded bsas no longer prompt a warning
- bsa extraction is now handled in a plugin
- added a way for plugins to react to mod installation
- re-enabled the automatic fix for asset order problems
- bugfix: In some cases when a download wasn't started successfully the download urls weren't stored in the meta file so no resume was possible
- bugfix: MO tried to resume downloads when it didn't have and download urls
- bugfix: downloads couldn't be paused if the download was already broken on the network layer
- bugfix: download managear did not recognize a file as downloaded if the download completed before signals were hooked up
- bugfix: in-place file replacement was re-broken
2014-05-25 15:39:45 +02:00
Tannin 15e635741c - mod list context menu split into two menus (one for whole list, one for selected mods)
- added option to combine category filters using "or"
- added context menu option for deselecting category filters
- slightly changed ui on the category filters
- added a sample plugin for cpp that can be built without building the rest of MO
- simple installer can now be configured to run without any user interaction
- extended interface for python plugins
- iorganizer implementation moved out of the main window
- nexus requests from plugins will now be identified in the user agent
- bugfix: shortcuts created from MO used the wrong working directory
- bugfix: deactivation of bsas didn't stick
- bugfix: file hiding mechanism wasn't active
- bugfix: executables linked on the toolbar couldn't be removed if the executable was removed first
- bugfix: the endorsement-filter couldn't be combined with other filters
- bugfix: python interface to repository bridge was broken
2014-05-13 21:20:44 +02:00
Tannin f56c605479 - bugfix: endless loop in detection of mod order problems 2014-05-04 16:13:35 +02:00
Tannin 617c76e9f8 - main window now has a small view displaying log messages
- mod list will now be highlighted when grouping is active is active
- download tooltip now supports bbcode markup in the description
- bbcode translator will now translate some named colors
- algorithm for detection of mod order problems is now more sophisticated
- exposed more functionality to python plugins
- updated to qt 4.8.6 dlls
- bugfix: plugin list wasn't
- bugfix: state changes in mod list wasn't always reported
- bugfix: loot client will now create necessary directory
- bugfix: NCC sometimes used wrong source path for extracting
- bugfix: removed noisy debug message
2014-05-04 14:50:01 +02:00
Tannin 96081888f1 Merge with branch1.1 2014-04-05 15:36:42 +02:00
Tannin af5958b0af some fixes towards qt5 compatibility 2014-03-16 20:04:57 +01:00
Tannin b33293e49a - bugfix: elevation dialog didn't offer a "yes" option
- bugfix: python plugins crashed the application when trying to create a nexus bridge
- bugfix: python plugins couldn't register for failed requests correctly
2014-01-29 21:06:55 +01:00
Tannin dc3b60e578 - bugfix: accessing profile without loading one when starting an app through the commandline
- bugfix: locked-dialog was disabled
2014-01-27 21:31:10 +01:00
Tannin fee774db45 - added support for mod page plugins
- re-introduced the integrated browser
- added a plugin to download from the tes alliance page
- the download list now contains the file description
- nexus interface now stores cookies persistently to reduce number of required log-ins
2013-09-15 15:20:00 +02:00
11 changed files with 447 additions and 97 deletions
+6 -8
View File
@@ -8,9 +8,7 @@
TARGET = proxyPython
TEMPLATE = lib
contains(QT_VERSION, "^5.*") {
QT += widgets
}
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += plugins
CONFIG += dll
@@ -38,14 +36,14 @@ RC_FILE += \
include(../plugin_template.pri)
INCLUDEPATH += "../../pythonRunner" "$(BOOSTPATH)"
INCLUDEPATH += "../../pythonRunner" "$${BOOSTPATH}"
WINPWD = $$PWD
WINPWD ~= s,/,$$QMAKE_DIR_SEP,g
//QMAKE_POST_LINK += SET VS90COMNTOOLS=%VS100COMNTOOLS% $$escape_expand(\\n)
#QMAKE_POST_LINK += SET VS90COMNTOOLS=%VS100COMNTOOLS% $$escape_expand(\\n)
//QMAKE_POST_LINK += copy $$(PYTHONPATH)\\lib\\site-packages\\sip.pyd $$quote($$DSTDIR)\\plugins\\data\\ $$escape_expand(\\n)
//QMAKE_POST_LINK += copy $$(PYTHONPATH)\\lib\\site-packages\\PyQt4\\QtCore.pyd $$quote($$DSTDIR)\\plugins\\data\\PyQt4\\ $$escape_expand(\\n)
//QMAKE_POST_LINK += copy $$(PYTHONPATH)\\lib\\site-packages\\PyQt4\\QtGui.pyd $$quote($$DSTDIR)\\plugins\\data\\PyQt4\\ $$escape_expand(\\n)
#QMAKE_POST_LINK += copy $$(PYTHONPATH)\\lib\\site-packages\\sip.pyd $$quote($$DSTDIR)\\plugins\\data\\ $$escape_expand(\\n)
#QMAKE_POST_LINK += copy $$(PYTHONPATH)\\lib\\site-packages\\PyQt4\\QtCore.pyd $$quote($$DSTDIR)\\plugins\\data\\PyQt4\\ $$escape_expand(\\n)
#QMAKE_POST_LINK += copy $$(PYTHONPATH)\\lib\\site-packages\\PyQt4\\QtGui.pyd $$quote($$DSTDIR)\\plugins\\data\\PyQt4\\ $$escape_expand(\\n)
+2 -2
View File
@@ -163,7 +163,7 @@ bool ProxyPython::init(IOrganizer *moInfo)
QString ProxyPython::name() const
{
return tr("Python Proxy");
return "Python Proxy";
}
QString ProxyPython::author() const
@@ -178,7 +178,7 @@ QString ProxyPython::description() const
VersionInfo ProxyPython::version() const
{
return VersionInfo(1, 2, 0, VersionInfo::RELEASE_FINAL);
return VersionInfo(1, 3, 1, VersionInfo::RELEASE_FINAL);
}
bool ProxyPython::isActive() const
+2
View File
@@ -1,4 +1,6 @@
#ifndef Q_MOC_RUN
#include <boost/python.hpp>
#endif
#include <QString>
#include <utility.h>
+15 -15
View File
@@ -1,5 +1,5 @@
//#define HAVE_ROUND
#include "proxypluginwrappers.h"
#include <boost/python.hpp>
#include <utility.h>
#include "error.h"
#include "gilock.h"
@@ -27,63 +27,63 @@ bool IPluginToolWrapper::init(MOBase::IOrganizer *moInfo)
QString IPluginToolWrapper::name() const
{
try {
return this->get_override("name")();
return this->get_override("name")().as<QString>();
} PYCATCH;
}
QString IPluginToolWrapper::author() const
{
try {
return this->get_override("author")();
return this->get_override("author")().as<QString>();
} PYCATCH;
}
QString IPluginToolWrapper::description() const
{
try {
return this->get_override("description")();
return this->get_override("description")().as<QString>();
} PYCATCH;
}
MOBase::VersionInfo IPluginToolWrapper::version() const
{
try {
return this->get_override("version")();
return this->get_override("version")().as<MOBase::VersionInfo>();
} PYCATCH;
}
bool IPluginToolWrapper::isActive() const
{
try {
return this->get_override("isActive")();
return this->get_override("isActive")().as<bool>();
} PYCATCH;
}
QList<MOBase::PluginSetting> IPluginToolWrapper::settings() const
{
try {
return this->get_override("settings")();
return this->get_override("settings")().as<QList<MOBase::PluginSetting>>();
} PYCATCH;
}
QString IPluginToolWrapper::displayName() const
{
try {
return this->get_override("displayName")();
return this->get_override("displayName")().as<QString>();
} PYCATCH;
}
QString IPluginToolWrapper::tooltip() const
{
try {
return this->get_override("tooltip")();
return this->get_override("tooltip")().as<QString>();
} PYCATCH;
}
QIcon IPluginToolWrapper::icon() const
{
try {
return this->get_override("icon")();
return this->get_override("icon")().as<QIcon>();
} PYCATCH;
}
@@ -118,21 +118,21 @@ bool IPluginInstallerCustomWrapper::init(MOBase::IOrganizer *moInfo)
QString IPluginInstallerCustomWrapper::name() const
{
try {
return this->get_override("name")();
return this->get_override("name")().as<QString>();
} PYCATCH;
}
QString IPluginInstallerCustomWrapper::author() const
{
try {
return this->get_override("author")();
return this->get_override("author")().as<QString>();
} PYCATCH;
}
QString IPluginInstallerCustomWrapper::description() const
{
try {
return this->get_override("description")();
return this->get_override("description")().as<QString>();
} PYCATCH;
}
@@ -153,7 +153,7 @@ bool IPluginInstallerCustomWrapper::isActive() const
QList<MOBase::PluginSetting> IPluginInstallerCustomWrapper::settings() const
{
try {
return this->get_override("settings")();
return this->get_override("settings")().as<QList<MOBase::PluginSetting>>();
} PYCATCH;
}
@@ -189,7 +189,7 @@ bool IPluginInstallerCustomWrapper::isArchiveSupported(const QString &archiveNam
std::set<QString> IPluginInstallerCustomWrapper::supportedExtensions() const
{
try {
return this->get_override("supportedExtensions")();
return this->get_override("supportedExtensions")().as<std::set<QString>>();
} PYCATCH;
}
-1
View File
@@ -5,7 +5,6 @@
#include <iplugintool.h>
#include <iplugininstallersimple.h>
#include <iplugininstallercustom.h>
#include <iplugindiagnose.h>
#ifndef Q_MOC_RUN
#include <boost/python.hpp>
+24 -10
View File
@@ -13,7 +13,13 @@ CONFIG += warn_on
DEFINES += PYTHONRUNNER_LIBRARY
# suppress a few warnings caused by boost vs vc++ paranoia
DEFINES += _SCL_SECURE_NO_WARNINGS
DEFINES += _SCL_SECURE_NO_WARNINGS -DHAVE_ROUND
!include(../LocalPaths.pri) {
message("paths to required libraries need to be set up in LocalPaths.pri")
}
SOURCES += pythonrunner.cpp \
gilock.cpp \
@@ -28,20 +34,28 @@ HEADERS += pythonrunner.h \
pythonpluginwrapper.h \
proxypluginwrappers.h
CONFIG(debug, debug|release) {
LIBS += -L$$OUT_PWD/../uibase/debug
} else {
LIBS += -L$$OUT_PWD/../uibase/release
QMAKE_CXXFLAGS += /Zi
QMAKE_LFLAGS += /DEBUG
QMAKE_CXXFLAGS += /Zi
QMAKE_LFLAGS += /DEBUG
}
INCLUDEPATH += "$(BOOSTPATH)" "$$(PYTHONPATH)/include" "$$(PYTHONPATH)/Lib/site-packages/PyQt4/include"
LIBS += -L"$$(PYTHONPATH)/libs" -L"$(BOOSTPATH)/stage/lib"
INCLUDEPATH += "$${BOOSTPATH}" "$${PYTHONPATH}/include" "$${PYTHONPATH}/Lib/site-packages/PyQt5/include" ../uibase
LIBS += -L"$${PYTHONPATH}/libs" -L"$${BOOSTPATH}/stage/lib"
LIBS += -lpython27
INCLUDEPATH += ../uibase
LIBS += -luibase
CONFIG(debug, debug|release) {
SRCDIR = $$OUT_PWD/debug
DSTDIR = $$PWD/../../outputd
} else {
SRCDIR = $$OUT_PWD/release
DSTDIR = $$PWD/../../output
}
SRCDIR ~= s,/,$$QMAKE_DIR_SEP,g
DSTDIR ~= s,/,$$QMAKE_DIR_SEP,g
QMAKE_POST_LINK += xcopy /y /I $$quote($$SRCDIR\\$${TARGET}*.pdb) $$quote($$DSTDIR)\\plugins $$escape_expand(\\n)
-1
View File
@@ -99,7 +99,6 @@ QList<MOBase::PluginSetting> PythonPluginWrapper::settings() const
try {
boost::python::object l = m_SettingsFunction();
if (!l.is_none()) {
// boost::python::list l = extract<boost::python::list>(temp);
for (int i = 0; i < boost::python::len(l); ++i) {
result.append(extract<MOBase::PluginSetting>(l[i]));
}
+1
View File
@@ -27,6 +27,7 @@ public:
virtual QList<MOBase::PluginSetting> settings() const;
protected:
void reportPythonError() const;
private:
+243 -39
View File
@@ -1,9 +1,10 @@
#define HAVE_ROUND
#include "pythonrunner.h"
#pragma warning( disable : 4100 )
#pragma warning( disable : 4996 )
#include <boost/python.hpp>
#include <iplugininstaller.h>
#include "uibasewrappers.h"
#include "pythonpluginwrapper.h"
@@ -46,8 +47,9 @@ private:
};
IPythonRunner *CreatePythonRunner(const MOBase::IOrganizer *moInfo, const QString &pythonDir)
IPythonRunner *CreatePythonRunner(MOBase::IOrganizer *moInfo, const QString &pythonDir)
{
s_Organizer = moInfo;
PythonRunner *result = new PythonRunner(moInfo);
if (result->initPython(pythonDir)) {
return result;
@@ -85,6 +87,15 @@ struct QString_to_python_str
}
};
template <typename T>
struct QFlags_to_int
{
static PyObject *convert(const QFlags<T> &flags) {
return bpy::incref(bpy::object(static_cast<int>(flags)).ptr());
}
};
struct QString_from_python_str
{
QString_from_python_str() {
@@ -110,7 +121,6 @@ struct QString_from_python_str
};
template <typename T>
struct GuessedValue_converters
{
@@ -140,7 +150,6 @@ struct GuessedValue_converters
}
}
static void construct(PyObject *objPtr, bpy::converter::rvalue_from_python_stage1_data* data) {
void *storage = ((bpy::converter::rvalue_from_python_storage<GuessedValue<T> >*)data)->storage.bytes;
GuessedValue<T> *result = new (storage) GuessedValue<T>();
@@ -169,6 +178,7 @@ struct QVariant_to_python_obj
static PyObject *convert(const QVariant &var) {
switch (var.type()) {
case QVariant::Int: return PyLong_FromLong(var.toInt());
case QVariant::UInt: return PyLong_FromUnsignedLong(var.toUInt());
case QVariant::Bool: return PyBool_FromLong(var.toBool());
case QVariant::String: return bpy::incref(bpy::object(var.toString().toUtf8().constData()).ptr());
case QVariant::List: {
@@ -179,8 +189,18 @@ struct QVariant_to_python_obj
}
return result;
} break;
case QVariant::Map: {
QVariantMap map = var.toMap();
PyObject *result = PyDict_New();
QMapIterator<QString, QVariant> iter(map);
while (iter.hasNext()) {
iter.next();
PyDict_SetItem(result, convert(iter.key()), convert(iter.value()));
}
return result;
} break;
default: {
PyErr_SetString(PyExc_TypeError, "type unsupported");
PyErr_Format(PyExc_TypeError, "type unsupported: %d", var.type());
throw bpy::error_already_set();
} break;
}
@@ -257,6 +277,7 @@ struct QVariant_from_python_obj
}
};
template <typename T>
struct QList_to_python_list
{
@@ -347,9 +368,21 @@ static const sipAPIDef *sipAPI()
}
struct IModRepositoryBridge_to_python
{
static PyObject *convert(IModRepositoryBridge *bridge)
{
ModRepositoryBridgeWrapper wrapper(bridge);
return bpy::incref(bpy::object(wrapper).ptr());
}
};
template <typename T> struct MetaData;
template <> struct MetaData<IModRepositoryBridge> { static const char *className() { return "MOBase::INexusBridge"; } };
template <> struct MetaData<IModRepositoryBridge> { static const char *className() { return "QObject"; } };
template <> struct MetaData<IDownloadManager> { static const char *className() { return "QObject"; } };
template <> struct MetaData<QObject> { static const char *className() { return "QObject"; } };
template <> struct MetaData<QWidget> { static const char *className() { return "QWidget"; } };
@@ -364,7 +397,6 @@ PyObject *toPyQt(T *objPtr)
qDebug("no input object");
return bpy::incref(Py_None);
}
const sipTypeDef *type = sipAPI()->api_find_type(MetaData<T>::className());
if (type == NULL) {
@@ -380,6 +412,7 @@ PyObject *toPyQt(T *objPtr)
return bpy::incref(sipObj);
}
template <typename T>
struct QClass_converters
{
@@ -507,6 +540,101 @@ struct QInterface_converters
};
int getArgCount(PyObject *object) {
int result = 0;
PyObject *funcCode = PyObject_GetAttrString(object, "func_code");
if (funcCode) {
PyObject *argCount = PyObject_GetAttrString(funcCode, "co_argcount");
if(argCount) {
result = PyInt_AsLong(argCount);
Py_DECREF(argCount);
}
Py_DECREF(funcCode);
}
return result;
}
struct Functor0_converter
{
struct FunctorWrapper
{
FunctorWrapper(boost::python::object callable) : m_Callable(callable) {
}
void operator()() {
GILock lock;
m_Callable();
}
boost::python::object m_Callable;
};
Functor0_converter()
{
bpy::converter::registry::push_back(&convertible, &construct, bpy::type_id<std::function<void()>>());
}
static void *convertible(PyObject *object)
{
if (!PyCallable_Check(object)
|| (getArgCount(object) != 0)) {
return NULL;
}
return object;
}
static void construct(PyObject *object, bpy::converter::rvalue_from_python_stage1_data *data)
{
bpy::object callable(bpy::handle<>(bpy::borrowed(object)));
void *storage = ((bpy::converter::rvalue_from_python_storage<std::function<void()>>*)data)->storage.bytes;
new (storage) std::function<void()>(FunctorWrapper(callable));
data->convertible = storage;
}
};
template <typename PAR1, typename PAR2>
struct Functor2_converter
{
struct FunctorWrapper
{
FunctorWrapper(boost::python::object callable) : m_Callable(callable) {
}
void operator()(const PAR1 &param1, const PAR2 &param2) {
GILock lock;
m_Callable(param1, param2);
}
boost::python::object m_Callable;
};
Functor2_converter()
{
bpy::converter::registry::push_back(&convertible, &construct, bpy::type_id<std::function<void(PAR1, PAR2)>>());
}
static void *convertible(PyObject *object)
{
if (!PyCallable_Check(object)
|| (getArgCount(object) != 2)) {
return NULL;
}
return object;
}
static void construct(PyObject *object, bpy::converter::rvalue_from_python_stage1_data *data)
{
bpy::object callable(bpy::handle<>(bpy::borrowed(object)));
void *storage = ((bpy::converter::rvalue_from_python_storage<std::function<void(PAR1, PAR2)>>*)data)->storage.bytes;
new (storage) std::function<void(PAR1, PAR2)>(FunctorWrapper(callable));
data->convertible = storage;
}
};
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(updateWithQuality, MOBase::GuessedValue<QString>::update, 2, 2)
@@ -519,13 +647,12 @@ BOOST_PYTHON_MODULE(mobase)
bpy::to_python_converter<QString, QString_to_python_str>();
QString_from_python_str();
QClass_converters<QObject>();
//QClass_converters<QObject>();
QClass_converters<QWidget>();
//QClass_converters<QVariant>();
QClass_converters<QIcon>();
QInterface_converters<IModRepositoryBridge>();
QInterface_converters<IDownloadManager>();
bpy::def("toPyQt", &toPyQt<IModRepositoryBridge>);
bpy::def("toPyQt", &toPyQt<IDownloadManager>);
@@ -534,70 +661,120 @@ BOOST_PYTHON_MODULE(mobase)
.value("candidate", MOBase::VersionInfo::RELEASE_CANDIDATE)
.value("beta", MOBase::VersionInfo::RELEASE_BETA)
.value("alpha", MOBase::VersionInfo::RELEASE_ALPHA)
.value("prealpha", MOBase::VersionInfo::RELEASE_PREALPHA);
.value("prealpha", MOBase::VersionInfo::RELEASE_PREALPHA)
;
bpy::enum_<MOBase::VersionInfo::VersionScheme>("VersionScheme")
.value("discover", MOBase::VersionInfo::SCHEME_DISCOVER)
.value("regular", MOBase::VersionInfo::SCHEME_REGULAR)
.value("decimalmark", MOBase::VersionInfo::SCHEME_DECIMALMARK)
.value("numbersandletters", MOBase::VersionInfo::SCHEME_NUMBERSANDLETTERS)
.value("date", MOBase::VersionInfo::SCHEME_DATE)
;
bpy::enum_<MOBase::IPluginInstaller::EInstallResult>("InstallResult")
.value("success", MOBase::IPluginInstaller::RESULT_SUCCESS)
.value("failed", MOBase::IPluginInstaller::RESULT_FAILED)
.value("canceled", MOBase::IPluginInstaller::RESULT_CANCELED)
.value("manualRequested", MOBase::IPluginInstaller::RESULT_MANUALREQUESTED)
.value("notAttempted", MOBase::IPluginInstaller::RESULT_NOTATTEMPTED);
.value("notAttempted", MOBase::IPluginInstaller::RESULT_NOTATTEMPTED)
;
bpy::enum_<MOBase::IGameInfo::Type>("GameType")
.value("oblivion", MOBase::IGameInfo::TYPE_OBLIVION)
.value("fallout3", MOBase::IGameInfo::TYPE_FALLOUT3)
.value("falloutnv", MOBase::IGameInfo::TYPE_FALLOUTNV)
.value("skyrim", MOBase::IGameInfo::TYPE_SKYRIM);
.value("skyrim", MOBase::IGameInfo::TYPE_SKYRIM)
;
bpy::class_<MOBase::VersionInfo>("VersionInfo")
.def(bpy::init<int, int, int, MOBase::VersionInfo::ReleaseType>())
.def("parse", &MOBase::VersionInfo::parse)
.def("canonicalString", &MOBase::VersionInfo::canonicalString);
bpy::class_<VersionInfo>("VersionInfo")
.def(bpy::init<QString>())
.def(bpy::init<QString, VersionInfo::VersionScheme>())
.def(bpy::init<int, int, int>())
.def(bpy::init<int, int, int, VersionInfo::ReleaseType>())
.def("parse", &VersionInfo::parse)
.def("canonicalString", &VersionInfo::canonicalString)
;
bpy::class_<MOBase::PluginSetting>("PluginSetting", bpy::init<const QString&, const QString&, const QVariant&>());
bpy::class_<PluginSetting>("PluginSetting", bpy::init<const QString&, const QString&, const QVariant&>());
bpy::class_<IGameInfoWrapper, boost::noncopyable>("GameInfo")
.def("type", bpy::pure_virtual(&MOBase::IGameInfo::type))
.def("path", bpy::pure_virtual(&MOBase::IGameInfo::path))
.def("binaryName", bpy::pure_virtual(&MOBase::IGameInfo::binaryName));
.def("type", bpy::pure_virtual(&IGameInfo::type))
.def("path", bpy::pure_virtual(&IGameInfo::path))
.def("binaryName", bpy::pure_virtual(&IGameInfo::binaryName))
;
bpy::class_<IOrganizerWrapper, boost::noncopyable>("IOrganizer")
.def("gameInfo", bpy::pure_virtual(&MOBase::IOrganizer::gameInfo), bpy::return_value_policy<bpy::reference_existing_object>())
//.def("createNexusBridge", bpy::pure_virtual(&MOBase::IOrganizer::createNexusBridge), bpy::return_value_policy<bpy::reference_existing_object>())
.def("profileName", bpy::pure_virtual(&MOBase::IOrganizer::profileName))
.def("profilePath", bpy::pure_virtual(&MOBase::IOrganizer::profilePath))
.def("downloadsPath", bpy::pure_virtual(&MOBase::IOrganizer::downloadsPath))
.def("appVersion", bpy::pure_virtual(&MOBase::IOrganizer::appVersion))
.def("getMod", bpy::pure_virtual(&MOBase::IOrganizer::getMod), bpy::return_value_policy<bpy::reference_existing_object>())
.def("createMod", bpy::pure_virtual(&MOBase::IOrganizer::createMod), bpy::return_value_policy<bpy::reference_existing_object>())
.def("removeMod", bpy::pure_virtual(&MOBase::IOrganizer::removeMod))
.def("modDataChanged", bpy::pure_virtual(&MOBase::IOrganizer::modDataChanged))
.def("gameInfo", bpy::pure_virtual(&IOrganizer::gameInfo), bpy::return_value_policy<bpy::reference_existing_object>())
.def("createNexusBridge", bpy::pure_virtual(&IOrganizer::createNexusBridge), bpy::return_value_policy<bpy::reference_existing_object>())
.def("profileName", bpy::pure_virtual(&IOrganizer::profileName))
.def("profilePath", bpy::pure_virtual(&IOrganizer::profilePath))
.def("downloadsPath", bpy::pure_virtual(&IOrganizer::downloadsPath))
.def("appVersion", bpy::pure_virtual(&IOrganizer::appVersion))
.def("getMod", bpy::pure_virtual(&IOrganizer::getMod), bpy::return_value_policy<bpy::reference_existing_object>())
.def("createMod", bpy::pure_virtual(&IOrganizer::createMod), bpy::return_value_policy<bpy::reference_existing_object>())
.def("removeMod", bpy::pure_virtual(&IOrganizer::removeMod))
.def("modDataChanged", bpy::pure_virtual(&IOrganizer::modDataChanged))
.def("pluginSetting", bpy::pure_virtual(&IOrganizer::pluginSetting))
.def("setPluginSetting", bpy::pure_virtual(&IOrganizer::pluginSetting))
.def("persistent", bpy::pure_virtual(&IOrganizer::persistent))
.def("setPersistent", bpy::pure_virtual(&IOrganizer::setPersistent))
.def("pluginDataPath", bpy::pure_virtual(&IOrganizer::pluginDataPath))
.def("installMod", bpy::pure_virtual(&IOrganizer::installMod))
.def("installMod", bpy::pure_virtual(&IOrganizer::installMod), bpy::return_value_policy<bpy::reference_existing_object>())
.def("downloadManager", bpy::pure_virtual(&IOrganizer::downloadManager), bpy::return_value_policy<bpy::reference_existing_object>())
.def("pluginList", bpy::pure_virtual(&IOrganizer::pluginList), bpy::return_value_policy<bpy::reference_existing_object>())
.def("modList", bpy::pure_virtual(&IOrganizer::modList), bpy::return_value_policy<bpy::reference_existing_object>())
.def("startApplication", bpy::pure_virtual(&IOrganizer::startApplication), bpy::return_value_policy<bpy::return_by_value>())
.def("waitForApplication", bpy::pure_virtual(&IOrganizer::waitForApplication), bpy::return_value_policy<bpy::return_by_value>())
.def("onAboutToRun", bpy::pure_virtual(&IOrganizer::onAboutToRun))
.def("onModInstalled", bpy::pure_virtual(&IOrganizer::onModInstalled))
.def("refreshModList", bpy::pure_virtual(&IOrganizer::refreshModList))
;
bpy::class_<ModRepositoryBridgeWrapper, boost::noncopyable>("ModRepositoryBridge")
.def(bpy::init<IModRepositoryBridge*>())
.def("requestDescription", &ModRepositoryBridgeWrapper::requestDescription)
.def("requestFiles", &ModRepositoryBridgeWrapper::requestFiles)
.def("requestFileInfo", &ModRepositoryBridgeWrapper::requestFileInfo)
.def("requestDownloadURL", &ModRepositoryBridgeWrapper::requestDownloadURL)
.def("requestToggleEndorsement", &ModRepositoryBridgeWrapper::requestToggleEndorsement)
.def("onFilesAvailable", &ModRepositoryBridgeWrapper::onFilesAvailable)
.def("onRequestFailed", &ModRepositoryBridgeWrapper::onRequestFailed);
.def("onFileInfoAvailable", &ModRepositoryBridgeWrapper::onFileInfoAvailable)
.def("onDescriptionAvailable", &ModRepositoryBridgeWrapper::onDescriptionAvailable)
.def("onEndorsementToggled", &ModRepositoryBridgeWrapper::onEndorsementToggled)
.def("onRequestFailed", &ModRepositoryBridgeWrapper::onRequestFailed)
;
bpy::class_<IModRepositoryBridgeWrapper, boost::noncopyable>("IModRepositoryBridge")
.def("requestDescription", bpy::pure_virtual(&IModRepositoryBridge::requestDescription))
.def("requestFiles", bpy::pure_virtual(&IModRepositoryBridge::requestFiles))
.def("requestFileInfo", bpy::pure_virtual(&IModRepositoryBridge::requestFileInfo))
.def("requestDownloadURL", bpy::pure_virtual(&IModRepositoryBridge::requestDownloadURL))
.def("requestToggleEndorsement", bpy::pure_virtual(&IModRepositoryBridge::requestToggleEndorsement))
;
bpy::class_<IDownloadManagerWrapper, boost::noncopyable>("IDownloadManager")
.def("startDownloadURLs", bpy::pure_virtual(&IDownloadManager::startDownloadURLs))
.def("startDownloadNexusFile", bpy::pure_virtual(&IDownloadManager::startDownloadNexusFile))
.def("downloadPath", bpy::pure_virtual(&IDownloadManager::downloadPath));
.def("downloadPath", bpy::pure_virtual(&IDownloadManager::downloadPath))
;
bpy::class_<IInstallationManagerWrapper, boost::noncopyable>("IInstallationManager")
.def("extractFile", bpy::pure_virtual(&IInstallationManager::extractFile))
.def("extractFiles", bpy::pure_virtual(&IInstallationManager::extractFiles))
.def("installArchive", bpy::pure_virtual(&IInstallationManager::installArchive))
;
bpy::class_<IModInterfaceWrapper, boost::noncopyable>("IModInterface")
.def("name", bpy::pure_virtual(&IModInterface::name))
.def("absolutePath", bpy::pure_virtual(&IModInterface::absolutePath))
.def("setVersion", bpy::pure_virtual(&IModInterface::setVersion))
.def("setNewestVersion", bpy::pure_virtual(&IModInterface::setNewestVersion))
.def("setIsEndorsed", bpy::pure_virtual(&IModInterface::setIsEndorsed))
.def("setNexusID", bpy::pure_virtual(&IModInterface::setNexusID))
.def("addNexusCategory", bpy::pure_virtual(&IModInterface::addNexusCategory))
.def("setName", bpy::pure_virtual(&IModInterface::setName))
.def("remove", bpy::pure_virtual(&IModInterface::remove))
;
bpy::enum_<MOBase::EGuessQuality>("GuessQuality")
.value("invalid", MOBase::GUESS_INVALID)
@@ -605,18 +782,45 @@ BOOST_PYTHON_MODULE(mobase)
.value("good", MOBase::GUESS_GOOD)
.value("meta", MOBase::GUESS_META)
.value("preset", MOBase::GUESS_PRESET)
.value("user", MOBase::GUESS_USER);
.value("user", MOBase::GUESS_USER)
;
bpy::class_<MOBase::GuessedValue<QString>, boost::noncopyable>("GuessedString")
.def("update",
static_cast<GuessedValue<QString> &(GuessedValue<QString>::*)(const QString&, EGuessQuality)>(&GuessedValue<QString>::update),
bpy::return_value_policy<bpy::reference_existing_object>(), updateWithQuality())
.def("variants", &MOBase::GuessedValue<QString>::variants, bpy::return_value_policy<bpy::copy_const_reference>());
.def("variants", &MOBase::GuessedValue<QString>::variants, bpy::return_value_policy<bpy::copy_const_reference>())
;
bpy::class_<IPluginToolWrapper, boost::noncopyable>("IPluginTool")
.def("setParentWidget", bpy::pure_virtual(&MOBase::IPluginTool::setParentWidget));
.def("setParentWidget", bpy::pure_virtual(&MOBase::IPluginTool::setParentWidget))
;
bpy::class_<IPluginInstallerCustomWrapper, boost::noncopyable>("IPluginInstallerCustom")
.def("setParentWidget", bpy::pure_virtual(&MOBase::IPluginInstallerCustom::setParentWidget));
.def("setParentWidget", bpy::pure_virtual(&MOBase::IPluginInstallerCustom::setParentWidget))
;
Functor0_converter(); // converter for the onRefreshed-callback
bpy::class_<IPluginListWrapper, boost::noncopyable>("IPluginList")
.def("state", bpy::pure_virtual(&MOBase::IPluginList::state))
.def("priority", bpy::pure_virtual(&MOBase::IPluginList::priority))
.def("loadOrder", bpy::pure_virtual(&MOBase::IPluginList::loadOrder))
.def("isMaster", bpy::pure_virtual(&MOBase::IPluginList::isMaster))
.def("masters", bpy::pure_virtual(&MOBase::IPluginList::masters))
.def("origin", bpy::pure_virtual(&MOBase::IPluginList::origin))
.def("onRefreshed", bpy::pure_virtual(&MOBase::IPluginList::onRefreshed))
.def("onPluginMoved", bpy::pure_virtual(&MOBase::IPluginList::onPluginMoved))
;
bpy::to_python_converter<IModList::ModStates, QFlags_to_int<IModList::ModState>>();
Functor2_converter<const QString&, IModList::ModStates>(); // converter for the onModStateChanged-callback
bpy::class_<IModListWrapper, boost::noncopyable>("IModList")
.def("displayName", bpy::pure_virtual(&MOBase::IModList::displayName))
.def("state", bpy::pure_virtual(&MOBase::IModList::state))
.def("priority", bpy::pure_virtual(&MOBase::IModList::priority))
.def("setPriority", bpy::pure_virtual(&MOBase::IModList::setPriority))
.def("onModStateChanged", bpy::pure_virtual(&MOBase::IModList::onModStateChanged))
.def("onModMoved", bpy::pure_virtual(&MOBase::IModList::onModMoved))
;
GuessedValue_converters<QString>();
+1 -1
View File
@@ -22,7 +22,7 @@ public:
#define PYDLLEXPORT Q_DECL_IMPORT
#endif // PYTHONRUNNER_LIBRARY
extern "C" PYDLLEXPORT IPythonRunner *CreatePythonRunner(const MOBase::IOrganizer *moInfo, const QString &pythonDir);
extern "C" PYDLLEXPORT IPythonRunner *CreatePythonRunner(MOBase::IOrganizer *moInfo, const QString &pythonDir);
+153 -20
View File
@@ -3,7 +3,9 @@
#ifndef Q_MOC_RUN
#pragma warning (push, 0)
#include <boost/python.hpp>
#pragma warning (pop)
#endif
#include <QString>
@@ -11,6 +13,8 @@
#include <imoinfo.h>
#include <igameinfo.h>
#include <imodrepositorybridge.h>
#include <imodinterface.h>
#include <iinstallationmanager.h>
#include "error.h"
#include "gilock.h"
@@ -51,8 +55,6 @@ public:
{ m_Wrapped->requestFiles(modID, userData); }
void requestFileInfo(int modID, int fileID, QVariant userData)
{ m_Wrapped->requestFileInfo(modID, fileID, userData); }
void requestDownloadURL(int modID, int fileID, QVariant userData)
{ m_Wrapped->requestDownloadURL(modID, fileID, userData); }
void requestToggleEndorsement(int modID, bool endorse, QVariant userData)
{ m_Wrapped->requestToggleEndorsement(modID, endorse, userData); }
@@ -63,10 +65,31 @@ public:
Qt::UniqueConnection);
}
void onDescriptionAvailable(boost::python::object callback) {
m_DescriptionAvailableHandler = callback;
connect(m_Wrapped, SIGNAL(descriptionAvailable(int,QVariant,QVariant)),
this, SLOT(descriptionAvailable(int,QVariant,QVariant)),
Qt::UniqueConnection);
}
void onFileInfoAvailable(boost::python::object callback) {
m_FileInfoHandler = callback;
connect(m_Wrapped, SIGNAL(fileInfoAvailable(int,int,QVariant,QVariant)),
this, SLOT(fileInfoAvailable(int,int,QVariant,QVariant)),
Qt::UniqueConnection);
}
void onEndorsementToggled(boost::python::object callback) {
m_EndorsementToggledHandler = callback;
connect(m_Wrapped, SIGNAL(endorsementToggled(int,QVariant,QVariant)),
this, SLOT(endorsementToggled(int,QVariant,QVariant)),
Qt::UniqueConnection);
}
void onRequestFailed(boost::python::object callback) {
m_FailedHandler = callback;
connect(m_Wrapped, SIGNAL(requestFailed(int,QVariant,QString)),
this, SLOT(requestFailed(int,QVariant,QString)),
connect(m_Wrapped, SIGNAL(requestFailed(int,int,QVariant,QString)),
this, SLOT(requestFailed(int,int,QVariant,QString)),
Qt::UniqueConnection);
}
@@ -82,20 +105,78 @@ private slots:
qCritical("no handler connected");
return;
}
// try {
try {
GILock lock;
m_FilesAvailableHandler(modID, userData, resultData);
// } catch (const boost::python::error_already_set&) {
// qDebug("error");
//reportPythonError();
// }
} catch (const boost::python::error_already_set&) {
reportPythonError();
}
}
void requestFailed(int modID, QVariant userData, const QString &errorMessage)
void descriptionAvailable(int modID, QVariant userData, const QVariant resultData)
{
try {
if (m_DescriptionAvailableHandler.is_none()) {
qCritical("no handler connected");
return;
}
try {
GILock lock;
m_DescriptionAvailableHandler(modID, userData, resultData);
} catch (const boost::python::error_already_set&) {
reportPythonError();
}
} catch (const std::exception &e) {
qCritical("failed to report event: %s", e.what());
} catch (...) {
qCritical("failed to report event");
}
}
void fileInfoAvailable(int modID, int fileID, QVariant userData, const QVariant resultData) {
try {
if (m_FileInfoHandler.is_none()) {
qCritical("no handler connected");
return;
}
try {
GILock lock;
m_FileInfoHandler(modID, fileID, userData, resultData);
} catch (const boost::python::error_already_set&) {
reportPythonError();
}
} catch (const std::exception &e) {
qCritical("failed to report event: %s", e.what());
} catch (...) {
qCritical("failed to report event");
}
}
void endorsementToggled(int modID, QVariant userData, const QVariant resultData)
{
try {
if (m_EndorsementToggledHandler.is_none()) {
qCritical("no handler connected");
return;
}
try {
GILock lock;
m_EndorsementToggledHandler(modID, userData, resultData);
} catch (const boost::python::error_already_set&) {
reportPythonError();
}
} catch (const std::exception &e) {
qCritical("failed to report event: %s", e.what());
} catch (...) {
qCritical("failed to report event");
}
}
void requestFailed(int modID, int fileID, QVariant userData, const QString &errorMessage)
{
try {
GILock lock;
m_FailedHandler(modID, userData, errorMessage);
m_FailedHandler(modID, fileID, userData, errorMessage);
} catch (const boost::python::error_already_set&) {
reportPythonError();
}
@@ -105,24 +186,24 @@ private:
MOBase::IModRepositoryBridge *m_Wrapped;
boost::python::object m_FilesAvailableHandler;
boost::python::object m_DescriptionAvailableHandler;
boost::python::object m_FileInfoHandler;
boost::python::object m_EndorsementToggledHandler;
boost::python::object m_FailedHandler;
};
struct IOrganizerWrapper: MOBase::IOrganizer, boost::python::wrapper<MOBase::IOrganizer>
{
virtual MOBase::IGameInfo &gameInfo() const {
MOBase::IGameInfo *result = this->get_override("gameInfo")();
return *result;
}
virtual MOBase::IModRepositoryBridge *createNexusBridge() const {
return this->get_override("createNexusBridge")();
}
virtual MOBase::IModRepositoryBridge *createNexusBridge() const { return this->get_override("createNexusBridge")(); }
virtual QString profileName() const { return this->get_override("profileName")(); }
virtual QString profilePath() const { return this->get_override("profilePath")(); }
virtual QString downloadsPath() const { return this->get_override("downloadsPath")(); }
virtual QString overwritePath() const { return this->get_override("overwritePath")(); }
virtual MOBase::VersionInfo appVersion() const { return this->get_override("appVersion")(); }
virtual MOBase::IModInterface *getMod(const QString &name) { return this->get_override("getMod")(name); }
virtual MOBase::IModInterface *createMod(MOBase::GuessedValue<QString> &name) { return this->get_override("createMod")(name); }
@@ -133,17 +214,20 @@ struct IOrganizerWrapper: MOBase::IOrganizer, boost::python::wrapper<MOBase::IOr
virtual QVariant persistent(const QString &pluginName, const QString &key, const QVariant &def = QVariant()) const { return this->get_override("persistent")(pluginName, key, def); }
virtual void setPersistent(const QString &pluginName, const QString &key, const QVariant &value, bool sync = true) { this->get_override("setPersistent")(pluginName, key, value, sync); }
virtual QString pluginDataPath() const { return this->get_override("pluginDataPath")(); }
virtual void installMod(const QString &fileName) { this->get_override("installMod")(fileName); }
virtual MOBase::IModInterface *installMod(const QString &fileName) { return this->get_override("installMod")(fileName); }
virtual MOBase::IDownloadManager *downloadManager() { return this->get_override("downloadManager")(); }
virtual MOBase::IPluginList *pluginList() { return this->get_override("pluginList")(); }
virtual MOBase::IModList *modList() { return this->get_override("modList")(); }
virtual QString resolvePath(const QString &fileName) const { return this->get_override("resolvePath")(fileName); }
virtual QStringList listDirectories(const QString &directoryName) const { return this->get_override("listDirectories")(directoryName); }
virtual QStringList findFiles(const QString &path, const std::function<bool(const QString&)> &filter) const { return this->get_override("findFiles")(path, filter); }
virtual QStringList getFileOrigins(const QString &fileName) const { return this->get_override("getFileOrigin")(fileName); }
virtual QList<FileInfo> findFileInfos(const QString &path, const std::function<bool(const FileInfo&)> &filter) const { return this->get_override("findFileInfos")(path, filter); }
virtual HANDLE startApplication(const QString &executable, const QStringList &args = QStringList(), const QString &cwd = "", const QString &profile = "") { return this->get_override("startApplication")(executable, args, cwd, profile); }
virtual bool onAboutToRun(const std::function<bool(const QString&)> &func) { return this->get_override("onAboutToRun")(func); }
virtual bool waitForApplication(HANDLE handle, LPDWORD exitCode = NULL) const { return this->get_override("waitForApplication")(handle, exitCode); }
virtual void refreshModList(bool saveChanges = true) { this->get_override("refreshModList")(saveChanges); }
virtual bool onAboutToRun(const std::function<bool(const QString&)> &func) { return this->get_override("onAboutToRun")(func); }
virtual bool onModInstalled(const std::function<void(const QString&)> &func) { return this->get_override("onModInstalled")(func); }
};
struct IDownloadManagerWrapper: MOBase::IDownloadManager, boost::python::wrapper<MOBase::IDownloadManager>
@@ -151,8 +235,22 @@ struct IDownloadManagerWrapper: MOBase::IDownloadManager, boost::python::wrapper
virtual int startDownloadURLs(const QStringList &urls) { return this->get_override("downloadURLs")(urls); }
virtual int startDownloadNexusFile(int modID, int fileID) { return this->get_override("downloadNexusFile")(modID, fileID); }
virtual QString downloadPath(int id) { return this->get_override("downloadPath")(id); }
private:
boost::python::object m_DownloadCompleteHandler;
};
struct IModRepositoryBridgeWrapper: MOBase::IModRepositoryBridge, boost::python::wrapper<MOBase::IModRepositoryBridge>
{
virtual void requestDescription(int modID, QVariant userData) { this->get_override("requestDescription")(modID, userData); }
virtual void requestFiles(int modID, QVariant userData) { this->get_override("requestFiles")(modID, userData); }
virtual void requestFileInfo(int modID, int fileID, QVariant userData) { this->get_override("requestFileInfo")(modID, fileID, userData); }
virtual void requestDownloadURL(int modID, int fileID, QVariant userData) { this->get_override("requestDownloadURL")(modID, fileID, userData); }
virtual void requestToggleEndorsement(int modID, bool endorse, QVariant userData) { this->get_override("requestToggleEndorsement")(modID, endorse, userData); }
};
struct IInstallationManagerWrapper: MOBase::IInstallationManager, boost::python::wrapper<MOBase::IInstallationManager>
{
virtual QString extractFile(const QString &fileName) { return this->get_override("extractFile")(fileName); }
virtual QStringList extractFiles(const QStringList &files, bool flatten) { return this->get_override("extractFiles")(files, flatten); }
virtual MOBase::IPluginInstaller::EInstallResult installArchive(MOBase::GuessedValue<QString> &modName, const QString &archiveFile) { return this->get_override("installArchive")(modName, archiveFile); }
};
struct IGameInfoWrapper: MOBase::IGameInfo, boost::python::wrapper<MOBase::IGameInfo>
@@ -162,5 +260,40 @@ struct IGameInfoWrapper: MOBase::IGameInfo, boost::python::wrapper<MOBase::IGame
virtual QString binaryName() const { return this->get_override("binaryName")(); }
};
struct IModInterfaceWrapper: MOBase::IModInterface, boost::python::wrapper<MOBase::IModInterface>
{
virtual QString name() const { return this->get_override("name")(); }
virtual QString absolutePath() const { return this->get_override("absolutePath")(); }
virtual void setVersion(const MOBase::VersionInfo &version) { this->get_override("setVersion")(version); }
virtual void setNewestVersion(const MOBase::VersionInfo &version) { this->get_override("setNewestVersion")(version); }
virtual void setIsEndorsed(bool endorsed) { this->get_override("setIsEndorsed")(endorsed); }
virtual void setNexusID(int nexusID) { this->get_override("setNexusID")(nexusID); }
virtual void setInstallationFile(const QString &fileName) { this->get_override("setInstallationFile")(fileName); }
virtual void addNexusCategory(int categoryID) { this->get_override("addNexusCategory")(categoryID); }
virtual bool setName(const QString &name) { return this->get_override("setName")(name); }
virtual bool remove() { return this->get_override("remove")(); }
};
struct IPluginListWrapper: MOBase::IPluginList, boost::python::wrapper<MOBase::IPluginList> {
virtual PluginState state(const QString &name) const { return this->get_override("state")(name); }
virtual int priority(const QString &name) const { return this->get_override("priority")(name); }
virtual int loadOrder(const QString &name) const { return this->get_override("loadOrder")(name); }
virtual bool isMaster(const QString &name) const { return this->get_override("isMaster")(name); }
virtual QStringList masters(const QString &name) const { return this->get_override("masters")(name); }
virtual QString origin(const QString &name) const { return this->get_override("origin")(name); }
virtual bool onRefreshed(const std::function<void ()> &callback) { return this->get_override("onRefreshed")(callback); }
virtual bool onPluginMoved(const std::function<void (const QString &, int, int)> &callback) { return this->get_override("onPluginMoved")(callback); }
};
struct IModListWrapper: MOBase::IModList, boost::python::wrapper<MOBase::IModList> {
virtual QString displayName(const QString &internalName) const { return this->get_override("displayName")(internalName); }
virtual ModStates state(const QString &name) const { return this->get_override("state")(name); }
virtual int priority(const QString &name) const { return this->get_override("priority")(name); }
virtual bool setPriority(const QString &name, int newPriority) { return this->get_override("setPriority")(name, newPriority); }
virtual bool onModStateChanged(const std::function<void (const QString &, ModStates)> &func) { return this->get_override("onModStateChanged")(func); }
virtual bool onModMoved(const std::function<void (const QString &, int, int)> &func) { return this->get_override("onModMoved")(func); }
};
#endif // UIBASEWRAPPERS_H