Skip to content

Commit

Permalink
dont use progress dialog to block key input
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenrats committed Dec 2, 2023
2 parents b9a15fd + 5b7b481 commit ac3ab20
Showing 37 changed files with 82 additions and 16 deletions.
1 change: 1 addition & 0 deletions components/Buttons/JFButtons.bs
Original file line number Diff line number Diff line change
@@ -102,6 +102,7 @@ end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

if key = "left"
2 changes: 2 additions & 0 deletions components/Buttons/SlideOutButton.bs
Original file line number Diff line number Diff line change
@@ -88,6 +88,8 @@ sub onPaddingChanged()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

if key = "OK" and m.top.hasFocus()
1 change: 1 addition & 0 deletions components/ItemGrid/Alpha.bs
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

if key = "OK"
3 changes: 3 additions & 0 deletions components/ItemGrid/ItemGrid.bs
Original file line number Diff line number Diff line change
@@ -757,6 +757,9 @@ function getItemFocused()
end function

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

if not press then return false

if m.itemGrid.opacity = 1
3 changes: 3 additions & 0 deletions components/ItemGrid/ItemGridOptions.bs
Original file line number Diff line number Diff line change
@@ -247,6 +247,9 @@ sub saveFavoriteItemSelected(msg)
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

if key = "down" or (key = "OK" and m.buttons.hasFocus())
m.buttons.setFocus(false)
m.menus[m.selectedItem].setFocus(true)
3 changes: 3 additions & 0 deletions components/ItemGrid/MovieLibraryView.bs
Original file line number Diff line number Diff line change
@@ -834,6 +834,9 @@ sub onChannelSelected(msg)
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

if not press then return false

if key = "left" and m.voiceBox.isinFocusChain()
2 changes: 2 additions & 0 deletions components/ItemGrid/MusicLibraryView.bs
Original file line number Diff line number Diff line change
@@ -699,6 +699,8 @@ sub onChannelSelected(msg)
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

if key = "left" and m.voiceBox.isinFocusChain()
17 changes: 2 additions & 15 deletions components/JFScene.bs
Original file line number Diff line number Diff line change
@@ -11,22 +11,9 @@ sub isLoadingChanged()
m.spinner.visible = m.top.isLoading
end sub

' Triggered when the disableRemote boolean component field is changed
sub disableRemoteChanged()
if m.top.disableRemote
dialog = createObject("roSGNode", "ProgressDialog")
dialog.id = "invisibiledialog"
dialog.visible = false
dialog.opacity = 0
m.top.dialog = dialog
else
if isValid(m.top.dialog)
m.top.dialog.close = true
end if
end if
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.disableRemote then return false
if not press then return false

if key = "back"
2 changes: 1 addition & 1 deletion components/JFScene.xml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
<Spinner id="spinner" translation="[897, 477]" visible="false" />
</children>
<interface>
<field id="disableRemote" type="boolean" value="false" onchange="disableRemoteChanged" />
<field id="disableRemote" type="boolean" value="false" />
<field id="isLoading" type="boolean" value="false" onchange="isLoadingChanged" />
<field id="exit" type="boolean" alwaysNotify="true" />
</interface>
2 changes: 2 additions & 0 deletions components/RadioDialog.bs
Original file line number Diff line number Diff line change
@@ -117,6 +117,8 @@ sub onContentDataChanged()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if key = "right"
' By default RIGHT from the option list selects the OK button
' Instead, keep the user on the option list
3 changes: 3 additions & 0 deletions components/config/LoginScene.bs
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@ end sub

function onKeyEvent(key as string, press as boolean) as boolean
' Returns true if user navigates to a new focusable element

if m.top.getScene().disableRemote then return false

if not press then return false

list = m.top.findNode("configOptions")
3 changes: 3 additions & 0 deletions components/config/SetServerScreen.bs
Original file line number Diff line number Diff line change
@@ -17,6 +17,9 @@ sub init()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

m.log.debug("SetServerScreen onKeyEvent", key, press)

if not press then return true
3 changes: 3 additions & 0 deletions components/home/HomeRows.bs
Original file line number Diff line number Diff line change
@@ -557,6 +557,9 @@ sub itemSelected()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

if press
if key = "play"
print "play was pressed from homerow"
3 changes: 3 additions & 0 deletions components/keyboards/IntegerKeyboard.bs
Original file line number Diff line number Diff line change
@@ -3,6 +3,9 @@ sub init()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

if key = "back"
m.top.escape = key
return true
2 changes: 2 additions & 0 deletions components/liveTv/ProgramDetails.bs
Original file line number Diff line number Diff line change
@@ -316,6 +316,8 @@ sub onAnimationComplete()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

if key = "OK" and m.viewChannelButton.hasFocus()
2 changes: 2 additions & 0 deletions components/liveTv/schedule.bs
Original file line number Diff line number Diff line change
@@ -285,6 +285,8 @@ sub onRecordOperationDone()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

detailsGrp = m.top.findNode("detailsPane")
2 changes: 2 additions & 0 deletions components/login/UserRow.bs
Original file line number Diff line number Diff line change
@@ -47,6 +47,8 @@ sub setUser()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

return false
2 changes: 2 additions & 0 deletions components/login/UserSelect.bs
Original file line number Diff line number Diff line change
@@ -25,6 +25,8 @@ sub redraw()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

if key = "back"
2 changes: 2 additions & 0 deletions components/movies/MovieDetails.bs
Original file line number Diff line number Diff line change
@@ -347,6 +347,8 @@ end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

