Add actual buttons to details page, one of which plays
This commit is contained in:
parent
d7105c061f
commit
196bb4d1f0
|
@ -29,7 +29,6 @@ sub itemContentChanged()
|
|||
setFieldText("video_codec", "Video: " + itemData.mediaStreams[0].displayTitle)
|
||||
setFieldText("audio_codec", "Audio: " + itemData.mediaStreams[1].displayTitle)
|
||||
' TODO - cmon now. these are buttons, not words
|
||||
setFieldText("buttons", "Play, Delete, Watched, Favorite, ...")
|
||||
if itemData.taglines.count() > 0
|
||||
setFieldText("tagline", itemData.taglines[0])
|
||||
end if
|
||||
|
|
|
@ -18,7 +18,12 @@
|
|||
<Label id="director" />
|
||||
<Label id="video_codec" />
|
||||
<Label id="audio_codec" />
|
||||
<Label id="buttons" />
|
||||
<ButtonGroup id="buttons" layoutDirection="horiz" itemSpacings="[10, 0]">
|
||||
<Button text="Play" />
|
||||
<Button text="Delete" />
|
||||
<Button text="Watched" />
|
||||
<Button text="Favorite" />
|
||||
</ButtonGroup>
|
||||
<Label id="tagline" />
|
||||
<Label id="overview" />
|
||||
|
||||
|
@ -37,7 +42,7 @@
|
|||
main = m.top.findNode("main_group")
|
||||
dimensions = m.top.getScene().currentDesignResolution
|
||||
|
||||
m.top.setfocus(true)
|
||||
m.top.findNode("buttons").setFocus(true)
|
||||
end sub
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -10,6 +10,12 @@ sub itemFocusedQ(msg) as boolean
|
|||
return type(msg) = "roSGNodeEvent" and msg.getField() = "itemFocused"
|
||||
end sub
|
||||
|
||||
sub buttonSelectedQ(msg) as boolean
|
||||
' "Q" stands for "Question mark" since buttonSelected? wasn't acceptable
|
||||
' Probably needs a better name, but unique for now
|
||||
return type(msg) = "roSGNodeEvent" and msg.getField() = "buttonSelected"
|
||||
end sub
|
||||
|
||||
sub getMsgRowTarget(msg) as object
|
||||
node = msg.getRoSGNode()
|
||||
coords = node.rowItemSelected
|
||||
|
|
|
@ -131,7 +131,7 @@ sub ShowMovieOptions(library_id)
|
|||
ShowMovieDetails(target.movieID)
|
||||
'showVideoPlayer(target.movieID)
|
||||
else if itemFocusedQ(msg)
|
||||
print "Selected " + msg.getNode()
|
||||
'print "Selected " + msg.getNode()
|
||||
end if
|
||||
end while
|
||||
end sub
|
||||
|
@ -146,12 +146,18 @@ sub ShowMovieDetails(movie_id)
|
|||
|
||||
scene.itemJson = ItemMetaData(movie_id)
|
||||
|
||||
buttons = scene.findNode("buttons")
|
||||
buttons.observeField("buttonSelected", port)
|
||||
|
||||
while true
|
||||
msg = wait(0, port)
|
||||
if type(msg) = "roSGScreenEvent" and msg.isScreenClosed() then
|
||||
return
|
||||
else if itemSelectedQ(msg)
|
||||
' showVideoPlayer(target.movieID)
|
||||
else if buttonSelectedQ(msg)
|
||||
button = msg.getROSGNode()
|
||||
if button.buttonSelected = 0
|
||||
showVideoPlayer(movie_id)
|
||||
end if
|
||||
else
|
||||
print msg
|
||||
print type(msg)
|
||||
|
|
Loading…
Reference in New Issue
Block a user