mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 15:13:56 -06:00
Introduce a MaterialSettingsVisibilityHandler that will only show those settings relevant for materials
Contriubtes to CURA-342
This commit is contained in:
parent
68a8bcb009
commit
a746710e26
3 changed files with 24 additions and 0 deletions
|
@ -46,6 +46,8 @@ from . import MachineManagerModel
|
|||
from . import ContainerSettingsModel
|
||||
from . import MachineActionManager
|
||||
|
||||
import cura.Settings
|
||||
|
||||
from PyQt5.QtCore import pyqtSlot, QUrl, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS
|
||||
from PyQt5.QtGui import QColor, QIcon
|
||||
from PyQt5.QtQml import qmlRegisterUncreatableType, qmlRegisterSingletonType, qmlRegisterType
|
||||
|
@ -424,6 +426,7 @@ class CuraApplication(QtApplication):
|
|||
qmlRegisterType(ExtrudersModel.ExtrudersModel, "Cura", 1, 0, "ExtrudersModel")
|
||||
|
||||
qmlRegisterType(ContainerSettingsModel.ContainerSettingsModel, "Cura", 1, 0, "ContainerSettingsModel")
|
||||
qmlRegisterType(cura.Settings.MaterialSettingsVisibilityHandler, "Cura", 1, 0, "MaterialSettingsVisibilityHandler")
|
||||
|
||||
qmlRegisterSingletonType(QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, "Actions.qml")), "Cura", 1, 0, "Actions")
|
||||
|
||||
|
|
19
cura/Settings/MaterialSettingsVisibilityHandler.py
Normal file
19
cura/Settings/MaterialSettingsVisibilityHandler.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Copyright (c) 2016 Ultimaker B.V.
|
||||
# Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import UM.Settings.Models
|
||||
|
||||
class MaterialSettingsVisibilityHandler(UM.Settings.Models.SettingVisibilityHandler):
|
||||
def __init__(self, parent = None, *args, **kwargs):
|
||||
super().__init__(parent = parent, *args, **kwargs)
|
||||
|
||||
material_settings = set([
|
||||
"material_print_temperature",
|
||||
"material_bed_temperature",
|
||||
"material_standby_temperature",
|
||||
"cool_fan_speed",
|
||||
"retraction_amount",
|
||||
"retraction_speed",
|
||||
])
|
||||
|
||||
self.setVisible(material_settings)
|
2
cura/Settings/__init__.py
Normal file
2
cura/Settings/__init__.py
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
from .MaterialSettingsVisibilityHandler import MaterialSettingsVisibilityHandler
|
Loading…
Add table
Add a link
Reference in a new issue