mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 06:15:54 +08:00
Merge branch 'master' into fix_per_meshgroup_settings
This commit is contained in:
commit
4a1f0a21ad
@ -3,7 +3,7 @@
|
||||
|
||||
from UM.Qt.ListModel import ListModel
|
||||
|
||||
from PyQt5.QtCore import pyqtSlot, pyqtProperty, Qt, pyqtSignal
|
||||
from PyQt5.QtCore import Qt
|
||||
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
from UM.Settings.ContainerStack import ContainerStack
|
||||
@ -11,6 +11,7 @@ from UM.Settings.ContainerStack import ContainerStack
|
||||
from UM.i18n import i18nCatalog
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
|
||||
#
|
||||
# This the QML model for the quality management page.
|
||||
#
|
||||
@ -39,7 +40,7 @@ class MachineManagementModel(ListModel):
|
||||
## Handler for container added/removed events from registry
|
||||
def _onContainerChanged(self, container):
|
||||
# We only need to update when the added / removed container is a stack.
|
||||
if isinstance(container, ContainerStack):
|
||||
if isinstance(container, ContainerStack) and container.getMetaDataEntry("type") == "machine":
|
||||
self._update()
|
||||
|
||||
## Private convenience function to reset & repopulate the model.
|
||||
@ -47,7 +48,9 @@ class MachineManagementModel(ListModel):
|
||||
items = []
|
||||
|
||||
# Get first the network enabled printers
|
||||
network_filter_printers = {"type": "machine", "um_network_key": "*", "hidden": "False"}
|
||||
network_filter_printers = {"type": "machine",
|
||||
"um_network_key": "*",
|
||||
"hidden": "False"}
|
||||
self._network_container_stacks = ContainerRegistry.getInstance().findContainerStacks(**network_filter_printers)
|
||||
self._network_container_stacks.sort(key = lambda i: i.getMetaDataEntry("connect_group_name"))
|
||||
|
||||
@ -57,11 +60,11 @@ class MachineManagementModel(ListModel):
|
||||
metadata["definition_name"] = container.getBottom().getName()
|
||||
|
||||
items.append({"name": metadata["connect_group_name"],
|
||||
"id": container.getId(),
|
||||
"metadata": metadata,
|
||||
"group": catalog.i18nc("@info:title", "Network enabled printers")})
|
||||
"id": container.getId(),
|
||||
"metadata": metadata,
|
||||
"group": catalog.i18nc("@info:title", "Network enabled printers")})
|
||||
|
||||
# Get now the local printes
|
||||
# Get now the local printers
|
||||
local_filter_printers = {"type": "machine", "um_network_key": None}
|
||||
self._local_container_stacks = ContainerRegistry.getInstance().findContainerStacks(**local_filter_printers)
|
||||
self._local_container_stacks.sort(key = lambda i: i.getName())
|
||||
@ -72,8 +75,8 @@ class MachineManagementModel(ListModel):
|
||||
metadata["definition_name"] = container.getBottom().getName()
|
||||
|
||||
items.append({"name": container.getName(),
|
||||
"id": container.getId(),
|
||||
"metadata": metadata,
|
||||
"group": catalog.i18nc("@info:title", "Local printers")})
|
||||
"id": container.getId(),
|
||||
"metadata": metadata,
|
||||
"group": catalog.i18nc("@info:title", "Local printers")})
|
||||
|
||||
self.setItems(items)
|
||||
|
@ -38,16 +38,16 @@
|
||||
"machine_max_feedrate_z": {
|
||||
"default_value": 400
|
||||
},
|
||||
"steps_per_mm_x": {
|
||||
"machine_steps_per_mm_x": {
|
||||
"default_value": 93
|
||||
},
|
||||
"steps_per_mm_y": {
|
||||
"machine_steps_per_mm_y": {
|
||||
"default_value": 93
|
||||
},
|
||||
"steps_per_mm_z": {
|
||||
"machine_steps_per_mm_z": {
|
||||
"default_value": 1600
|
||||
},
|
||||
"steps_per_mm_e": {
|
||||
"machine_steps_per_mm_e": {
|
||||
"default_value": 92
|
||||
},
|
||||
"gantry_height": {
|
||||
|
@ -55,7 +55,7 @@ ToolButton
|
||||
PrinterStatusIcon
|
||||
{
|
||||
id: printerStatusIcon
|
||||
visible: printerConnected
|
||||
visible: printerConnected || isNetworkPrinter
|
||||
status: printerStatus
|
||||
anchors
|
||||
{
|
||||
|
@ -13,11 +13,17 @@ SettingItem
|
||||
|
||||
property string textBeforeEdit
|
||||
property bool textHasChanged
|
||||
property bool focusGainedByClick: false
|
||||
onFocusReceived:
|
||||
{
|
||||
textHasChanged = false;
|
||||
textBeforeEdit = focusItem.text;
|
||||
focusItem.selectAll();
|
||||
|
||||
if(!focusGainedByClick)
|
||||
{
|
||||
// select all text when tabbing through fields (but not when selecting a field with the mouse)
|
||||
focusItem.selectAll();
|
||||
}
|
||||
}
|
||||
|
||||
contents: Rectangle
|
||||
@ -93,14 +99,6 @@ SettingItem
|
||||
font: UM.Theme.getFont("default")
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: mouseArea
|
||||
anchors.fill: parent;
|
||||
//hoverEnabled: true;
|
||||
cursorShape: Qt.IBeamCursor
|
||||
}
|
||||
|
||||
TextInput
|
||||
{
|
||||
id: input
|
||||
@ -142,6 +140,7 @@ SettingItem
|
||||
{
|
||||
base.focusReceived();
|
||||
}
|
||||
base.focusGainedByClick = false;
|
||||
}
|
||||
|
||||
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text")
|
||||
@ -178,6 +177,22 @@ SettingItem
|
||||
}
|
||||
when: !input.activeFocus
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: mouseArea
|
||||
anchors.fill: parent;
|
||||
|
||||
cursorShape: Qt.IBeamCursor
|
||||
|
||||
onPressed: {
|
||||
if(!input.activeFocus) {
|
||||
base.focusGainedByClick = true;
|
||||
input.forceActiveFocus();
|
||||
}
|
||||
mouse.accepted = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user