diff --git a/src/python/config_files.py b/src/python/config_files.py index aabb3703..694b5b77 100644 --- a/src/python/config_files.py +++ b/src/python/config_files.py @@ -107,7 +107,8 @@ class UISettings(JSONConfigFile): async def default_data(self) -> JsonData: return { - "theme": "Default.qpl", + "alertOnMessageForMsec": 4000, + "theme": "Default.qpl", "writeAliases": {}, "keys": { "reloadConfig": ["Alt+R"], diff --git a/src/python/pyotherside_events.py b/src/python/pyotherside_events.py index 0c5f8574..81e464ea 100644 --- a/src/python/pyotherside_events.py +++ b/src/python/pyotherside_events.py @@ -37,15 +37,10 @@ class ExitRequested(PyOtherSideEvent): @dataclass class AlertRequested(PyOtherSideEvent): """Request an alert to be shown for msec milliseconds. - If msec is 0 (default), the alert should be shown indefinitely until - the window is focused. - The Alert state for example sets the urgency hint on X11/Wayland, or flashes the taskbar icon on Windows. """ - msec: int = 0 - @dataclass class CoroutineDone(PyOtherSideEvent): diff --git a/src/qml/event_handlers.js b/src/qml/event_handlers.js index 3359e79d..d2645848 100644 --- a/src/qml/event_handlers.js +++ b/src/qml/event_handlers.js @@ -6,9 +6,9 @@ function onExitRequested(exitCode) { } -function onAlertRequested(msec) { +function onAlertRequested() { if (Qt.application.state != Qt.ApplicationActive) { - window.alert(msec) + window.alert(window.settings.alertOnMessageForMsec) } }