qgis/QGIS — pull request #1563 by 3nids (2014-08-28 07:46:49+00:00)
Title: New identify menu

This improves a bit the menu displayed in identify map tool with the "Layer Selection" mode.

Now, the menu allows choosing between features if several features are found for the same layer.
Also, you can open the attribute table for the features of the same layer.

If launched with right-click, the menu will also display attribute and map layer actions (such as "set atlas feature").

The menu has the following hierarchy:
At top level:
* layer names
* identify all
At layer level:
* list all features
* map layer actions for layer or multiple features (such as show attribute table)
At feature level:
* standard identify action
* attribute action
* map layer action for single feature

Generally, the menu is "mouse-move-saving": you won't have a level displayed if it's not necessary. For example:
* if a single feature is found for a layer and attribute/map layer actions are not displayed (left click), you will be able to click on the top level. This is basically as it is done now.
* if left click, the feature level will not be shown, so you will click on the feature at the layer level.
* if attribute/map layer actions are shown and found (right-click) and a single feature is identified for the layer, the layer level will be skipped and the feature level will be shown directly under the top level.

The new QgsIdentifyMenu is (highly) customizable. It should be easy to reuse it in plugins by subclassing QgsMapToolIdentify, set the LayerSelection mode and access it with identifyMenu().
Custom actions (as QgsMapLayerAction) can be easily added. (This is done in app/QgsMapToolIdentifyAction to add the "Show attribute table action").

This PR also adds a QgsActionMenu which creates a menu for a combination of layer/feature and lists attribute and map layer actions.

I have troubles at running actions at feature level (such as "set atlas feature"), I expect this to be solved soon.

Anyway, the menu is displayed properly, so you can easily test the menu to see if it's working as you expect.