Skip to content

Commit 8ee1667

Browse files
committed
move another main thread call to the context/api
1 parent d702cb6 commit 8ee1667

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

safeeyes/context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import typing
2222

2323
from safeeyes import utility
24-
from safeeyes.model import State
24+
from safeeyes.model import BreakType, State
2525

2626
if typing.TYPE_CHECKING:
2727
from safeeyes.safeeyes import SafeEyes
@@ -60,8 +60,8 @@ def status(self) -> str:
6060
def quit(self) -> None:
6161
utility.execute_main_thread(self._application.quit)
6262

63-
def take_break(self, break_type=None) -> None:
64-
self._application.take_break(break_type)
63+
def take_break(self, break_type: typing.Optional[BreakType] = None) -> None:
64+
utility.execute_main_thread(self._application.take_break, break_type)
6565

6666
def has_breaks(self, break_type=None) -> bool:
6767
return self._application.safe_eyes_core.has_breaks(break_type)

safeeyes/safeeyes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from safeeyes.ui.about_dialog import AboutDialog
3131
from safeeyes.ui.break_screen import BreakScreen
3232
from safeeyes.ui.required_plugin_dialog import RequiredPluginDialog
33-
from safeeyes.model import State, RequiredPluginException
33+
from safeeyes.model import BreakType, State, RequiredPluginException
3434
from safeeyes.translations import translate as _
3535
from safeeyes.plugin_manager import PluginManager
3636
from safeeyes.core import SafeEyesCore
@@ -536,9 +536,9 @@ def stop_break(self):
536536
self.plugins_manager.stop_break()
537537
return True
538538

539-
def take_break(self, break_type=None):
539+
def take_break(self, break_type: typing.Optional[BreakType] = None) -> None:
540540
"""Take a break now."""
541-
utility.execute_main_thread(self.safe_eyes_core.take_break, break_type)
541+
self.safe_eyes_core.take_break(break_type)
542542

543543
def status(self):
544544
"""Return the status of Safe Eyes."""

0 commit comments

Comments
 (0)