camptocamp/cgxp — pull request #744 by asaunier (2014-05-01 16:06:30+00:00)
Title: GetFeature: don't activate controls by default when an action is available

As for now, with the GetFeature plugin, the "click" (WMS GetFeatureInfo) and "ctrl" (drag-drop while pushing the Ctrl key) controls are always activated, even though an action button is available in the toolbar and toggled off.

This does not really make sense => the controls should be active only when the button is ON. In addition it may conflicts with other tools that might be activated by default.

This PR then suggests to activate/deactivate the click and ctrl controls when the getfeature action is toggle on/off (ie. when the "toolWFS" control - linked to the action - is activated/deactivated).

Since the "toolWFS" control behaves the same way than the "ctrl" control (drag-drop), the latter is useless when the action is available => in the PR we add the control only when the "toolWFS" control is not available (no button).

The changes have been sucessfully tested when:
- no actionTarget (no button) is set
- an actionTarget is provided and the "autoDeactivate" option is on (controls are deactivated after each query)
- an actionTarget is provided and the "autoDeactivate" option is off (controls remain active after each query)