-
-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wxGUI/g.gui.mapswipe: fix hit Apply button if first and second raster aren't chosen #1042
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you enter invalid raster name in one field and leave the other one empty, you won't get any error, so I think this case should be fixed.
2e85895
to
c805d16
Compare
c805d16
to
aa4666f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I further suggest these changes to cover cases when one raster is empty and the other is invalid:
+++ b/gui/wxpython/mapswipe/frame.py
@@ -398,14 +398,15 @@ class SwipeMapFrame(DoubleMapFrame):
self.rasters['first'], self.rasters['second'] = first, second
res1 = self.SetFirstRaster(name=self.rasters['first'])
res2 = self.SetSecondRaster(name=self.rasters['second'])
- if not (res1 and res2) and first and second:
+ if not (res1 and res2) and (first or second):
message = ''
- if not res1:
+ if first and not res1:
message += _("Map <%s> not found. ") % self.rasters[
'first']
- if not res2:
+ if second and not res2:
message += _("Map <%s> not found.") % self.rasters[
'second']
+ if message:
GError(parent=self, message=message)
return
self.ZoomToMap()
… aren't choosed Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
aa4666f
to
7027116
Compare
To Reproduce:
g.gui.mapswipe
Error message:
Show error message dialog if you don't choose first and second raster map: