Adjustment to make pyflakes happy re: timer
This commit is contained in:
parent
9ded9b4a10
commit
28c0dd761f
1 changed files with 7 additions and 4 deletions
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
||||||
import math
|
import math
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from PySide6.QtCore import Qt, QTimer, Signal, Slot, QSignalBlocker
|
from PySide6.QtCore import Qt, QTimer, Signal, Slot
|
||||||
from PySide6.QtWidgets import (
|
from PySide6.QtWidgets import (
|
||||||
QFrame,
|
QFrame,
|
||||||
QVBoxLayout,
|
QVBoxLayout,
|
||||||
|
|
@ -167,9 +167,12 @@ class PomodoroManager:
|
||||||
# Untoggle the toolbar button without retriggering the slot
|
# Untoggle the toolbar button without retriggering the slot
|
||||||
tool_bar = getattr(self._parent, "toolBar", None)
|
tool_bar = getattr(self._parent, "toolBar", None)
|
||||||
if tool_bar is not None and hasattr(tool_bar, "actTimer"):
|
if tool_bar is not None and hasattr(tool_bar, "actTimer"):
|
||||||
blocker = QSignalBlocker(tool_bar.actTimer)
|
action = tool_bar.actTimer
|
||||||
tool_bar.actTimer.setChecked(False)
|
was_blocked = action.blockSignals(True)
|
||||||
del blocker
|
try:
|
||||||
|
action.setChecked(False)
|
||||||
|
finally:
|
||||||
|
action.blockSignals(was_blocked)
|
||||||
|
|
||||||
# Remove the embedded widget
|
# Remove the embedded widget
|
||||||
self.cancel_timer()
|
self.cancel_timer()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue