From e7e686c3619dd16eafc7d780facf3de5c079f189 Mon Sep 17 00:00:00 2001 From: Tannin Date: Mon, 18 Aug 2014 23:00:25 +0200 Subject: [PATCH 1/7] - can now filter by mod content - all files/directories that require write access can now be placed in AppData instead of the MO directory --- src/proxy/proxypython.cpp | 1 + src/runner/uibasewrappers.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/proxy/proxypython.cpp b/src/proxy/proxypython.cpp index 5d72e29..0ed3b4b 100644 --- a/src/proxy/proxypython.cpp +++ b/src/proxy/proxypython.cpp @@ -73,6 +73,7 @@ QString ExtractResource(WORD resourceID, const QString &szFilename) UnmapViewOfFile(lpAddress); CloseHandle(hFileMap); + ::FlushFileBuffers(hFile); CloseHandle(hFile); return outFile; diff --git a/src/runner/uibasewrappers.h b/src/runner/uibasewrappers.h index af25b6d..cbfcc39 100644 --- a/src/runner/uibasewrappers.h +++ b/src/runner/uibasewrappers.h @@ -220,6 +220,7 @@ struct IOrganizerWrapper: MOBase::IOrganizer, boost::python::wrapperget_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 &filter) const { return this->get_override("findFiles")(path, filter); } + virtual QStringList getFileOrigins(const QString &fileName) const { return this->get_override("getFileOrigins")(fileName); } virtual QList findFileInfos(const QString &path, const std::function &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 waitForApplication(HANDLE handle, LPDWORD exitCode = NULL) const { return this->get_override("waitForApplication")(handle, exitCode); } From 84fe2b0307b4dcc21880e2ae629e09b6ae218743 Mon Sep 17 00:00:00 2001 From: Tannin Date: Mon, 8 Sep 2014 20:37:23 +0200 Subject: [PATCH 2/7] - 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 --- src/proxy/proxyPython.pro | 2 +- src/proxy/proxypython.cpp | 2 +- src/runner/error.cpp | 2 ++ src/runner/proxypluginwrappers.h | 1 - src/runner/pythonRunner.pro | 12 +++++++++--- src/runner/pythonrunner.cpp | 1 - 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/proxy/proxyPython.pro b/src/proxy/proxyPython.pro index c8cc51f..eaa3614 100644 --- a/src/proxy/proxyPython.pro +++ b/src/proxy/proxyPython.pro @@ -36,7 +36,7 @@ RC_FILE += \ include(../plugin_template.pri) -INCLUDEPATH += "../../pythonRunner" "$(BOOSTPATH)" +INCLUDEPATH += "../../pythonRunner" "$${BOOSTPATH}" WINPWD = $$PWD WINPWD ~= s,/,$$QMAKE_DIR_SEP,g diff --git a/src/proxy/proxypython.cpp b/src/proxy/proxypython.cpp index 0ed3b4b..2592b7f 100644 --- a/src/proxy/proxypython.cpp +++ b/src/proxy/proxypython.cpp @@ -164,7 +164,7 @@ bool ProxyPython::init(IOrganizer *moInfo) QString ProxyPython::name() const { - return tr("Python Proxy"); + return "Python Proxy"; } QString ProxyPython::author() const diff --git a/src/runner/error.cpp b/src/runner/error.cpp index a1ae993..62a2346 100644 --- a/src/runner/error.cpp +++ b/src/runner/error.cpp @@ -1,4 +1,6 @@ +#ifndef Q_MOC_RUN #include +#endif #include #include diff --git a/src/runner/proxypluginwrappers.h b/src/runner/proxypluginwrappers.h index 49e87df..089ce35 100644 --- a/src/runner/proxypluginwrappers.h +++ b/src/runner/proxypluginwrappers.h @@ -5,7 +5,6 @@ #include #include #include -#include #ifndef Q_MOC_RUN #include diff --git a/src/runner/pythonRunner.pro b/src/runner/pythonRunner.pro index aa11767..dbffac8 100644 --- a/src/runner/pythonRunner.pro +++ b/src/runner/pythonRunner.pro @@ -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 \ @@ -36,8 +42,8 @@ CONFIG(debug, debug|release) { 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/PyQt4/include" +LIBS += -L"$${PYTHONPATH}/libs" -L"$${BOOSTPATH}/stage/lib" LIBS += -lpython27 INCLUDEPATH += ../uibase diff --git a/src/runner/pythonrunner.cpp b/src/runner/pythonrunner.cpp index 8c5760c..d79a695 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -5,7 +5,6 @@ #pragma warning( disable : 4100 ) #pragma warning( disable : 4996 ) -#include #include #include "uibasewrappers.h" #include "pythonpluginwrapper.h" From fa09fd76356c965127d8f216f88ab39b8159f0d7 Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 10 Sep 2014 20:37:17 +0200 Subject: [PATCH 3/7] plugins can now query the list of masters for a plugin --- src/runner/pythonrunner.cpp | 2 ++ src/runner/uibasewrappers.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/runner/pythonrunner.cpp b/src/runner/pythonrunner.cpp index d79a695..719981c 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -725,6 +725,7 @@ BOOST_PYTHON_MODULE(mobase) .def("pluginList", bpy::pure_virtual(&IOrganizer::pluginList), bpy::return_value_policy()) .def("modList", bpy::pure_virtual(&IOrganizer::modList), bpy::return_value_policy()) .def("startApplication", bpy::pure_virtual(&IOrganizer::startApplication), bpy::return_value_policy()) + .def("waitForApplication", bpy::pure_virtual(&IOrganizer::waitForApplication), bpy::return_value_policy()) .def("onAboutToRun", bpy::pure_virtual(&IOrganizer::onAboutToRun)) .def("onModInstalled", bpy::pure_virtual(&IOrganizer::onModInstalled)) .def("refreshModList", bpy::pure_virtual(&IOrganizer::refreshModList)) @@ -804,6 +805,7 @@ BOOST_PYTHON_MODULE(mobase) .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)) diff --git a/src/runner/uibasewrappers.h b/src/runner/uibasewrappers.h index cbfcc39..354346a 100644 --- a/src/runner/uibasewrappers.h +++ b/src/runner/uibasewrappers.h @@ -278,6 +278,7 @@ struct IPluginListWrapper: MOBase::IPluginList, boost::python::wrapperget_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 &callback) { return this->get_override("onRefreshed")(callback); } virtual bool onPluginMoved(const std::function &callback) { return this->get_override("onPluginMoved")(callback); } From 2c661da2da200225b0aba958cbfaa7349c071955 Mon Sep 17 00:00:00 2001 From: Tannin Date: Mon, 29 Sep 2014 20:35:35 +0200 Subject: [PATCH 4/7] - 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 --- src/proxy/proxyPython.pro | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/proxy/proxyPython.pro b/src/proxy/proxyPython.pro index eaa3614..f1a0f86 100644 --- a/src/proxy/proxyPython.pro +++ b/src/proxy/proxyPython.pro @@ -41,9 +41,9 @@ 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) From 573be8c6b5b782ea479a76906456aa9a4174dd56 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sun, 9 Nov 2014 14:01:48 +0100 Subject: [PATCH 5/7] - 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... --- src/runner/proxypluginwrappers.cpp | 31 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/runner/proxypluginwrappers.cpp b/src/runner/proxypluginwrappers.cpp index bade563..ddaaf04 100644 --- a/src/runner/proxypluginwrappers.cpp +++ b/src/runner/proxypluginwrappers.cpp @@ -1,4 +1,4 @@ -#define HAVE_ROUND +//#define HAVE_ROUND #include "proxypluginwrappers.h" #include #include "error.h" @@ -27,63 +27,64 @@ bool IPluginToolWrapper::init(MOBase::IOrganizer *moInfo) QString IPluginToolWrapper::name() const { try { - return this->get_override("name")(); + return this->get_override("name")().as(); } PYCATCH; } QString IPluginToolWrapper::author() const { try { - return this->get_override("author")(); + return this->get_override("author")().as(); } PYCATCH; } QString IPluginToolWrapper::description() const { try { - return this->get_override("description")(); + return this->get_override("description")().as(); } PYCATCH; } MOBase::VersionInfo IPluginToolWrapper::version() const { try { - return this->get_override("version")(); + return this->get_override("version")().as(); } PYCATCH; } bool IPluginToolWrapper::isActive() const { try { - return this->get_override("isActive")(); + return this->get_override("isActive")().as(); } PYCATCH; } QList IPluginToolWrapper::settings() const { try { - return this->get_override("settings")(); + return this->get_override("settings")().as>(); } PYCATCH; } QString IPluginToolWrapper::displayName() const { try { - return this->get_override("displayName")(); + return this->get_override("displayName")().as(); } PYCATCH; } QString IPluginToolWrapper::tooltip() const { try { - return this->get_override("tooltip")(); + return this->get_override("tooltip")().as(); } PYCATCH; } QIcon IPluginToolWrapper::icon() const { try { - return this->get_override("icon")(); +qDebug("%p", this->get_override("icon").ptr()); + return this->get_override("icon")().as(); } PYCATCH; } @@ -118,21 +119,21 @@ bool IPluginInstallerCustomWrapper::init(MOBase::IOrganizer *moInfo) QString IPluginInstallerCustomWrapper::name() const { try { - return this->get_override("name")(); + return this->get_override("name")().as(); } PYCATCH; } QString IPluginInstallerCustomWrapper::author() const { try { - return this->get_override("author")(); + return this->get_override("author")().as(); } PYCATCH; } QString IPluginInstallerCustomWrapper::description() const { try { - return this->get_override("description")(); + return this->get_override("description")().as(); } PYCATCH; } @@ -153,7 +154,7 @@ bool IPluginInstallerCustomWrapper::isActive() const QList IPluginInstallerCustomWrapper::settings() const { try { - return this->get_override("settings")(); + return this->get_override("settings")().as>(); } PYCATCH; } @@ -189,7 +190,7 @@ bool IPluginInstallerCustomWrapper::isArchiveSupported(const QString &archiveNam std::set IPluginInstallerCustomWrapper::supportedExtensions() const { try { - return this->get_override("supportedExtensions")(); + return this->get_override("supportedExtensions")().as>(); } PYCATCH; } From 5da6a9d3bd2e831d08bd1f66cd6299ba75e9bb4b Mon Sep 17 00:00:00 2001 From: Tannin Date: Tue, 11 Nov 2014 23:48:22 +0100 Subject: [PATCH 6/7] - updated staging script to use qt5 and to fetch translations from transifex - removed call to function unavailable in Windows XP --- src/runner/pythonRunner.pro | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/runner/pythonRunner.pro b/src/runner/pythonRunner.pro index dbffac8..e6e7d71 100644 --- a/src/runner/pythonRunner.pro +++ b/src/runner/pythonRunner.pro @@ -42,11 +42,9 @@ CONFIG(debug, debug|release) { QMAKE_LFLAGS += /DEBUG } -INCLUDEPATH += "$${BOOSTPATH}" "$${PYTHONPATH}/include" "$${PYTHONPATH}/Lib/site-packages/PyQt4/include" +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) { From dec620b5b764685284b946803c1bdc05b77f02e0 Mon Sep 17 00:00:00 2001 From: Tannin Date: Fri, 21 Nov 2014 14:45:30 +0100 Subject: [PATCH 7/7] - started on a refactoring moving functionality out of the MainWindow class - started on support for game-plugins --- src/runner/pythonrunner.cpp | 1 + src/runner/uibasewrappers.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/runner/pythonrunner.cpp b/src/runner/pythonrunner.cpp index 719981c..2a3da87 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -727,6 +727,7 @@ BOOST_PYTHON_MODULE(mobase) .def("startApplication", bpy::pure_virtual(&IOrganizer::startApplication), bpy::return_value_policy()) .def("waitForApplication", bpy::pure_virtual(&IOrganizer::waitForApplication), bpy::return_value_policy()) .def("onAboutToRun", bpy::pure_virtual(&IOrganizer::onAboutToRun)) + .def("onFinishedRun", bpy::pure_virtual(&IOrganizer::onFinishedRun)) .def("onModInstalled", bpy::pure_virtual(&IOrganizer::onModInstalled)) .def("refreshModList", bpy::pure_virtual(&IOrganizer::refreshModList)) ; diff --git a/src/runner/uibasewrappers.h b/src/runner/uibasewrappers.h index 354346a..ec29b84 100644 --- a/src/runner/uibasewrappers.h +++ b/src/runner/uibasewrappers.h @@ -226,6 +226,7 @@ struct IOrganizerWrapper: MOBase::IOrganizer, boost::python::wrapperget_override("waitForApplication")(handle, exitCode); } virtual void refreshModList(bool saveChanges = true) { this->get_override("refreshModList")(saveChanges); } virtual bool onAboutToRun(const std::function &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); } };