[QMS-651] Add configuration option to handle distance rounding #657
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the linked issue for this pull request:
QMS-#651
What you have done:
Add a box in the units configuration that allows the user to set from which value the rounding of distances will be done for metric and imperial units.
It is not necessary that this value exists previously in the configuration file, if it does not exist it is set the first time we use the units dialog. This gives compatibility with existing conf files.
It respects the current concept (which I like) that the larger the distance the less decimal digits are displayed.
It is very simple to use. By default we have the value 20 which corresponds to the current value and gives us this:
If you set the value to 80 , it would use these ranges
and so on ...
Steps to perform a simple smoke test:
For convenience you can download this gpx file containing 5 tracks, named with different distances. Open it in QMS and go to edit the project, so that you see the summary with the data of all 5 tracks in the same view.
First check that you see the distances with the decimals according to the current behaviour.
Try with another value: 'Menu - View - Setup Units' Modify the value. You can use the mouse wheel. Then click on refresh (top right) on the project summary view and check how you see now the distances according to the value you have set. You can repeat it for different values.
Check how the distances are displayed with the ruler.
You can also change the unit to miles (Imperial) and see how it works.
Does the code comply to the coding rules and naming conventions Coding Guidelines:
Is every user facing string in a tr() macro?
Did you add the ticket number and title into the changelog? Keep the numeric order in each release block.
Remark: My C++ skills are very limited and I have been able to write this by looking at other parts of the code. Probably my proposal can be refined.