Skip to content

Commit 8fa0d0a

Browse files
committed
Update following uibase changes for extensions.
1 parent 2d151d0 commit 8fa0d0a

File tree

7 files changed

+153
-363
lines changed

7 files changed

+153
-363
lines changed

src/plugin_python_en.ts

Lines changed: 11 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,78 +4,35 @@
44
<context>
55
<name>ProxyPython</name>
66
<message>
7-
<location filename="proxy/proxypython.cpp" line="88"/>
8-
<source>Python Initialization failed</source>
7+
<location filename="proxy/proxypython.cpp" line="156"/>
8+
<source>The path to Mod Organizer (%1) contains a semicolon. &lt;br&gt;While this is legal on NTFS drives, many softwares do not handle it correctly.&lt;br&gt;Unfortunately MO depends on libraries that seem to fall into that group.&lt;br&gt;As a result the python plugin cannot be loaded, and the only solution we canoffer is to remove the semicolon or move MO to a path without a semicolon.</source>
99
<translation type="unfinished"></translation>
1010
</message>
1111
<message>
12-
<location filename="proxy/proxypython.cpp" line="89"/>
13-
<source>On a previous start the Python Plugin failed to initialize.
14-
Do you want to try initializing python again (at the risk of another crash)?
15-
Suggestion: Select &quot;no&quot;, and click the warning sign for further help.Afterwards you have to re-enable the python plugin.</source>
16-
<translation type="unfinished"></translation>
17-
</message>
18-
<message>
19-
<location filename="proxy/proxypython.cpp" line="162"/>
20-
<source>Python Proxy</source>
21-
<translation type="unfinished"></translation>
22-
</message>
23-
<message>
24-
<location filename="proxy/proxypython.cpp" line="172"/>
25-
<source>Proxy Plugin to allow plugins written in python to be loaded</source>
26-
<translation type="unfinished"></translation>
27-
</message>
28-
<message>
29-
<location filename="proxy/proxypython.cpp" line="244"/>
30-
<source>ModOrganizer path contains a semicolon</source>
31-
<translation type="unfinished"></translation>
32-
</message>
33-
<message>
34-
<location filename="proxy/proxypython.cpp" line="246"/>
35-
<source>Python DLL not found</source>
36-
<translation type="unfinished"></translation>
37-
</message>
38-
<message>
39-
<location filename="proxy/proxypython.cpp" line="248"/>
40-
<source>Invalid Python DLL</source>
41-
<translation type="unfinished"></translation>
42-
</message>
43-
<message>
44-
<location filename="proxy/proxypython.cpp" line="250"/>
45-
<source>Initializing Python failed</source>
46-
<translation type="unfinished"></translation>
47-
</message>
48-
<message>
49-
<location filename="proxy/proxypython.cpp" line="252"/>
50-
<location filename="proxy/proxypython.cpp" line="281"/>
51-
<source>invalid problem key %1</source>
52-
<translation type="unfinished"></translation>
53-
</message>
54-
<message>
55-
<location filename="proxy/proxypython.cpp" line="260"/>
56-
<source>The path to Mod Organizer (%1) contains a semicolon.&lt;br&gt;While this is legal on NTFS drives, many applications do not handle it correctly.&lt;br&gt;Unfortunately MO depends on libraries that seem to fall into that group.&lt;br&gt;As a result the python plugin cannot be loaded, and the only solution we can offer is to remove the semicolon or move MO to a path without a semicolon.</source>
57-
<translation type="unfinished"></translation>
58-
</message>
59-
<message>
60-
<location filename="proxy/proxypython.cpp" line="270"/>
12+
<location filename="proxy/proxypython.cpp" line="167"/>
6113
<source>The Python plugin DLL was not found, maybe your antivirus deleted it. Re-installing MO2 might fix the problem.</source>
6214
<translation type="unfinished"></translation>
6315
</message>
6416
<message>
65-
<location filename="proxy/proxypython.cpp" line="273"/>
17+
<location filename="proxy/proxypython.cpp" line="170"/>
6618
<source>The Python plugin DLL is invalid, maybe your antivirus is blocking it. Re-installing MO2 and adding exclusions for it to your AV might fix the problem.</source>
6719
<translation type="unfinished"></translation>
6820
</message>
6921
<message>
70-
<location filename="proxy/proxypython.cpp" line="278"/>
22+
<location filename="proxy/proxypython.cpp" line="174"/>
7123
<source>The initialization of the Python plugin DLL failed, unfortunately without any details.</source>
7224
<translation type="unfinished"></translation>
7325
</message>
26+
<message>
27+
<location filename="proxy/proxypython.cpp" line="177"/>
28+
<source>no failure</source>
29+
<translation type="unfinished"></translation>
30+
</message>
7431
</context>
7532
<context>
7633
<name>QObject</name>
7734
<message>
78-
<location filename="runner/error.h" line="76"/>
35+
<location filename="runner/error.h" line="77"/>
7936
<source>An unknown exception was thrown in python code.</source>
8037
<translation type="unfinished"></translation>
8138
</message>

