UI improvements

* Set 'wait cursor' through a context manager, and possibily display a message, when time-consuming operations are performed (in this case, a call to download data from the platform).
* More intuitive management of selection dialogs, preselecting or deselecting layers in case one of them is active or not.
* Fix a bad merge that duplicated some moved code.