mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
WIP: Refactor quality model files
This commit is contained in:
parent
171a05ae6a
commit
236bd09d08
7 changed files with 172 additions and 166 deletions
|
@ -52,8 +52,11 @@ from UM.Settings.SettingDefinition import SettingDefinition, DefinitionPropertyT
|
||||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||||
from UM.Settings.SettingFunction import SettingFunction
|
from UM.Settings.SettingFunction import SettingFunction
|
||||||
from cura.Settings.MachineNameValidator import MachineNameValidator
|
from cura.Settings.MachineNameValidator import MachineNameValidator
|
||||||
|
|
||||||
from cura.Machines.Models.NozzleModel import NozzleModel
|
from cura.Machines.Models.NozzleModel import NozzleModel
|
||||||
from cura.Settings.ProfilesModel import NewQualityProfilesModel, NewCustomQualityProfilesModel
|
from cura.Machines.Models.QualityProfilesModel import QualityProfilesModel
|
||||||
|
from cura.Machines.Models.CustomQualityProfilesModel import CustomQualityProfilesModel
|
||||||
|
|
||||||
from cura.Settings.MaterialsModel import MaterialsModel, BrandMaterialsModel, GenericMaterialsModel, NewMaterialsModel
|
from cura.Settings.MaterialsModel import MaterialsModel, BrandMaterialsModel, GenericMaterialsModel, NewMaterialsModel
|
||||||
from cura.Settings.SettingInheritanceManager import SettingInheritanceManager
|
from cura.Settings.SettingInheritanceManager import SettingInheritanceManager
|
||||||
from cura.Settings.SimpleModeSettingsManager import SimpleModeSettingsManager
|
from cura.Settings.SimpleModeSettingsManager import SimpleModeSettingsManager
|
||||||
|
@ -390,8 +393,8 @@ class CuraApplication(QtApplication):
|
||||||
|
|
||||||
self.getCuraSceneController().setActiveBuildPlate(0) # Initialize
|
self.getCuraSceneController().setActiveBuildPlate(0) # Initialize
|
||||||
|
|
||||||
self._new_quality_profile_model = None
|
self._quality_profile_model = None
|
||||||
self._new_custom_quality_profile_model = None
|
self._custom_quality_profile_model = None
|
||||||
|
|
||||||
CuraApplication.Created = True
|
CuraApplication.Created = True
|
||||||
|
|
||||||
|
@ -896,15 +899,15 @@ class CuraApplication(QtApplication):
|
||||||
def getPrintInformation(self):
|
def getPrintInformation(self):
|
||||||
return self._print_information
|
return self._print_information
|
||||||
|
|
||||||
def getNewQualityProfileModel(self, *args, **kwargs):
|
def getQualityProfileModel(self, *args, **kwargs):
|
||||||
if self._new_quality_profile_model is None:
|
if self._quality_profile_model is None:
|
||||||
self._new_quality_profile_model = NewQualityProfilesModel(self)
|
self._quality_profile_model = QualityProfilesModel(self)
|
||||||
return self._new_quality_profile_model
|
return self._quality_profile_model
|
||||||
|
|
||||||
def getNewCustomQualityProfilesModel(self, *args, **kwargs):
|
def getCustomQualityProfilesModel(self, *args, **kwargs):
|
||||||
if self._new_custom_quality_profile_model is None:
|
if self._custom_quality_profile_model is None:
|
||||||
self._new_custom_quality_profile_model = NewCustomQualityProfilesModel(self)
|
self._custom_quality_profile_model = CustomQualityProfilesModel(self)
|
||||||
return self._new_custom_quality_profile_model
|
return self._custom_quality_profile_model
|
||||||
|
|
||||||
## Registers objects for the QML engine to use.
|
## Registers objects for the QML engine to use.
|
||||||
#
|
#
|
||||||
|
@ -940,8 +943,8 @@ class CuraApplication(QtApplication):
|
||||||
# TODO: make this singleton?
|
# TODO: make this singleton?
|
||||||
qmlRegisterType(QualityManagementModel, "Cura", 1, 0, "QualityManagementModel")
|
qmlRegisterType(QualityManagementModel, "Cura", 1, 0, "QualityManagementModel")
|
||||||
|
|
||||||
qmlRegisterSingletonType(NewQualityProfilesModel, "Cura", 1, 0, "NewQualityProfilesModel", self.getNewQualityProfileModel)
|
qmlRegisterSingletonType(QualityProfilesModel, "Cura", 1, 0, "QualityProfilesModel", self.getQualityProfileModel)
|
||||||
qmlRegisterSingletonType(NewCustomQualityProfilesModel, "Cura", 1, 0, "NewCustomQualityProfilesModel", self.getNewCustomQualityProfilesModel)
|
qmlRegisterSingletonType(CustomQualityProfilesModel, "Cura", 1, 0, "CustomQualityProfilesModel", self.getCustomQualityProfilesModel)
|
||||||
qmlRegisterType(NozzleModel, "Cura", 1, 0, "NozzleModel")
|
qmlRegisterType(NozzleModel, "Cura", 1, 0, "NozzleModel")
|
||||||
|
|
||||||
qmlRegisterType(MaterialsModel, "Cura", 1, 0, "MaterialsModel")
|
qmlRegisterType(MaterialsModel, "Cura", 1, 0, "MaterialsModel")
|
||||||
|
|
36
cura/Machines/Models/CustomQualityProfilesModel.py
Normal file
36
cura/Machines/Models/CustomQualityProfilesModel.py
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
from UM.Application import Application
|
||||||
|
from UM.Logger import Logger
|
||||||
|
|
||||||
|
from cura.Machines.Models.QualityProfilesModel import QualityProfilesModel
|
||||||
|
|
||||||
|
|
||||||
|
class CustomQualityProfilesModel(QualityProfilesModel):
|
||||||
|
|
||||||
|
def _update(self):
|
||||||
|
Logger.log("d", "Updating %s ...", self.__class__.__name__)
|
||||||
|
|
||||||
|
active_global_stack = Application.getInstance().getMachineManager()._global_container_stack
|
||||||
|
if active_global_stack is None:
|
||||||
|
self.setItems([])
|
||||||
|
Logger.log("d", "No active GlobalStack, set %s as empty.", self.__class__.__name__)
|
||||||
|
return
|
||||||
|
|
||||||
|
quality_changes_group_dict = self._quality_manager.getQualityChangesGroups(active_global_stack)
|
||||||
|
|
||||||
|
item_list = []
|
||||||
|
for key in sorted(quality_changes_group_dict):
|
||||||
|
quality_changes_group = quality_changes_group_dict[key]
|
||||||
|
|
||||||
|
item = {"id": "TODO", # TODO: probably will be removed
|
||||||
|
"name": quality_changes_group.name,
|
||||||
|
"layer_height": "",
|
||||||
|
"layer_height_without_unit": "",
|
||||||
|
"available": quality_changes_group.is_available,
|
||||||
|
"quality_changes_group": quality_changes_group}
|
||||||
|
|
||||||
|
item_list.append(item)
|
||||||
|
|
||||||
|
self.setItems(item_list)
|
|
@ -1,3 +1,6 @@
|
||||||
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
|
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
|
|
||||||
|
|
|
@ -1,135 +1,98 @@
|
||||||
# Copyright (c) 2017 Ultimaker B.V.
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from collections import OrderedDict
|
from PyQt5.QtCore import Qt
|
||||||
from typing import List, TYPE_CHECKING
|
|
||||||
|
from UM.Application import Application
|
||||||
from PyQt5.QtCore import Qt
|
from UM.Logger import Logger
|
||||||
|
from UM.Qt.ListModel import ListModel
|
||||||
from UM.Application import Application
|
from cura.Machines.QualityManager import QualityGroup
|
||||||
from UM.Logger import Logger
|
|
||||||
from UM.Qt.ListModel import ListModel
|
|
||||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
#
|
||||||
from UM.Settings.Models.InstanceContainersModel import InstanceContainersModel
|
# QML Model for all built-in quality profiles.
|
||||||
|
#
|
||||||
from cura.QualityManager import QualityManager
|
class QualityProfilesModel(ListModel):
|
||||||
from cura.Settings.ExtruderManager import ExtruderManager
|
IdRole = Qt.UserRole + 1
|
||||||
from cura.Machines.QualityManager import QualityGroup
|
NameRole = Qt.UserRole + 2
|
||||||
|
QualityTypeRole = Qt.UserRole + 3
|
||||||
if TYPE_CHECKING:
|
LayerHeightRole = Qt.UserRole + 4
|
||||||
from cura.Settings.ExtruderStack import ExtruderStack
|
AvailableRole = Qt.UserRole + 5
|
||||||
|
QualityGroupRole = Qt.UserRole + 6
|
||||||
|
QualityChangesGroupRole = Qt.UserRole + 7
|
||||||
class NewQualityProfilesModel(ListModel):
|
|
||||||
IdRole = Qt.UserRole + 1
|
def __init__(self, parent = None):
|
||||||
NameRole = Qt.UserRole + 2
|
super().__init__(parent)
|
||||||
QualityTypeRole = Qt.UserRole + 3
|
|
||||||
LayerHeightRole = Qt.UserRole + 4
|
self.addRoleName(self.IdRole, "id")
|
||||||
AvailableRole = Qt.UserRole + 5
|
self.addRoleName(self.NameRole, "name")
|
||||||
QualityGroupRole = Qt.UserRole + 6
|
self.addRoleName(self.QualityTypeRole, "quality_type")
|
||||||
QualityChangesGroupRole = Qt.UserRole + 7
|
self.addRoleName(self.LayerHeightRole, "layer_height")
|
||||||
|
self.addRoleName(self.AvailableRole, "available")
|
||||||
def __init__(self, parent = None):
|
self.addRoleName(self.QualityGroupRole, "quality_group")
|
||||||
super().__init__(parent)
|
self.addRoleName(self.QualityChangesGroupRole, "quality_changes_group")
|
||||||
|
|
||||||
self.addRoleName(self.IdRole, "id")
|
# connect signals
|
||||||
self.addRoleName(self.NameRole, "name")
|
Application.getInstance().globalContainerStackChanged.connect(self._update)
|
||||||
self.addRoleName(self.QualityTypeRole, "quality_type")
|
Application.getInstance().getMachineManager().activeQualityGroupChanged.connect(self._update)
|
||||||
self.addRoleName(self.LayerHeightRole, "layer_height")
|
|
||||||
self.addRoleName(self.AvailableRole, "available")
|
self._quality_manager = Application.getInstance()._quality_manager
|
||||||
self.addRoleName(self.QualityGroupRole, "quality_group")
|
|
||||||
self.addRoleName(self.QualityChangesGroupRole, "quality_changes_group")
|
self._layer_height_unit = "" # This is cached
|
||||||
|
|
||||||
# connect signals
|
def _update(self):
|
||||||
Application.getInstance().globalContainerStackChanged.connect(self._update)
|
Logger.log("d", "Updating quality profile model ...")
|
||||||
Application.getInstance().getMachineManager().activeQualityGroupChanged.connect(self._update)
|
|
||||||
|
active_global_stack = Application.getInstance().getMachineManager()._global_container_stack
|
||||||
self._quality_manager = Application.getInstance()._quality_manager
|
if active_global_stack is None:
|
||||||
|
self.setItems([])
|
||||||
self._layer_height_unit = "" # This is cached
|
Logger.log("d", "No active GlobalStack, set quality profile model as empty.")
|
||||||
|
return
|
||||||
def _update(self):
|
|
||||||
Logger.log("d", "Updating quality profile model ...")
|
quality_group_dict = self._quality_manager.getQualityGroups(active_global_stack)
|
||||||
|
|
||||||
active_global_stack = Application.getInstance().getMachineManager()._global_container_stack
|
item_list = []
|
||||||
if active_global_stack is None:
|
for key in sorted(quality_group_dict):
|
||||||
self.setItems([])
|
quality_group = quality_group_dict[key]
|
||||||
Logger.log("d", "No active GlobalStack, set quality profile model as empty.")
|
|
||||||
return
|
layer_height = self._fetchLayerHeight(quality_group)
|
||||||
|
|
||||||
quality_group_dict = self._quality_manager.getQualityGroups(active_global_stack)
|
item = {"id": "TODO", # TODO: probably will be removed
|
||||||
|
"name": quality_group.name,
|
||||||
item_list = []
|
"quality_type": quality_group.quality_type,
|
||||||
for key in sorted(quality_group_dict):
|
"layer_height": layer_height + self._layer_height_unit,
|
||||||
quality_group = quality_group_dict[key]
|
"layer_height_without_unit": layer_height,
|
||||||
|
"available": quality_group.is_available,
|
||||||
layer_height = self._fetchLayerHeight(quality_group)
|
"quality_group": quality_group}
|
||||||
|
|
||||||
item = {"id": "TODO", # TODO: probably will be removed
|
item_list.append(item)
|
||||||
"name": quality_group.name,
|
|
||||||
"quality_type": quality_group.quality_type,
|
# Sort items based on layer_height
|
||||||
"layer_height": layer_height + self._layer_height_unit,
|
item_list = sorted(item_list, key = lambda x: float(x["layer_height_without_unit"]))
|
||||||
"layer_height_without_unit": layer_height,
|
|
||||||
"available": quality_group.is_available,
|
self.setItems(item_list)
|
||||||
"quality_group": quality_group}
|
|
||||||
|
def _fetchLayerHeight(self, quality_group: "QualityGroup"):
|
||||||
item_list.append(item)
|
active_global_stack = Application.getInstance().getMachineManager()._global_container_stack
|
||||||
|
if not self._layer_height_unit:
|
||||||
# Sort items based on layer_height
|
unit = active_global_stack.definition.getProperty("layer_height", "unit")
|
||||||
item_list = sorted(item_list, key = lambda x: float(x["layer_height_without_unit"]))
|
if not unit:
|
||||||
|
unit = ""
|
||||||
self.setItems(item_list)
|
self._layer_height_unit = unit
|
||||||
|
|
||||||
def _fetchLayerHeight(self, quality_group: "QualityGroup"):
|
default_layer_height = active_global_stack.definition.getProperty("layer_height", "value")
|
||||||
active_global_stack = Application.getInstance().getMachineManager()._global_container_stack
|
|
||||||
if not self._layer_height_unit:
|
# Get layer_height from the quality profile for the GlobalStack
|
||||||
unit = active_global_stack.definition.getProperty("layer_height", "unit")
|
container = quality_group.node_for_global.getContainer()
|
||||||
if not unit:
|
|
||||||
unit = ""
|
layer_height = default_layer_height
|
||||||
self._layer_height_unit = unit
|
if container.hasProperty("layer_height", "value"):
|
||||||
|
layer_height = str(container.getProperty("layer_height", "value"))
|
||||||
default_layer_height = active_global_stack.definition.getProperty("layer_height", "value")
|
else:
|
||||||
|
# Look for layer_height in the GlobalStack from material -> definition
|
||||||
# Get layer_height from the quality profile for the GlobalStack
|
for idx in range(4):
|
||||||
container = quality_group.node_for_global.getContainer()
|
container = active_global_stack.getContainer(idx)
|
||||||
|
if container.hasProperty("layer_height", "value"):
|
||||||
layer_height = default_layer_height
|
layer_height = container.getProperty("layer_height", "value")
|
||||||
if container.hasProperty("layer_height", "value"):
|
break
|
||||||
layer_height = str(container.getProperty("layer_height", "value"))
|
return str(layer_height)
|
||||||
else:
|
|
||||||
# Look for layer_height in the GlobalStack from material -> definition
|
|
||||||
for idx in range(4):
|
|
||||||
container = active_global_stack.getContainer(idx)
|
|
||||||
if container.hasProperty("layer_height", "value"):
|
|
||||||
layer_height = container.getProperty("layer_height", "value")
|
|
||||||
break
|
|
||||||
return str(layer_height)
|
|
||||||
|
|
||||||
|
|
||||||
class NewCustomQualityProfilesModel(NewQualityProfilesModel):
|
|
||||||
|
|
||||||
def _update(self):
|
|
||||||
Logger.log("d", "Updating %s ...", self.__class__.__name__)
|
|
||||||
|
|
||||||
active_global_stack = Application.getInstance().getMachineManager()._global_container_stack
|
|
||||||
if active_global_stack is None:
|
|
||||||
self.setItems([])
|
|
||||||
Logger.log("d", "No active GlobalStack, set %s as empty.", self.__class__.__name__)
|
|
||||||
return
|
|
||||||
|
|
||||||
quality_changes_group_dict = self._quality_manager.getQualityChangesGroups(active_global_stack)
|
|
||||||
|
|
||||||
item_list = []
|
|
||||||
for key in sorted(quality_changes_group_dict):
|
|
||||||
quality_changes_group = quality_changes_group_dict[key]
|
|
||||||
|
|
||||||
item = {"id": "TODO", # TODO: probably will be removed
|
|
||||||
"name": quality_changes_group.name,
|
|
||||||
"layer_height": "",
|
|
||||||
"layer_height_without_unit": "",
|
|
||||||
"available": quality_changes_group.is_available,
|
|
||||||
"quality_changes_group": quality_changes_group}
|
|
||||||
|
|
||||||
item_list.append(item)
|
|
||||||
|
|
||||||
self.setItems(item_list)
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2016 Ultimaker B.V.
|
// Copyright (c) 2018 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.8
|
import QtQuick 2.8
|
||||||
|
@ -13,7 +13,7 @@ Menu
|
||||||
|
|
||||||
Instantiator
|
Instantiator
|
||||||
{
|
{
|
||||||
model: Cura.NewQualityProfilesModel
|
model: Cura.QualityProfilesModel
|
||||||
|
|
||||||
MenuItem
|
MenuItem
|
||||||
{
|
{
|
||||||
|
@ -34,18 +34,18 @@ Menu
|
||||||
MenuSeparator
|
MenuSeparator
|
||||||
{
|
{
|
||||||
id: customSeparator
|
id: customSeparator
|
||||||
visible: Cura.NewCustomQualityProfilesModel.rowCount > 0
|
visible: Cura.CustomQualityProfilesModel.rowCount > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
Instantiator
|
Instantiator
|
||||||
{
|
{
|
||||||
id: customProfileInstantiator
|
id: customProfileInstantiator
|
||||||
model: Cura.NewCustomQualityProfilesModel
|
model: Cura.CustomQualityProfilesModel
|
||||||
|
|
||||||
Connections
|
Connections
|
||||||
{
|
{
|
||||||
target: Cura.NewCustomQualityProfilesModel
|
target: Cura.CustomQualityProfilesModel
|
||||||
onModelReset: customSeparator.visible = Cura.NewCustomQualityProfilesModel.rowCount() > 0
|
onModelReset: customSeparator.visible = Cura.CustomQualityProfilesModel.rowCount() > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuItem
|
MenuItem
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright (c) 2017 Ultimaker B.V.
|
// Copyright (c) 2018 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.7
|
import QtQuick 2.8
|
||||||
import QtQuick.Controls 1.4
|
import QtQuick.Controls 1.4
|
||||||
import QtQuick.Controls.Styles 1.4
|
import QtQuick.Controls.Styles 1.4
|
||||||
import QtQuick.Layouts 1.3
|
import QtQuick.Layouts 1.3
|
||||||
|
@ -58,7 +58,7 @@ Item
|
||||||
running: false
|
running: false
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
var item = Cura.NewQualityProfilesModel.getItem(qualitySlider.value);
|
var item = Cura.QualityProfilesModel.getItem(qualitySlider.value);
|
||||||
Cura.MachineManager.activeQualityGroup = item.quality_group;
|
Cura.MachineManager.activeQualityGroup = item.quality_group;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,8 +105,8 @@ Item
|
||||||
var availableMin = -1
|
var availableMin = -1
|
||||||
var availableMax = -1
|
var availableMax = -1
|
||||||
|
|
||||||
for (var i = 0; i < Cura.NewQualityProfilesModel.rowCount(); i++) {
|
for (var i = 0; i < Cura.QualityProfilesModel.rowCount(); i++) {
|
||||||
var qualityItem = Cura.NewQualityProfilesModel.getItem(i)
|
var qualityItem = Cura.QualityProfilesModel.getItem(i)
|
||||||
|
|
||||||
// Add each quality item to the UI quality model
|
// Add each quality item to the UI quality model
|
||||||
qualityModel.append(qualityItem)
|
qualityModel.append(qualityItem)
|
||||||
|
@ -168,7 +168,7 @@ Item
|
||||||
qualityModel.existingQualityProfile = 0
|
qualityModel.existingQualityProfile = 0
|
||||||
|
|
||||||
// check, the ticks count cannot be less than zero
|
// check, the ticks count cannot be less than zero
|
||||||
qualityModel.totalTicks = Math.max(0, Cura.NewQualityProfilesModel.rowCount() - 1)
|
qualityModel.totalTicks = Math.max(0, Cura.QualityProfilesModel.rowCount() - 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,13 +194,13 @@ Item
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: Math.round(UM.Theme.getSize("sidebar_margin").height / 2)
|
anchors.topMargin: Math.round(UM.Theme.getSize("sidebar_margin").height / 2)
|
||||||
color: (Cura.MachineManager.activeMachine != null && Cura.NewQualityProfilesModel.getItem(index).available) ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
color: (Cura.MachineManager.activeMachine != null && Cura.QualityProfilesModel.getItem(index).available) ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
||||||
text:
|
text:
|
||||||
{
|
{
|
||||||
var result = ""
|
var result = ""
|
||||||
if(Cura.MachineManager.activeMachine != null)
|
if(Cura.MachineManager.activeMachine != null)
|
||||||
{
|
{
|
||||||
result = Cura.NewQualityProfilesModel.getItem(index).layer_height_without_unit
|
result = Cura.QualityProfilesModel.getItem(index).layer_height_without_unit
|
||||||
|
|
||||||
if(result == undefined)
|
if(result == undefined)
|
||||||
{
|
{
|
||||||
|
@ -265,7 +265,7 @@ Item
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
color: Cura.NewQualityProfilesModel.getItem(index).available ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
color: Cura.QualityProfilesModel.getItem(index).available ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable")
|
||||||
width: 1 * screenScaleFactor
|
width: 1 * screenScaleFactor
|
||||||
height: 6 * screenScaleFactor
|
height: 6 * screenScaleFactor
|
||||||
y: 0
|
y: 0
|
||||||
|
@ -411,9 +411,9 @@ Item
|
||||||
// if the current profile is user-created, switch to a built-in quality
|
// if the current profile is user-created, switch to a built-in quality
|
||||||
if (Cura.SimpleModeSettingsManager.isProfileUserCreated)
|
if (Cura.SimpleModeSettingsManager.isProfileUserCreated)
|
||||||
{
|
{
|
||||||
if (Cura.NewQualityProfilesModel.rowCount() > 0)
|
if (Cura.QualityProfilesModel.rowCount() > 0)
|
||||||
{
|
{
|
||||||
var item = Cura.NewQualityProfilesModel.getItem(0);
|
var item = Cura.QualityProfilesModel.getItem(0);
|
||||||
Cura.MachineManager.activeQualityGroup = item.quality_group;
|
Cura.MachineManager.activeQualityGroup = item.quality_group;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue