Skip to content

Commit

Permalink
Fix end capture valid check
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Oct 20, 2017
1 parent 3eda2fc commit 0fcb946
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/roam/maptools/maptools.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,15 +419,7 @@ def is_safe(message):

def canvasReleaseEvent(self, event):
if event.button() == Qt.RightButton:
errors = self.has_errors()
if errors:
self.error.emit("Invalid geometry. <br>"
"Please recapture. Last capture shown in grey <br>"
"<h2>Errors</h2> {0}".format("<br>".join(error.what() for error in errors)))
self.endinvalidcapture(errors)
return
else:
self.endcapture()
self.endcapture()
return

if not self.editmode:
Expand Down Expand Up @@ -459,6 +451,14 @@ def endinvalidcapture(self, errors):
self.reset()

def endcapture(self):
errors = self.has_errors()
if errors:
self.error.emit("Invalid geometry. <br>"
"Please recapture. Last capture shown in grey <br>"
"<h2>Errors</h2> {0}".format("<br>".join(error.what() for error in errors)))
self.endinvalidcapture(errors)
return

self.capturing = False
self.set_tracking(False)
self.captureaction.setChecked(True)
Expand Down

0 comments on commit 0fcb946

Please sign in to comment.