ptmenu: Refactor the build of the menu
This PR is a first step to provide a bit more flexibility to the menus.
Right now the code contains a lot of if-elif-else cases to distinguish each behaviors. That's typically something for OOP.
This PR rework the code as OOP with wrapper classes.
- Rename
DlgWidget
as_PtWrapper
, that's just an internal private wrapper - Split
_PtWrapper
into different classes (mostly one perUserDlg_
) - Create
BlissDialog.WRAPPERS
for the mapping fromUserDlg_
toPtWrapper
- User
Container
are wrapped the same way - Fix issues on
UserChoice
,.defval
was not always properly updated - Reduce the scope of some public function/class
- Some of them was set deprecated for now, just in case
- Added a test coverage
- Unfortunately i haven't found a way to launch in an App
- But this can be launch interactively with
pytest tests/shell/test_dialogs.py -s -x --ptmenu
As side result, third party library like ebs-tomo can now add extra components.
Edited by Valentin Valls