Add visibility control for settings in 3MFWriter plugin

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
This commit is contained in:
Saumya Jain 2024-03-26 20:37:43 +01:00
parent d3b1294e8b
commit 6ddd96f914
4 changed files with 23 additions and 6 deletions

View file

@ -6,13 +6,14 @@ from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal
class SettingExport(QObject):
def __init__(self, id, name, value, selectable):
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):
@ -36,3 +37,7 @@ class SettingExport(QObject):
@pyqtProperty(bool, constant=True)
def selectable(self):
return self._selectable
@pyqtProperty(bool, constant=True)
def isVisible(self):
return self._show_in_menu