From 20705033fa51361782cce0fd87191b01ec235465 Mon Sep 17 00:00:00 2001 From: "V.G. Bulavintsev" Date: Fri, 28 Feb 2020 19:06:39 +0100 Subject: [PATCH] Check torrents on click in GUI --- .../tribler_gui/widgets/torrentdetailstabwidget.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tribler-gui/tribler_gui/widgets/torrentdetailstabwidget.py b/src/tribler-gui/tribler_gui/widgets/torrentdetailstabwidget.py index d6aba53a53b..a10d70006b5 100644 --- a/src/tribler-gui/tribler_gui/widgets/torrentdetailstabwidget.py +++ b/src/tribler-gui/tribler_gui/widgets/torrentdetailstabwidget.py @@ -40,7 +40,7 @@ def __init__(self, parent): self.healthcheck_timer = QTimer() self.healthcheck_timer.setSingleShot(True) - self.healthcheck_timer.timeout.connect(self.check_torrent_health) + self.healthcheck_timer.timeout.connect(self.on_check_health_clicked) self.currentChanged.connect(self.on_tab_changed) self.rest_request1 = None @@ -120,6 +120,8 @@ def update_with_torrent(self, index, torrent_info): self.rest_request2.cancel_request() self.is_health_checking = False if torrent_info['last_tracker_check'] == 0: + if not self.healthcheck_timer.isActive(): + self.on_check_health_clicked() self.healthcheck_timer.stop() self.healthcheck_timer.start(HEALTHCHECK_DELAY) self.update_health_label( @@ -152,6 +154,8 @@ def check_torrent_health(self): return infohash = self.torrent_info[u'infohash'] + self.is_health_checking = True + def on_cancel_health_check(): self.is_health_checking = False