Introduced the concept of 'Focus Item' and some more code polishing

Review Request #119783 - Created Aug. 14, 2014 and submitted

Information
Calin Cruceru
marble
master
Reviewers
marble

This patch introduces the concept of Focus Item to Annotate Plugin which means that in order to execute some actions (or to simply modify an item) the user has to first mark the item as 'selected'. Torsten mentioned in Randa this feature and I thought it would be really nice to have something like this.

I also reordered the actions within the View menu (or within the Toolbar in marble-qt) to the same order they will be when we will move them to a separate dockwidget or something similar. So there are first the buttons for saving/loading annotation files. Then there are the actions which, when triggered, lead to adding the specified graphic item (notice that I modified a little bit the way polygons are being added, so that it is consistent with paths and placemarks - now the dialog pops-up immediately when pressing 'Add Polygon'). Then, there are the actions which get activated when an item has the focus, depending on the item's type (for example, when a polygon has the focus, all four - Add Polygon Hole, Merge Nodes, Add Nodes, Remove Item get enabled while when a placemark has the focus, only Remove Item is enabled). Notice that I changed the significance of 'Remove Item' action: it used to enter a state on which every clicked item was being removed; now, it has the significance of removing the focus item, which I find more intuitive and useful.

Also, when the edit dialog of a graphic item is being shown, all actions are disabled to avoid opening multiple dialogs and things like that. Also, in the same situation, right clicking an item won't work - otherwise, one could remove the item while the dialog is being shown and the dialog won't get destroyed which would lead to crashes.

One problem (in fact it is not a problem, but a feature which is missing) is that currently we don't have some visual effect when a placemark (text annotation) has the focus (you can only see that the 'Remove Item' within the toolbar gets enabled at the moment); for polygons/polylines - we show the nodes when the item has the focus. So I'm waiting suggestions on what should happen when a placemark has the focus.

Next I will work on optimizations, solving some issues (like the icons for placemarks, saving osm files, deep-copying geometries, etc) and writing documentation.


  

Issues

  • 0
  • 2
  • 0
  • 2
Description From Last Updated
Calin Cruceru
Calin Cruceru
Calin Cruceru
Torsten Rahn
Torsten Rahn
Calin Cruceru
Review request changed

Status: Closed (submitted)

Loading...