Closed lauramurgatroyd closed 1 year ago
Make sure it can handle the following widget types:
As well as their status (i.e. current value) we also want to save and be able to reload whether the widgets are enabled or not. Should we have two dictionaries - one for widget values and one for widget enabled?
Or one with multiple info per widget?
Each widget could have a dict with 'value', 'enabled' and 'visibility'. value could be a bool, str or int depending on the type of widget.
e.g. state = {'widget name' : {'value': True, 'visibility': False, 'enabled': True}}
Current code used for saving and restoring widgets in viewer toolbar dialogs is here: https://github.com/Dagonite/CILViewer/blob/3c070b25fbbea7dc35bf8b77a21b784998e973d0/Wrappers/Python/ccpi/viewer/ui/SettingsDialog.py#L35-L59
https://github.com/paskino/qt-elements/blob/3efa58cf7dc4f2bb87565d0165179805ff237b18/eqt/ui/UIFormWidget.py#L4
I think it would be best to save a dictionary with the name of the widget and its state