Prevent hitting Enter repeatedly causing search to stop and start in Get

Books
This commit is contained in:
Kovid Goyal 2013-06-13 15:37:44 +05:30
parent c41df1537c
commit b4f35dcaeb

View File

@ -166,6 +166,10 @@ class SearchDialog(QDialog, Ui_Dialog):
self.searching = False
else:
self.do_search()
# Prevent hitting the enter key twice in quick succession causing
# the search to start and stop
self.search.setEnabled(False)
QTimer.singleShot(1000, lambda :self.search.setEnabled(True))
def do_search(self):
# Stop all running threads.