diff --git a/docs/windows.md b/docs/windows.md index 572ae515a..c0718cae2 100644 --- a/docs/windows.md +++ b/docs/windows.md @@ -94,7 +94,7 @@ the path, and Bazel will be configured to output build products into However, this will not work in PowerShell, as .bat files are executed in a subprocess. To invoke bazel scripts, you will have to adjust your session path manually. -One option is to create a script that sets up your Anki develop environment for you. +One option is to create a script that sets up your Anki development environment for you. Here is an example: ```powershell diff --git a/qt/aqt/mediasync.py b/qt/aqt/mediasync.py index 3f40b77ad..4326ccc94 100644 --- a/qt/aqt/mediasync.py +++ b/qt/aqt/mediasync.py @@ -59,7 +59,7 @@ class MediaSyncer: self._log_and_notify(tr.sync_media_starting()) self._syncing = True self._progress_timer = self.mw.progress.timer( - 1000, self._on_progress, True, True + 1000, self._on_progress, True, True, parent=self.mw ) gui_hooks.media_sync_did_start_or_stop(True) @@ -134,7 +134,7 @@ class MediaSyncer: timer.stop() on_finished() - timer = self.mw.progress.timer(150, check_finished, True, False) + timer = self.mw.progress.timer(150, check_finished, True, False, parent=self.mw) def seconds_since_last_sync(self) -> int: if self.is_syncing(): diff --git a/qt/aqt/progress.py b/qt/aqt/progress.py index a3bd5a3c6..633928b97 100644 --- a/qt/aqt/progress.py +++ b/qt/aqt/progress.py @@ -70,7 +70,7 @@ class ProgressManager: pass else: # retry in 100ms - self.timer(100, func, False, requiresCollection) + self.timer(100, func, False, requiresCollection, parent=parent) t = QTimer(parent) if not repeat: diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index bb806dc3d..1723e7777 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -757,12 +757,15 @@ def closeTooltip() -> None: if _tooltipLabel: try: _tooltipLabel.deleteLater() - except: + except RuntimeError: # already deleted as parent window closed pass _tooltipLabel = None if _tooltipTimer: - _tooltipTimer.stop() + try: + _tooltipTimer.deleteLater() + except RuntimeError: + pass _tooltipTimer = None