mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Implement sending a signal when changing intent changes quality level
For now it does nothing. But I'm adding a function that should cause the combobox to pulse. That'll be a new feature so I'm implementing it in a separate commit. Contributes to issue CURA-8849.
This commit is contained in:
parent
40d473c243
commit
bd131257fe
3 changed files with 21 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2019 Ultimaker B.V.
|
||||
# Copyright (c) 2022 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal, pyqtSlot
|
||||
|
|
|
@ -8,9 +8,11 @@ import Cura 1.7 as Cura
|
|||
|
||||
Item
|
||||
{
|
||||
id: recommendedResolutionSelector
|
||||
height: childrenRect.height
|
||||
|
||||
property real labelColumnWidth: Math.round(width / 3)
|
||||
property string _previousResolution: Cura.MachineManager.activeQualityType //Internal variable to detect changes.
|
||||
|
||||
Cura.IconWithText
|
||||
{
|
||||
|
@ -62,5 +64,18 @@ Item
|
|||
var selected_item = model.getItem(currentIndex)
|
||||
Cura.IntentManager.selectIntent(selected_item.intent_category, selected_item.quality_type)
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Cura.IntentManager
|
||||
function onIntentCategoryChanged()
|
||||
{
|
||||
if(recommendedResolutionSelector._previousResolution !== Cura.MachineManager.activeQualityType)
|
||||
{
|
||||
visibilityPreset.pulse();
|
||||
}
|
||||
recommendedResolutionSelector._previousResolution = Cura.MachineManager.activeQualityType;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -164,4 +164,9 @@ ComboBox
|
|||
text: delegateLabel.truncated ? delegateItem.text : ""
|
||||
}
|
||||
}
|
||||
|
||||
function pulse()
|
||||
{
|
||||
//TODO: Initiate a pulse of colour.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue