7 | | comme ça, tu contrôles ce dont tu as besoins sans avoir à toujours redéfinir tes widgets dans chaque workspace |
8 | | donc oui, c'est une bonne idée de pouvoir les définir dans le workspace |
9 | | genre par défaut, si pas défini, tous les ajouter |
10 | | sinon, c'est 1 par 1 |
11 | | mais seulement les widgets non associés aux resources |
12 | | comme le mappanel, layertree, geoexttoolbar, etc. |
13 | | (vu que ceux à lier sont déjà à définir dans le tag widgets de la resource du workspace) |
| 3 | When using the XMLWorkspaceConfig, widgets that do not need to be linked to resources are always added to the UI. This is not always wanted. |
| 4 | |
| 5 | '''Historical facts''' |
| 6 | |
| 7 | We used to link all widgets to resources, regardless if that was useful or not, thus was a mean to control what we wanted or not. |
| 8 | |
| 9 | This was really annoying because you needed to be sure that the resource linking them were always added (ACL read rights) otherwise the widgets were excluded. This was the case for widgets such as the toolbar, zoomslider, measuretools, etc. |
| 10 | |
| 11 | An other way to include them was to have a dummy resource for that, but that was really annoying too. |
| 12 | |
| 13 | This behavior disappeared when widgets received their "getMandatoryResourceOptionList" method. When it returns NULL, the widget doesn't need to be linked to resources, thus you no longer need to do so in the config. The only drawback is that from that moment on, they were always added to the UI. |
| 14 | |
| 15 | '''Proposed fix''' |
| 16 | |
| 17 | The XMLConfig driver doesn't need to be fixed. |
| 18 | |
| 19 | For the XMLWorkspaceConfig driver, we could have a 'widgets' tag added to the workspace. When set, it defines the list of widgets to include. Only the widgets that don't need to be linked to resources would be added that way since those that required to do so are already listed in the resources. |
| 20 | |
| 21 | When not set, add all widgets (as currently being done). This would stay the default behavior. |