mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-31 02:25:57 +08:00

Introduced a new property 'show_in_menu' to control the visibility of individual settings in 3MFWriter plugin. Modified 'SettingExport' class constructor to store this visibility status. Also, updated the 'SettingsExportGroup' model to filter the settings based on visibility before presenting them in the GUI. CURA-11723
44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
# Copyright (c) 2024 Ultimaker B.V.
|
|
# Cura is released under the terms of the LGPLv3 or higher.
|
|
|
|
from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal
|
|
|
|
|
|
class SettingExport(QObject):
|
|
|
|
def __init__(self, id, name, value, selectable, show):
|
|
super().__init__()
|
|
self.id = id
|
|
self._name = name
|
|
self._value = value
|
|
self._selected = selectable
|
|
self._selectable = selectable
|
|
self._show_in_menu = show
|
|
|
|
@pyqtProperty(str, constant=True)
|
|
def name(self):
|
|
return self._name
|
|
|
|
@pyqtProperty(str, constant=True)
|
|
def value(self):
|
|
return self._value
|
|
|
|
selectedChanged = pyqtSignal(bool)
|
|
|
|
def setSelected(self, selected):
|
|
if selected != self._selected:
|
|
self._selected = selected
|
|
self.selectedChanged.emit(self._selected)
|
|
|
|
@pyqtProperty(bool, fset = setSelected, notify = selectedChanged)
|
|
def selected(self):
|
|
return self._selected
|
|
|
|
@pyqtProperty(bool, constant=True)
|
|
def selectable(self):
|
|
return self._selectable
|
|
|
|
@pyqtProperty(bool, constant=True)
|
|
def isVisible(self):
|
|
return self._show_in_menu
|