fix ok presses

This commit is contained in:
sevenrats 2023-02-01 17:26:33 -05:00
parent c0561af6af
commit 6e8f476b02
2 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- A Failure Dialog is a regular dialog, except it takes key releases -->
<!-- instead of presses so we don't unintentionally trigger playback -->
<component name="FailureDialog" extends="Dialog">
<interface>
<field id="Title" type="string" onchange="setTitle" />
<field id="Overview" type="string" onChange="setOverview" />
</interface>
<script type="text/brightscript">
<![CDATA[
function onKeyEvent(key as string, press as boolean) as boolean
if press = true then return false
if key = "OK"
m.top.close = true
end if
return true
end function
]]>
</script>
</component>

View File

@ -112,8 +112,9 @@ sub onState(msg)
m.top.retryWithTranscoding = true ' If playback was not reported, retry with transcoding m.top.retryWithTranscoding = true ' If playback was not reported, retry with transcoding
else else
' If an error was encountered, Display dialog ' If an error was encountered, Display dialog
dialog = createObject("roSGNode", "Dialog") dialog = createObject("roSGNode", "FailureDialog")
dialog.title = tr("Error During Playback") dialog.title = tr("Error During Playback")
dialog.buttons = [tr("OK")]
dialog.message = tr("An error was encountered while playing this item.") dialog.message = tr("An error was encountered while playing this item.")
m.top.getScene().dialog = dialog m.top.getScene().dialog = dialog
end if end if
@ -195,8 +196,9 @@ sub bufferCheck(msg)
m.top.callFunc("refresh") m.top.callFunc("refresh")
else else
' If buffering has stopped Display dialog ' If buffering has stopped Display dialog
dialog = createObject("roSGNode", "Dialog") dialog = createObject("roSGNode", "FailureDialog")
dialog.title = tr("Error Retrieving Content") dialog.title = tr("Error Retrieving Content")
dialog.buttons = [tr("OK")]
dialog.message = tr("There was an error retrieving the data for this item from the server.") dialog.message = tr("There was an error retrieving the data for this item from the server.")
m.top.getScene().dialog = dialog m.top.getScene().dialog = dialog