Skip to content

Commit 42eac4f

Browse files
committed
Last-minute packaging fixes
1 parent dfad4b6 commit 42eac4f

2 files changed

Lines changed: 35 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ set(installed_files
5050
)
5151
set(installed_files_resources_icons
5252
arrow.svg
53+
camera.svg
5354
icon.svg
5455
play.svg
5556
translations.svg
@@ -66,6 +67,21 @@ set(installed_files_resources_qml
6667
TranslationButton.qml
6768
)
6869
set(installed_files_resources_qml_SidebarSettings
70+
SettingCategory.qml
71+
SettingCheckBox.qml
72+
SettingComboBox.qml
73+
SettingItem.qml
74+
SettingTextField.qml
75+
)
76+
set(installed_files_resources_qml_cura4
77+
ArticleCheckbox.qml
78+
ArticleImages.qml
79+
ArticleText.qml
80+
SettingsGuide.qml
81+
SettingsSidebar.qml
82+
TranslationButton.qml
83+
)
84+
set(installed_files_resources_qml_cura4_SidebarSettings
6985
SettingCategory.qml
7086
SettingCheckBox.qml
7187
SettingComboBox.qml
@@ -94,6 +110,14 @@ set(installed_paths_resources_qml_SidebarSettings "")
94110
foreach(f IN LISTS installed_files_resources_qml_SidebarSettings)
95111
list(APPEND installed_paths_resources_qml_SidebarSettings ${CMAKE_CURRENT_SOURCE_DIR}/resources/qml/SidebarSettings/${f})
96112
endforeach()
113+
set(installed_paths_resources_qml_cura4 "")
114+
foreach(f IN LISTS installed_files_resources_qml_cura4)
115+
list(APPEND installed_paths_resources_qml_cura4 ${CMAKE_CURRENT_SOURCE_DIR}/resources/qml_cura4/${f})
116+
endforeach()
117+
set(installed_paths_resources_qml_cura4_SidebarSettings "")
118+
foreach(f IN LISTS installed_files_resources_qml_cura4_SidebarSettings)
119+
list(APPEND installed_paths_resources_qml_cura4_SidebarSettings ${CMAKE_CURRENT_SOURCE_DIR}/resources/qml_cura4/SidebarSettings/${f})
120+
endforeach()
97121

98122
#Find out where to install this thing.
99123
if(WIN32)
@@ -121,6 +145,8 @@ install(FILES ${installed_paths_resources} DESTINATION ${SETTINGSGUIDE_PLUGIN_ID
121145
install(FILES ${installed_paths_resources_icons} DESTINATION ${SETTINGSGUIDE_PLUGIN_ID}/resources/icons)
122146
install(FILES ${installed_paths_resources_qml} DESTINATION ${SETTINGSGUIDE_PLUGIN_ID}/resources/qml)
123147
install(FILES ${installed_paths_resources_qml_SidebarSettings} DESTINATION ${SETTINGSGUIDE_PLUGIN_ID}/resources/qml/SidebarSettings)
148+
install(FILES ${installed_paths_resources_qml_cura4} DESTINATION ${SETTINGSGUIDE_PLUGIN_ID}/resources/qml_cura4)
149+
install(FILES ${installed_paths_resources_qml_cura4_SidebarSettings} DESTINATION ${SETTINGSGUIDE_PLUGIN_ID}/resources/qml_cura4/SidebarSettings)
124150
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/resources/articles" DESTINATION ${SETTINGSGUIDE_PLUGIN_ID}/resources)
125151
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/resources/translations" DESTINATION ${SETTINGSGUIDE_PLUGIN_ID}/resources)
126152
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Mistune-prefix/src/Mistune/mistune.py" DESTINATION ${SETTINGSGUIDE_PLUGIN_ID}/Mistune)
@@ -146,6 +172,10 @@ foreach(sdk_version ${SETTINGSGUIDE_SUPPORTED_SDKS})
146172
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${installed_paths_resources_qml} files/plugins/${SETTINGSGUIDE_PLUGIN_ID}/resources/qml
147173
COMMAND ${CMAKE_COMMAND} -E make_directory files/plugins/${SETTINGSGUIDE_PLUGIN_ID}/resources/qml/SidebarSettings
148174
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${installed_paths_resources_qml_SidebarSettings} files/plugins/${SETTINGSGUIDE_PLUGIN_ID}/resources/qml/SidebarSettings
175+
COMMAND ${CMAKE_COMMAND} -E make_directory files/plugins/${SETTINGSGUIDE_PLUGIN_ID}/resources/qml_cura4
176+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${installed_paths_resources_qml_cura4} files/plugins/${SETTINGSGUIDE_PLUGIN_ID}/resources/qml_cura4
177+
COMMAND ${CMAKE_COMMAND} -E make_directory files/plugins/${SETTINGSGUIDE_PLUGIN_ID}/resources/qml_cura4/SidebarSettings
178+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${installed_paths_resources_qml_cura4_SidebarSettings} files/plugins/${SETTINGSGUIDE_PLUGIN_ID}/resources/qml_cura4/SidebarSettings
149179
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/resources/articles" files/plugins/${SETTINGSGUIDE_PLUGIN_ID}/resources/articles
150180
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/resources/translations" files/plugins/${SETTINGSGUIDE_PLUGIN_ID}/resources/translations
151181
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/cmake/[Content_Types].xml" .

QtMarkdownRenderer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
from .Mistune import mistune # Extending from this library's renderer.
77
import os.path # To fix the source paths for images.
8-
import PyQt5.QtCore # To fix the source paths for images using QUrl.
8+
try:
9+
import PyQt6.QtCore as QtCore # To fix the source paths for images using QUrl.
10+
except ImportError:
11+
import PyQt5.QtCore as QtCore
912
import re # To find parts of the conditional syntax.
1013
import UM.Application # To get the application version.
1114
import UM.Logger # To log warnings if parsing went wrong.
@@ -84,7 +87,7 @@ def image(self, src, title, alt_text):
8487
:return: HTML for Qt's Rich Text to display the image.
8588
"""
8689
image_full_path = os.path.join(self._images_path, src)
87-
image_url = PyQt5.QtCore.QUrl.fromLocalFile(image_full_path).url()
90+
image_url = QtCore.QUrl.fromLocalFile(image_full_path).url()
8891
margin = UM.Qt.Bindings.Theme.Theme.getInstance().getSize("default_margin").width()
8992
width = UM.Qt.Bindings.Theme.Theme.getInstance().getSize("tooltip").width() * 2.5 / 3 - margin * 2 # Fit 3 images in the width.
9093
return "<img src=\"{image_url}\" width=\"{width}\" />".format(image_url=image_url, width=width)

0 commit comments

Comments
 (0)