Add error dialog
This commit is contained in:
1 parent
52fd7c87aa
commit
e0cc6970ab
5 files changed
+21
-1
No files matched your search
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Added
|
||||
- Version check in settings page
|
||||
- Support for web request body parsing
|
||||
- Error dialog for video load fail
|
||||
|
||||
## [0.4.0] - 2022-11-24
|
||||
### Added
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
function Init()
|
||||
m.top.observeField("buttonSelected", "CloseDialog")
|
||||
end function
|
||||
|
||||
function CloseDialog()
|
||||
m.top.close = true
|
||||
end function
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<component name="Dialog" extends="StandardMessageDialog" >
|
||||
</component>
|
||||
@@ -0,0 +1,7 @@
|
||||
function ErrorMessage(message as string, title as string)
|
||||
dialog = CreateObject("roSGNode", "Dialog")
|
||||
dialog.message = [message]
|
||||
dialog.title = title
|
||||
dialog.buttons = ["Ok"]
|
||||
m.top.getScene().dialog = dialog
|
||||
end function
|
||||
@@ -1,4 +1,5 @@
|
||||
import "pkg:/source/services/Invidious.bs"
|
||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||
|
||||
function ShowVideoScreen(videoId as string, sender as object)
|
||||
m.videoPlayer = CreateObject("roSGNode", "VideoPlayer")
|
||||
@@ -111,7 +112,7 @@ function StartVideoDetailsTask(videoId as string)
|
||||
m.videoPlayer.content = contentNode
|
||||
m.videoPlayer.control = "play"
|
||||
else
|
||||
print "FAILED TO LOAD VIDEO " + videoId
|
||||
ErrorMessage(`Failed to load video ${videoId}`, "Video load fail")
|
||||
CloseVideoPlayer()
|
||||
end if
|
||||
end function)
|
||||
|
||||
Reference in new issue
Block a user