mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 06:28:59 +08:00
Rename SectionName to DiscoverySource in GlobalStacksModel
This commit is contained in:
parent
a97410656f
commit
e623c807ce
@ -17,7 +17,7 @@ class GlobalStacksModel(ListModel):
|
|||||||
HasRemoteConnectionRole = Qt.UserRole + 3
|
HasRemoteConnectionRole = Qt.UserRole + 3
|
||||||
ConnectionTypeRole = Qt.UserRole + 4
|
ConnectionTypeRole = Qt.UserRole + 4
|
||||||
MetaDataRole = Qt.UserRole + 5
|
MetaDataRole = Qt.UserRole + 5
|
||||||
SectionNameRole = Qt.UserRole + 6 # For separating local and remote printers in the machine management page
|
DiscoverySourceRole = Qt.UserRole + 6 # For separating local and remote printers in the machine management page
|
||||||
|
|
||||||
def __init__(self, parent = None) -> None:
|
def __init__(self, parent = None) -> None:
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
@ -28,7 +28,7 @@ class GlobalStacksModel(ListModel):
|
|||||||
self.addRoleName(self.IdRole, "id")
|
self.addRoleName(self.IdRole, "id")
|
||||||
self.addRoleName(self.HasRemoteConnectionRole, "hasRemoteConnection")
|
self.addRoleName(self.HasRemoteConnectionRole, "hasRemoteConnection")
|
||||||
self.addRoleName(self.MetaDataRole, "metadata")
|
self.addRoleName(self.MetaDataRole, "metadata")
|
||||||
self.addRoleName(self.SectionNameRole, "sectionName")
|
self.addRoleName(self.DiscoverySourceRole, "discoverySource")
|
||||||
self._container_stacks = []
|
self._container_stacks = []
|
||||||
|
|
||||||
self._change_timer = QTimer()
|
self._change_timer = QTimer()
|
||||||
@ -74,6 +74,6 @@ class GlobalStacksModel(ListModel):
|
|||||||
"id": container_stack.getId(),
|
"id": container_stack.getId(),
|
||||||
"hasRemoteConnection": has_remote_connection,
|
"hasRemoteConnection": has_remote_connection,
|
||||||
"metadata": container_stack.getMetaData().copy(),
|
"metadata": container_stack.getMetaData().copy(),
|
||||||
"sectionName": section_name})
|
"discoverySource": section_name})
|
||||||
items.sort(key = lambda i: not i["hasRemoteConnection"])
|
items.sort(key = lambda i: not i["hasRemoteConnection"])
|
||||||
self.setItems(items)
|
self.setItems(items)
|
||||||
|
@ -16,7 +16,7 @@ UM.ManagementPage
|
|||||||
title: catalog.i18nc("@title:tab", "Printers");
|
title: catalog.i18nc("@title:tab", "Printers");
|
||||||
model: Cura.GlobalStacksModel { }
|
model: Cura.GlobalStacksModel { }
|
||||||
|
|
||||||
sectionRole: "sectionName"
|
sectionRole: "discoverySource"
|
||||||
|
|
||||||
activeId: Cura.MachineManager.activeMachineId
|
activeId: Cura.MachineManager.activeMachineId
|
||||||
activeIndex: activeMachineIndex()
|
activeIndex: activeMachineIndex()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user