src/proxy/CMakeLists.txt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,33 @@ cmake_minimum_required(VERSION 3.16)
22

33
find_package(mo2-uibase CONFIG REQUIRED)
44

5-
set(PLUGIN_NAME "plugin_python")
5+
set(PROXY_NAME "python")
66

77
add_library(proxy SHARED proxypython.cpp proxypython.h)
88
mo2_configure_plugin(proxy
99
NO_SOURCES
1010
WARNINGS 4
1111
EXTERNAL_WARNINGS 4
12-
TRANSLATIONS OFF
12+
TRANSLATIONS ON
1313
EXTRA_TRANSLATIONS
1414
${CMAKE_CURRENT_SOURCE_DIR}/../runner
1515
${CMAKE_CURRENT_SOURCE_DIR}/../mobase
1616
${CMAKE_CURRENT_SOURCE_DIR}/../pybind11-qt)
1717
mo2_default_source_group()
1818
target_link_libraries(proxy PRIVATE runner mo2::uibase)
19-
set_target_properties(proxy PROPERTIES OUTPUT_NAME ${PLUGIN_NAME})
20-
mo2_install_plugin(proxy FOLDER)
19+
set_target_properties(proxy PROPERTIES OUTPUT_NAME "python_proxy")
2120

22-
set(PLUGIN_PYTHON_DIR bin/plugins/${PLUGIN_NAME})
21+
set(PROXY_PYTHON_DIR ${MO2_INSTALL_BIN}/proxies/python)
2322

24-
# install runner
23+
# install runner and proxy
24+
install(FILES $<TARGET_FILE:proxy> DESTINATION ${PROXY_PYTHON_DIR}/python)
25+
install(FILES $<TARGET_FILE:runner> DESTINATION ${PROXY_PYTHON_DIR}/python/dlls)
26+
27+
# install PDB
28+
install(FILES $<TARGET_PDB_FILE:proxy> DESTINATION pdb)
29+
30+
# delay loading since the dll is not in the standard folder
2531
target_link_options(proxy PRIVATE "/DELAYLOAD:runner.dll")
26-
install(FILES $<TARGET_FILE:runner> DESTINATION ${PLUGIN_PYTHON_DIR}/dlls)
2732

2833
# translations (custom location)
2934
mo2_add_translations(proxy
@@ -35,14 +40,14 @@ mo2_add_translations(proxy
3540
${CMAKE_CURRENT_SOURCE_DIR}/../pybind11-qt)
3641

3742
# install DLLs files needed
38-
set(DLL_DIRS ${PLUGIN_PYTHON_DIR}/dlls)
43+
set(DLL_DIRS ${PROXY_PYTHON_DIR}/dlls)
3944
file(GLOB dlls_to_install
4045
# ${PYTHON_BUILD_PATH}/libffi*.dll
4146
${Python_HOME}/python${Python_VERSION_MAJOR}*.dll)
4247
install(FILES ${dlls_to_install} DESTINATION ${DLL_DIRS})
4348

4449
# install Python .pyd files
45-
set(PYLIB_DIR ${PLUGIN_PYTHON_DIR}/libs)
50+
set(PYLIB_DIR ${PROXY_PYTHON_DIR}/libs)
4651
file(GLOB libs_to_install ${Python_DLL_DIR}/*.pyd)
4752
install(FILES ${libs_to_install} DESTINATION ${PYLIB_DIR})
4853

0 commit comments

Comments
 (0)