Menu RApido Multilivello
This commit is contained in:
@@ -81,32 +81,37 @@ def delete_key():
|
|||||||
|
|
||||||
config.set_setting("shortcut_key", '')
|
config.set_setting("shortcut_key", '')
|
||||||
|
|
||||||
MAIN_MENU = channelselector.getmainlist()
|
|
||||||
|
|
||||||
class Main(xbmcgui.WindowXMLDialog):
|
class Main(xbmcgui.WindowXMLDialog):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.items = []
|
self.items = []
|
||||||
|
logger.info(str(args))
|
||||||
|
logger.info(str(kwargs))
|
||||||
|
|
||||||
def onInit(self):
|
def onInit(self):
|
||||||
#### Compatibilidad con Kodi 18 ####
|
#### Compatibilidad con Kodi 18 ####
|
||||||
if config.get_platform(True)['num_version'] < 18:
|
if config.get_platform(True)['num_version'] < 18:
|
||||||
self.setCoordinateResolution(2)
|
self.setCoordinateResolution(2)
|
||||||
|
|
||||||
for menuentry in MAIN_MENU:
|
for menuentry in menu:
|
||||||
item = xbmcgui.ListItem(menuentry.title)
|
item = xbmcgui.ListItem(menuentry.title)
|
||||||
item.setProperty("thumb", menuentry.thumbnail)
|
if not submenu and menuentry.channel in ['news', 'channelselector', 'search', 'videolibrary']:
|
||||||
action = {"channel" : menuentry.channel, "action" : menuentry.action}
|
item.setProperty('sub', 'Controls/spinUp-Focus.png')
|
||||||
item.setProperty("action", base64.b64encode(json.dumps(action).encode()))
|
if menuentry.title != 'Redirect':
|
||||||
self.items.append(item)
|
for key, value in json.loads(menuentry.tojson()).items():
|
||||||
|
item.setProperty(key, str(value))
|
||||||
|
item.setProperty('run', menuentry.tojson())
|
||||||
|
self.items.append(item)
|
||||||
|
|
||||||
self.getControl(32500).addItems(self.items)
|
self.getControl(32500).addItems(self.items)
|
||||||
self.setFocusId(32500)
|
self.setFocusId(32500)
|
||||||
|
|
||||||
def onClick(self, control_id):
|
def onClick(self, control_id):
|
||||||
if control_id == 32500:
|
if control_id == 32500:
|
||||||
action = self.getControl(32500).getSelectedItem().getProperty("action")
|
action = self.getControl(32500).getSelectedItem().getProperty('run')
|
||||||
xbmc.executebuiltin('Dialog.Close(all,true)')
|
xbmc.executebuiltin('Dialog.Close(all,true)')
|
||||||
xbmc.executebuiltin('ActivateWindow(10025, "plugin://plugin.video.kod/?' + action + '")')
|
xbmc.executebuiltin('ActivateWindow(10025, "plugin://plugin.video.kod/?' + base64.b64encode(action) + '")')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -114,15 +119,42 @@ class Main(xbmcgui.WindowXMLDialog):
|
|||||||
# exit
|
# exit
|
||||||
if action.getId() in [xbmcgui.ACTION_PREVIOUS_MENU, xbmcgui.ACTION_NAV_BACK]:
|
if action.getId() in [xbmcgui.ACTION_PREVIOUS_MENU, xbmcgui.ACTION_NAV_BACK]:
|
||||||
xbmc.executebuiltin('Dialog.Close(all,true)')
|
xbmc.executebuiltin('Dialog.Close(all,true)')
|
||||||
|
if submenu: open_shortcut_menu()
|
||||||
|
|
||||||
if action.getId() == xbmcgui.ACTION_CONTEXT_MENU:
|
if action.getId() == xbmcgui.ACTION_CONTEXT_MENU:
|
||||||
config.open_settings()
|
config.open_settings()
|
||||||
|
|
||||||
|
if action == 3:
|
||||||
|
if submenu:
|
||||||
|
xbmc.executebuiltin('Dialog.Close(all,true)')
|
||||||
|
open_shortcut_menu()
|
||||||
|
elif self.getControl(32500).getSelectedItem().getProperty('channel') in ['news', 'channelselector', 'search', 'videolibrary']:
|
||||||
|
channel_name = self.getControl(32500).getSelectedItem().getProperty('channel')
|
||||||
|
if channel_name == 'channelselector':
|
||||||
|
import channelselector
|
||||||
|
xbmc.executebuiltin('Dialog.Close(all,true)')
|
||||||
|
open_shortcut_menu(channelselector.getchanneltypes())
|
||||||
|
else:
|
||||||
|
from core.item import Item
|
||||||
|
channel = __import__('specials.%s' % channel_name, fromlist=["specials.%s" % channel_name])
|
||||||
|
xbmc.executebuiltin('Dialog.Close(all,true)')
|
||||||
|
open_shortcut_menu(channel.mainlist(Item().fromjson(action)))
|
||||||
|
|
||||||
def open_shortcut_menu():
|
|
||||||
|
|
||||||
|
def open_shortcut_menu(newmenu=''):
|
||||||
|
global menu
|
||||||
|
global submenu
|
||||||
|
if newmenu:
|
||||||
|
menu = newmenu
|
||||||
|
submenu = True
|
||||||
|
else:
|
||||||
|
menu = channelselector.getmainlist()
|
||||||
|
submenu = False
|
||||||
XML = 'ShortCutMenu.xml'
|
XML = 'ShortCutMenu.xml'
|
||||||
if config.get_setting('icon_set') == 'dark':
|
if config.get_setting('icon_set') == 'dark':
|
||||||
XML = 'Dark' + XML
|
XML = 'Dark' + XML
|
||||||
|
xbmc.executebuiltin('Dialog.Close(all,true)')
|
||||||
main = Main(XML, config.get_runtime_path())
|
main = Main(XML, config.get_runtime_path())
|
||||||
main.doModal()
|
main.doModal()
|
||||||
del main
|
del main
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
</coordinates>
|
</coordinates>
|
||||||
<defaultcontrol always="true">32500</defaultcontrol>
|
<defaultcontrol always="true">32500</defaultcontrol>
|
||||||
<animation type="WindowOpen" reversible="false">
|
<animation type="WindowOpen" reversible="false">
|
||||||
<effect type="zoom" start="80" end="100" center="440,110" delay="160" tween="back" time="240" />
|
<effect type="slide" start="0,100" end="0,0" center="640,225" delay="160" tween="cubic" time="200" />
|
||||||
<effect type="fade" delay="160" end="100" time="240" />
|
<effect type="fade" delay="160" end="100" time="220" />
|
||||||
</animation>
|
</animation>
|
||||||
<animation type="WindowClose" reversible="false">
|
<animation type="WindowClose" reversible="false">
|
||||||
<effect type="zoom" start="100" end="80" center="440,110" easing="in" tween="back" time="240" />
|
<effect type="slide" start="0,0" end="0,-100" center="640,225" delay="160" tween="cubic" time="200" />
|
||||||
<effect type="fade" start="100" end="0" time="240" />
|
<effect type="fade" start="100" end="0" time="200" />
|
||||||
</animation>
|
</animation>
|
||||||
<controls>
|
<controls>
|
||||||
<control type="button">
|
<control type="button">
|
||||||
@@ -136,6 +136,15 @@
|
|||||||
<align>center</align>
|
<align>center</align>
|
||||||
<aligny>center</aligny>
|
<aligny>center</aligny>
|
||||||
</control>
|
</control>
|
||||||
|
<control type="image">
|
||||||
|
<left>100</left>
|
||||||
|
<top>5</top>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
<texture colordiffuse="FF232323">$INFO[ListItem.Property(sub)]</texture>
|
||||||
|
<aspectratio>keep</aspectratio>
|
||||||
|
<align>center</align>
|
||||||
|
</control>
|
||||||
</control>
|
</control>
|
||||||
</focusedlayout>
|
</focusedlayout>
|
||||||
</control>
|
</control>
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
</coordinates>
|
</coordinates>
|
||||||
<defaultcontrol always="true">32500</defaultcontrol>
|
<defaultcontrol always="true">32500</defaultcontrol>
|
||||||
<animation type="WindowOpen" reversible="false">
|
<animation type="WindowOpen" reversible="false">
|
||||||
<effect type="zoom" start="80" end="100" center="440,110" delay="160" tween="back" time="240" />
|
<effect type="slide" start="0,100" end="0,0" center="640,225" delay="160" tween="cubic" time="200" />
|
||||||
<effect type="fade" delay="160" end="100" time="240" />
|
<effect type="fade" delay="160" end="100" time="220" />
|
||||||
</animation>
|
</animation>
|
||||||
<animation type="WindowClose" reversible="false">
|
<animation type="WindowClose" reversible="false">
|
||||||
<effect type="zoom" start="100" end="80" center="440,110" easing="in" tween="back" time="240" />
|
<effect type="slide" start="0,0" end="0,-100" center="640,225" delay="160" tween="cubic" time="200" />
|
||||||
<effect type="fade" start="100" end="0" time="240" />
|
<effect type="fade" start="100" end="0" time="200" />
|
||||||
</animation>
|
</animation>
|
||||||
<controls>
|
<controls>
|
||||||
<control type="button">
|
<control type="button">
|
||||||
@@ -53,7 +53,6 @@
|
|||||||
<animation effect="slide" start="0,0" end="10,0" time="0" condition="true">Conditional</animation>
|
<animation effect="slide" start="0,0" end="10,0" time="0" condition="true">Conditional</animation>
|
||||||
<animation effect="slide" end="120,0" time="0" condition="!Control.IsVisible(5)">Conditional</animation>
|
<animation effect="slide" end="120,0" time="0" condition="!Control.IsVisible(5)">Conditional</animation>
|
||||||
<itemlayout height="220" width="220">
|
<itemlayout height="220" width="220">
|
||||||
<!-- <top>2</top> -->
|
|
||||||
<control type="image">
|
<control type="image">
|
||||||
<top>0</top>
|
<top>0</top>
|
||||||
<left>0</left>
|
<left>0</left>
|
||||||
@@ -71,7 +70,7 @@
|
|||||||
<control type="image">
|
<control type="image">
|
||||||
<width>220</width>
|
<width>220</width>
|
||||||
<height>220</height>
|
<height>220</height>
|
||||||
<texture>$INFO[ListItem.Property(thumb)]</texture>
|
<texture>$INFO[ListItem.Property(thumbnail)]</texture>
|
||||||
<aspectratio>keep</aspectratio>
|
<aspectratio>keep</aspectratio>
|
||||||
<align>center</align>
|
<align>center</align>
|
||||||
</control>
|
</control>
|
||||||
@@ -119,7 +118,7 @@
|
|||||||
<control type="image">
|
<control type="image">
|
||||||
<width>220</width>
|
<width>220</width>
|
||||||
<height>220</height>
|
<height>220</height>
|
||||||
<texture>$INFO[ListItem.Property(thumb)]</texture>
|
<texture>$INFO[ListItem.Property(thumbnail)]</texture>
|
||||||
<aspectratio>keep</aspectratio>
|
<aspectratio>keep</aspectratio>
|
||||||
<align>center</align>
|
<align>center</align>
|
||||||
</control>
|
</control>
|
||||||
@@ -134,6 +133,15 @@
|
|||||||
<align>center</align>
|
<align>center</align>
|
||||||
<aligny>center</aligny>
|
<aligny>center</aligny>
|
||||||
</control>
|
</control>
|
||||||
|
<control type="image">
|
||||||
|
<left>100</left>
|
||||||
|
<top>5</top>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
<texture>$INFO[ListItem.Property(sub)]</texture>
|
||||||
|
<aspectratio>keep</aspectratio>
|
||||||
|
<align>center</align>
|
||||||
|
</control>
|
||||||
</control>
|
</control>
|
||||||
</focusedlayout>
|
</focusedlayout>
|
||||||
</control>
|
</control>
|
||||||
|
|||||||
Reference in New Issue
Block a user