diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 3bdf7aa1263..2005b162e9f 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1296,6 +1296,9 @@ def registerObjects(self, engine): qmlRegisterSingletonType(CuraSceneController, "Cura", 1, 0, self.getCuraSceneController, "SceneController") qmlRegisterSingletonType(ExtruderManager, "Cura", 1, 0, self.getExtruderManager, "ExtruderManager") qmlRegisterSingletonType(MachineManager, "Cura", 1, 0, self.getMachineManager, "MachineManager") + # Give Actions.qml another namespace to import instead of "Cura" which + # it is a member of and causes a cyclic dependency. + qmlRegisterSingletonType(MachineManager, "_CuraActionsDependencies", 1, 5, self.getMachineManager, "MachineManager") qmlRegisterSingletonType(IntentManager, "Cura", 1, 6, self.getIntentManager, "IntentManager") qmlRegisterSingletonType(SettingInheritanceManager, "Cura", 1, 0, self.getSettingInheritanceManager, "SettingInheritanceManager") qmlRegisterSingletonType(SimpleModeSettingsManager, "Cura", 1, 0, self.getSimpleModeSettingsManagerWrapper, "SimpleModeSettingsManager") @@ -1346,6 +1349,9 @@ def registerObjects(self, engine): qmlRegisterType(MachineNameValidator, "Cura", 1, 0, "MachineNameValidator") qmlRegisterType(UserChangesModel, "Cura", 1, 0, "UserChangesModel") qmlRegisterSingletonType(ContainerManager, "Cura", 1, 0, ContainerManager.getInstance, "ContainerManager") + # Give Actions.qml another namespace to import instead of "Cura" which + # it is a member of and causes a cyclic dependency. + qmlRegisterSingletonType(ContainerManager, "_CuraActionsDependencies", 1, 5, ContainerManager.getInstance, "ContainerManager") qmlRegisterType(SidebarCustomMenuItemsModel, "Cura", 1, 0, "SidebarCustomMenuItemsModel") qmlRegisterType(PrinterOutputDevice, "Cura", 1, 0, "PrinterOutputDevice") diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index 7acf39ecb28..80b2f6c6090 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -6,7 +6,10 @@ pragma Singleton import QtQuick 2.10 import QtQuick.Controls 2.4 import UM 1.1 as UM -import Cura 1.5 as Cura +import _CuraActionsDependencies 1.5 as Cura +// Was "import Cura 1.5 as Cura", except that results in +// "Cyclic dependency detected between" Actions.qml and Actions.qml +// Actions can't import the namespace that it has already been registered to. Item {