Skip to content

Commit

Permalink
issue #151, inform the user that a query was started. remove the mess…
Browse files Browse the repository at this point in the history
…age as soon as we have a response and handle it.
  • Loading branch information
mfrasca committed Aug 1, 2016
1 parent 7c54939 commit 67cfce5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bauble/plugins/plants/species_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def sp_species_TPL_callback(found, accepted):
# full acceptedy links. it's TWO boxes that we might show. or
# one if nothing matches.

self.view.close_boxes()
if found:
found = dict((k, utils.to_unicode(v))
for k, v in found.items())
Expand Down Expand Up @@ -247,6 +248,11 @@ def on_sp_species_button_clicked(widget, event=None):
binomial = '%s %s' % (self.model.genus, self.model.sp)
AskTPL(binomial, sp_species_TPL_callback, timeout=2, gui=True
).start()
b0 = self.view.add_message_box(utils.MESSAGE_BOX_INFO)
b0.message = _("querying the plant list")
b0.on_response = lambda b, r: self.view.remove_box(b0)
b0.show()
self.view.add_box(b0)
if event is not None:
return False

Expand Down

0 comments on commit 67cfce5

Please sign in to comment.