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
|
### Added
|
||||||
- Version check in settings page
|
- Version check in settings page
|
||||||
- Support for web request body parsing
|
- Support for web request body parsing
|
||||||
|
- Error dialog for video load fail
|
||||||
|
|
||||||
## [0.4.0] - 2022-11-24
|
## [0.4.0] - 2022-11-24
|
||||||
### Added
|
### 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:/source/services/Invidious.bs"
|
||||||
|
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||||
|
|
||||||
function ShowVideoScreen(videoId as string, sender as object)
|
function ShowVideoScreen(videoId as string, sender as object)
|
||||||
m.videoPlayer = CreateObject("roSGNode", "VideoPlayer")
|
m.videoPlayer = CreateObject("roSGNode", "VideoPlayer")
|
||||||
@@ -111,7 +112,7 @@ function StartVideoDetailsTask(videoId as string)
|
|||||||
m.videoPlayer.content = contentNode
|
m.videoPlayer.content = contentNode
|
||||||
m.videoPlayer.control = "play"
|
m.videoPlayer.control = "play"
|
||||||
else
|
else
|
||||||
print "FAILED TO LOAD VIDEO " + videoId
|
ErrorMessage(`Failed to load video ${videoId}`, "Video load fail")
|
||||||
CloseVideoPlayer()
|
CloseVideoPlayer()
|
||||||
end if
|
end if
|
||||||
end function)
|
end function)
|
||||||
|
|||||||
Reference in new issue
Block a user