mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 13:34:01 -06:00
Merge branch 'feature_additional_components' of github.com:Ultimaker/Cura
This commit is contained in:
commit
614d4bb21a
2 changed files with 44 additions and 4 deletions
|
@ -128,6 +128,8 @@ class CuraApplication(QtApplication):
|
|||
self._machine_action_manager = MachineActionManager.MachineActionManager()
|
||||
self._machine_manager = None # This is initialized on demand.
|
||||
|
||||
self._additional_components = {} # Components to add to certain areas in the interface
|
||||
|
||||
super().__init__(name = "cura", version = CuraVersion, buildtype = CuraBuildType)
|
||||
|
||||
self.setWindowIcon(QIcon(Resources.getPath(Resources.Images, "cura-icon.png")))
|
||||
|
@ -876,4 +878,22 @@ class CuraApplication(QtApplication):
|
|||
self.getMainWindow().setMinimumSize(size)
|
||||
|
||||
def getBuildVolume(self):
|
||||
return self._volume
|
||||
return self._volume
|
||||
|
||||
additionalComponentsChanged = pyqtSignal(str, arguments = ["areaId"])
|
||||
|
||||
@pyqtProperty("QVariantMap", notify = additionalComponentsChanged)
|
||||
def additionalComponents(self):
|
||||
return self._additional_components
|
||||
|
||||
## Add a component to a list of components to be reparented to another area in the GUI.
|
||||
# The actual reparenting is done by the area itself.
|
||||
# \param area_id \type{str} Identifying name of the area to which the component should be reparented
|
||||
# \param component \type{QQuickComponent} The component that should be reparented
|
||||
@pyqtSlot(str, "QVariant")
|
||||
def addAdditionalComponent(self, area_id, component):
|
||||
if area_id not in self._additional_components:
|
||||
self._additional_components[area_id] = []
|
||||
self._additional_components[area_id].append(component)
|
||||
|
||||
self.additionalComponentsChanged.emit(area_id)
|
Loading…
Add table
Add a link
Reference in a new issue