Skip to content

Commit

Permalink
Hack: Enable handling for the Kodi select dialog during video playbac…
Browse files Browse the repository at this point in the history
…k to enable 3D mode selection - #92
  • Loading branch information
ruuk committed Aug 31, 2018
1 parent 2d50b53 commit 78f9acc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions lib/windows/seekdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ def onReInit(self):
self.updateProgress()

def onAction(self, action):
if xbmc.getCondVisibility('Window.IsActive(selectdialog)'):
if self.doKodiSelectDialogHack(action):
return

try:
self.resetTimeout()

Expand Down Expand Up @@ -293,6 +297,23 @@ def onAction(self, action):

kodigui.BaseDialog.onAction(self, action)

def doKodiSelectDialogHack(self, action):
command = {
xbmcgui.ACTION_MOVE_UP: "Up",
xbmcgui.ACTION_MOVE_DOWN: "Down",
xbmcgui.ACTION_MOVE_LEFT: "Right", # Not sure if these are actually reversed or something else is up here
xbmcgui.ACTION_MOVE_RIGHT: "Left",
xbmcgui.ACTION_SELECT_ITEM: "Select",
xbmcgui.ACTION_PREVIOUS_MENU: "Back",
xbmcgui.ACTION_NAV_BACK: "Back"
}.get(action.getId())

if command is not None:
xbmc.executebuiltin('Action({0},selectdialog)'.format(command))
return True

return False

def onFocus(self, controlID):
if controlID == self.MAIN_BUTTON_ID:
self.selectedOffset = self.trueOffset()
Expand Down
4 changes: 2 additions & 2 deletions resources/skins/Main/1080i/script-plex-seek_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<onclick condition="String.IsEmpty(Window.Property(button.seek))">SetProperty(show.OSD,1)</onclick>
</control>
<control type="group" id="802">
<visible>[!String.IsEmpty(Window.Property(show.OSD)) | Window.IsVisible(seekbar) | !String.IsEmpty(Window.Property(button.seek))] + !Window.IsVisible(osdvideosettings) + !Window.IsVisible(osdaudiosettings) + !Window.IsVisible(subtitlesearch) + !Window.IsActive(playerprocessinfo)</visible>
<visible>[!String.IsEmpty(Window.Property(show.OSD)) | Window.IsVisible(seekbar) | !String.IsEmpty(Window.Property(button.seek))] + !Window.IsVisible(osdvideosettings) + !Window.IsVisible(osdaudiosettings) + !Window.IsVisible(subtitlesearch) + !Window.IsActive(playerprocessinfo) + !Window.IsActive(selectdialog)</visible>
<animation effect="fade" time="200" delay="200" end="0">Hidden</animation>
<control type="group">
<visible>String.IsEmpty(Window.Property(settings.visible)) + [Window.IsVisible(seekbar) | Window.IsVisible(videoosd) | Player.ShowInfo]</visible>
Expand Down Expand Up @@ -180,7 +180,7 @@
</control>
</control>
<control type="group" id="801">
<visible>!String.IsEmpty(Window.Property(show.OSD)) + !Window.IsVisible(osdvideosettings) + !Window.IsVisible(osdaudiosettings)</visible>
<visible>!String.IsEmpty(Window.Property(show.OSD)) + !Window.IsVisible(osdvideosettings) + !Window.IsVisible(osdaudiosettings) + !Window.IsActive(selectdialog)</visible>
<animation effect="fade" time="200" delay="200" end="0">Hidden</animation>
<control type="group" id="300">
<visible>!String.IsEmpty(Window.Property(has.bif)) + [Control.HasFocus(100) | Control.HasFocus(501) | !String.IsEmpty(Window.Property(button.seek))]</visible>
Expand Down

0 comments on commit 78f9acc

Please sign in to comment.