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

@ -23,6 +23,7 @@ class SettingsExportGroup(QObject):
self._category_details = category_details
self._extruder_index = extruder_index
self._extruder_color = extruder_color
self._visible_settings = []
@pyqtProperty(str, constant=True)
def name(self):
@ -32,6 +33,14 @@ class SettingsExportGroup(QObject):
def settings(self):
return self._settings
@pyqtProperty(list, constant=True)
def visibleSettings(self):
if self._visible_settings == []:
for item in self._settings:
if item.isVisible:
self._visible_settings.append(item)
return self._visible_settings
@pyqtProperty(int, constant=True)
def category(self):
return self._category