' Due to the way the button pressed event works, need to catch the release for the button as the press is being sent
' directly to the main loop. Will get this sorted in the layout update for Movie Details
if key = "OK" and m.top.findNode("options-button").isInFocusChain()
2 changes: 2 additions & 0 deletions components/movies/MovieOptions.bs
Original file line number Diff line number Diff line change
@@ -96,6 +96,8 @@ end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

if key = "down" or (key = "OK" and m.top.findNode("buttons").hasFocus())
m.top.findNode("buttons").setFocus(false)
m.menus[m.selectedItem].setFocus(true)
2 changes: 2 additions & 0 deletions components/music/AlbumGrid.bs
Original file line number Diff line number Diff line change
@@ -37,6 +37,8 @@ function getData()
end function

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

if key = "up"
3 changes: 3 additions & 0 deletions components/music/AlbumView.bs
Original file line number Diff line number Diff line change
@@ -95,6 +95,9 @@ sub setOnScreenTextValues(json)
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

if not press then return false

if key = "options"
2 changes: 2 additions & 0 deletions components/music/ArtistView.bs
Original file line number Diff line number Diff line change
@@ -252,6 +252,8 @@ end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

if m.buttonGrp.isInFocusChain()
if key = "OK"
if press
2 changes: 2 additions & 0 deletions components/music/AudioPlayerView.bs
Original file line number Diff line number Diff line change
@@ -543,6 +543,8 @@ end sub
' Process key press events
function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

' Key bindings for remote control buttons
if press
' If user presses key to turn off screensaver, don't do anything else with it
2 changes: 2 additions & 0 deletions components/music/PlaylistView.bs
Original file line number Diff line number Diff line change
@@ -94,6 +94,8 @@ sub setOnScreenTextValues(json)
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

if key = "options"
2 changes: 2 additions & 0 deletions components/options/OptionsSlider.bs
Original file line number Diff line number Diff line change
@@ -24,6 +24,8 @@ sub setFields()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

if key = "options" or key = "back"
2 changes: 2 additions & 0 deletions components/photos/PhotoDetails.bs
Original file line number Diff line number Diff line change
@@ -110,6 +110,8 @@ sub isRandomChanged()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

if key = "right"
3 changes: 3 additions & 0 deletions components/quickConnect/QuickConnectDialog.bs
Original file line number Diff line number Diff line change
@@ -59,6 +59,9 @@ sub onButtonSelected()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

if not press then return false

' Note that "OK" does not get sent here, hence onButtonSelected() above.
2 changes: 2 additions & 0 deletions components/search/SearchResults.bs
Original file line number Diff line number Diff line change
@@ -53,6 +53,8 @@ end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

m.searchAlphabox = m.top.findNode("search_Key")
if m.searchAlphabox.textEditBox.hasFocus()
m.searchAlphabox.textEditBox.translation = "[0, -150]"
2 changes: 2 additions & 0 deletions components/settings/settings.bs
Original file line number Diff line number Diff line change
@@ -231,6 +231,8 @@ function isFormInFocus() as boolean
end function

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

if (key = "back" or key = "left") and m.settingsMenu.focusedChild <> invalid and m.userLocation.Count() > 1
2 changes: 2 additions & 0 deletions components/tvshows/TVEpisodeRow.bs
Original file line number Diff line number Diff line change
@@ -56,6 +56,8 @@ function setData()
end function

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

return false
2 changes: 2 additions & 0 deletions components/tvshows/TVEpisodeRowWithOptions.bs
Original file line number Diff line number Diff line change
@@ -81,6 +81,8 @@ sub videoOptionsClosed()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

if key = "options" and isValid(m.rows.focusedChild) and isValid(m.rows.focusedChild.rowItemFocused)
3 changes: 3 additions & 0 deletions components/tvshows/TVEpisodes.bs
Original file line number Diff line number Diff line change
@@ -68,6 +68,9 @@ end function

' Handle navigation input from the remote and act on it
function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

if key = "left" and m.tvEpisodeRow.hasFocus()
m.shuffle.setFocus(true)
return true
2 changes: 2 additions & 0 deletions components/tvshows/TVListOptions.bs
Original file line number Diff line number Diff line change
@@ -98,6 +98,8 @@ end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

if key = "down" or (key = "OK" and m.top.findNode("buttons").hasFocus())
m.top.findNode("buttons").setFocus(false)
m.menus[m.selectedItem].setFocus(true)
3 changes: 3 additions & 0 deletions components/tvshows/TVShowDetails.bs
Original file line number Diff line number Diff line change
@@ -183,6 +183,9 @@ sub onShuffleEpisodeDataLoaded()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

if key = "OK" or key = "play"
if m.Shuffle.hasFocus()
m.getShuffleEpisodesTask.showID = m.top.itemContent.id
2 changes: 2 additions & 0 deletions components/video/OSD.bs
Original file line number Diff line number Diff line change
@@ -139,6 +139,8 @@ sub onButtonSelected()
end sub

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false
if not press then return false

if key = "OK"
2 changes: 2 additions & 0 deletions components/video/VideoPlayerView.bs
Original file line number Diff line number Diff line change
@@ -581,6 +581,8 @@ end function

function onKeyEvent(key as string, press as boolean) as boolean

if m.top.getScene().disableRemote then return false

' Keypress handler while user is inside the chapter menu
if m.chapterMenu.hasFocus()
if not press then return false

0 comments on commit ac3ab20

Please sign in to comment.