mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 13:39:02 +08:00
Reset menu selection without modifying the model
Contributes to CURA-853
This commit is contained in:
parent
e093c956f2
commit
b8113a9740
@ -226,7 +226,7 @@ UM.MainWindow
|
|||||||
UM.MachineManager.setActiveProfile(model.name);
|
UM.MachineManager.setActiveProfile(model.name);
|
||||||
if (!model.active) {
|
if (!model.active) {
|
||||||
//Selecting a profile was canceled; undo menu selection
|
//Selecting a profile was canceled; undo menu selection
|
||||||
checked = false;
|
profileMenuInstantiator.model.setProperty(index, "active", false);
|
||||||
var activeProfileName = UM.MachineManager.activeProfile;
|
var activeProfileName = UM.MachineManager.activeProfile;
|
||||||
var activeProfileIndex = profileMenuInstantiator.model.find("name", activeProfileName);
|
var activeProfileIndex = profileMenuInstantiator.model.find("name", activeProfileName);
|
||||||
profileMenuInstantiator.model.setProperty(activeProfileIndex, "active", true);
|
profileMenuInstantiator.model.setProperty(activeProfileIndex, "active", true);
|
||||||
|
@ -62,7 +62,7 @@ Item{
|
|||||||
UM.MachineManager.setActiveProfile(model.name);
|
UM.MachineManager.setActiveProfile(model.name);
|
||||||
if (!model.active) {
|
if (!model.active) {
|
||||||
//Selecting a profile was canceled; undo menu selection
|
//Selecting a profile was canceled; undo menu selection
|
||||||
checked = false;
|
profileSelectionInstantiator.model.setProperty(index, "active", false);
|
||||||
var activeProfileName = UM.MachineManager.activeProfile;
|
var activeProfileName = UM.MachineManager.activeProfile;
|
||||||
var activeProfileIndex = profileSelectionInstantiator.model.find("name", activeProfileName);
|
var activeProfileIndex = profileSelectionInstantiator.model.find("name", activeProfileName);
|
||||||
profileSelectionInstantiator.model.setProperty(activeProfileIndex, "active", true);
|
profileSelectionInstantiator.model.setProperty(activeProfileIndex, "active", true);
|
||||||
|
@ -142,7 +142,7 @@ Item
|
|||||||
UM.MachineManager.setActiveMachineVariant(variantsModel.getItem(index).name);
|
UM.MachineManager.setActiveMachineVariant(variantsModel.getItem(index).name);
|
||||||
if (typeof(model) !== "undefined" && !model.active) {
|
if (typeof(model) !== "undefined" && !model.active) {
|
||||||
//Selecting a variant was canceled; undo menu selection
|
//Selecting a variant was canceled; undo menu selection
|
||||||
checked = false;
|
variantSelectionInstantiator.model.setProperty(index, "active", false);
|
||||||
var activeMachineVariantName = UM.MachineManager.activeMachineVariant;
|
var activeMachineVariantName = UM.MachineManager.activeMachineVariant;
|
||||||
var activeMachineVariantIndex = variantSelectionInstantiator.model.find("name", activeMachineVariantName);
|
var activeMachineVariantIndex = variantSelectionInstantiator.model.find("name", activeMachineVariantName);
|
||||||
variantSelectionInstantiator.model.setProperty(activeMachineVariantIndex, "active", true);
|
variantSelectionInstantiator.model.setProperty(activeMachineVariantIndex, "active", true);
|
||||||
@ -206,7 +206,7 @@ Item
|
|||||||
UM.MachineManager.setActiveMaterial(machineMaterialsModel.getItem(index).name);
|
UM.MachineManager.setActiveMaterial(machineMaterialsModel.getItem(index).name);
|
||||||
if (typeof(model) !== "undefined" && !model.active) {
|
if (typeof(model) !== "undefined" && !model.active) {
|
||||||
//Selecting a material was canceled; undo menu selection
|
//Selecting a material was canceled; undo menu selection
|
||||||
checked = false;
|
materialSelectionInstantiator.model.setProperty(index, "active", false);
|
||||||
var activeMaterialName = UM.MachineManager.activeMaterial;
|
var activeMaterialName = UM.MachineManager.activeMaterial;
|
||||||
var activeMaterialIndex = materialSelectionInstantiator.model.find("name", activeMaterialName);
|
var activeMaterialIndex = materialSelectionInstantiator.model.find("name", activeMaterialName);
|
||||||
materialSelectionInstantiator.model.setProperty(activeMaterialIndex, "active", true);
|
materialSelectionInstantiator.model.setProperty(activeMaterialIndex, "active", true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user