'Check for spyder updates on github releases using a QThread.'

@Slot()
def check_updates(self, startup=False):

    from spyder.workers.updates import WorkerUpdates
    self.check_updates_action.setDisabled(True)
    if (self.thread_updates is not None):
        self.thread_updates.terminate()
    self.thread_updates = QThread(self)
    self.worker_updates = WorkerUpdates(self, startup=startup)
    self.worker_updates.sig_ready.connect(self._check_updates_ready)
    self.worker_updates.sig_ready.connect(self.thread_updates.quit)
    self.worker_updates.moveToThread(self.thread_updates)
    self.thread_updates.started.connect(self.worker_updates.start)
    self.thread_updates.start()
