Skip to content

Commit

Permalink
Merge pull request #5129 from rlaverde/keyboardinterrupt-spinner
Browse files Browse the repository at this point in the history
PR: Avoid KeyboardInterrupt to raise an error in waitingspinner
  • Loading branch information
ccordoba12 authored Sep 7, 2017
2 parents 45dad7f + 77115ea commit b8256e9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion spyder/widgets/findinfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,6 @@ def __init__(self, parent):
self.spinner = QWaitingSpinner(self, centerOnParent=False)
self.spinner.setNumberOfLines(12)
self.spinner.setInnerRadius(2)
self.spinner.start()
layout = QHBoxLayout()
layout.addWidget(self.spinner)
layout.addWidget(self.status_text)
Expand All @@ -799,6 +798,16 @@ def set_label_path(self, path, folder=False):
def reset(self):
self.status_text.setText(_(" Searching for files..."))

def showEvent(self, event):
"""Override show event to start waiting spinner."""
QWidget.showEvent(self, event)
self.spinner.start()

def hideEvent(self, event):
"""Override hide event to stop waiting spinner."""
QWidget.hideEvent(self, event)
self.spinner.stop()


class FindInFilesWidget(QWidget):
"""
Expand Down

0 comments on commit b8256e9

Please sign in to comment.