SaltyPaws / route_pi

Route Plotting plugin for OpenCPN. Plots Great Circle routes, Limited Circle Routes and Rhumb lines.
6 stars 8 forks source link

Fix error dialog being displayed after user cancels saving GPX file (FS#1069) #7

Closed SamsonovAnton closed 8 years ago

SamsonovAnton commented 8 years ago

If exporting a limited-circle route is canceled in the File Save dialog, then an error message is mistakenly displayed: “Error in calculation. Please check input!”. This happened because of error_occured variable misuse. Although great-circle and rhumb-line modes were not seemingly affected by this, I added the same logic to all of the methods.

SamsonovAnton commented 8 years ago

Note that, due to inconsistent line endings (mixed UNIX and DOS style in the same file), my IDE somehow overwrote all the lines instead of only those that changed, and as a result almost the entire src/routegui_impl.cpp got updated without me noticing it. The correct patch can be seen in nohal/route_pi#2.

SaltyPaws commented 8 years ago

Thank you for the fix. I think there is one error in the code. Line 386 reads: if (!user_canceled && !error_occurred){ but it should be if (!user_canceled && error_occurred){ otherwise no action will be taken when an error occurs

I have implemented your fix with minor modifications.