Make alert show for time set in cfg (default 4s)
This commit is contained in:
parent
0c493f88d8
commit
be18a5db41
|
@ -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"],
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user