Merge remote-tracking branch 'origin/master'

This commit is contained in:
marco
2020-05-15 19:47:11 +02:00
4 changed files with 220 additions and 322 deletions

View File

@@ -22,9 +22,11 @@ class KeyListener(xbmcgui.WindowXMLDialog):
filenname = "DialogKaiToast.xml"
return super(KeyListener, cls).__new__(cls, filenname, "")
def __init__(self):
self.key = None
def onInit(self):
try:
self.getControl(401).addLabel(config.get_localized_string(70698))
@@ -33,6 +35,7 @@ class KeyListener(xbmcgui.WindowXMLDialog):
self.getControl(401).setLabel(config.get_localized_string(70698))
self.getControl(402).setLabel(config.get_localized_string(70699) % self.TIMEOUT)
def onAction(self, action):
code = action.getButtonCode()
if code == 0:
@@ -41,6 +44,7 @@ class KeyListener(xbmcgui.WindowXMLDialog):
self.key = str(code)
self.close()
@staticmethod
def record_key():
dialog = KeyListener()
@@ -70,6 +74,7 @@ def set_key():
return
def delete_key():
from core import filetools
from platformcode import platformtools
@@ -82,13 +87,13 @@ def delete_key():
config.set_setting("shortcut_key", '')
class Main(xbmcgui.WindowXMLDialog):
def __init__(self, *args, **kwargs):
self.items = []
def onInit(self):
#### Compatibilidad con Kodi 18 ####
#### Compatibility with Kodi 18 ####
if config.get_platform(True)['num_version'] < 18:
self.setCoordinateResolution(2)
@@ -98,7 +103,7 @@ class Main(xbmcgui.WindowXMLDialog):
if not submenu and menuentry.channel in ['news', 'channelselector', 'search', 'videolibrary']:
item.setProperty('sub', 'Controls/spinUp-Focus.png')
if menuentry.title != 'Redirect':
for key, value in json.loads(menuentry.tojson()).items():
for key , value in json.loads(menuentry.tojson()).items():
item.setProperty(key, str(value))
item.setProperty('run', menuentry.tojson())
self.items.append(item)
@@ -106,6 +111,7 @@ class Main(xbmcgui.WindowXMLDialog):
self.getControl(32500).addItems(self.items)
self.setFocusId(32500)
def onClick(self, control_id):
if control_id == 32500:
action = self.getControl(32500).getSelectedItem().getProperty('run')
@@ -118,7 +124,7 @@ class Main(xbmcgui.WindowXMLDialog):
# exit
if action.getId() in [xbmcgui.ACTION_PREVIOUS_MENU, xbmcgui.ACTION_NAV_BACK]:
self.close()
if submenu: open_shortcut_menu()
if submenu: open_shortcut_menu(self=True)
if action.getId() == xbmcgui.ACTION_CONTEXT_MENU:
config.open_settings()
@@ -130,23 +136,22 @@ class Main(xbmcgui.WindowXMLDialog):
self.setFocusId(32500)
elif submenu:
self.close()
open_shortcut_menu()
open_shortcut_menu(self=True)
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
self.close()
open_shortcut_menu(channelselector.getchanneltypes(), channel_name)
open_shortcut_menu(channelselector.getchanneltypes(), channel_name, self=True)
else:
from core.item import Item
channel = __import__('specials.%s' % channel_name, fromlist=["specials.%s" % channel_name])
self.close()
open_shortcut_menu(channel.mainlist(Item()), channel_name)
open_shortcut_menu(channel.mainlist(Item()), channel_name, self=True)
def open_shortcut_menu(newmenu='', channel=''):
xbmc.executebuiltin('Dialog.Close(all,true)')
def open_shortcut_menu(newmenu='', channel='', self=False):
if not self: xbmc.executebuiltin('Dialog.Close(all,true)')
global menu
global submenu
global prevchannel

View File

@@ -2,172 +2,113 @@
<window>
<depth>0.52</depth>
<coordinates>
<left>200</left>
<top>250</top>
<left>0</left>
<top>0</top>
</coordinates>
<defaultcontrol always="true">32500</defaultcontrol>
<animation type="WindowOpen" reversible="false">
<effect type="fade" delay="160" end="100" time="220" />
</animation>
<animation type="WindowClose" reversible="false">
<effect type="fade" delay="160" start="100" end="0" time="200" />
</animation>
<controls>
<control type="button">
<left>-200</left>
<top>-250</top>
<width>1280</width>
<height>720</height>
<texturefocus colordiffuse="88FFFFFF">Shortcut/white.png</texturefocus>
<texturenofocus colordiffuse="88FFFFFF">Shortcut/white.png</texturenofocus>
<!-- CLOSE BUTTON / BACKGROUND -->
<control type="button">
<left>0</left>
<top>0</top>
<width>100%</width>
<height>100%</height>
<texturefocus colordiffuse="80DCDCDC">Shortcut/white.png</texturefocus>
<texturenofocus colordiffuse="80DCDCDC">Shortcut/white.png</texturenofocus>
<animation effect="fade" time="200">WindowOpen</animation>
<animation effect="fade" time="200">WindowClose</animation>
<onclick>Action(close)</onclick>
</control>
<!-- GROUP CONTROLS -->
<control type="group">
<left>100</left>
<top>250</top>
<animation type="WindowOpen" reversible="false">
<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="220" />
<effect type="slide" start="0,100" end="0,0" delay="160" time="160" />
<effect type="fade" delay="160" end="100" time="100" />
</animation>
<animation type="WindowClose" reversible="false">
<effect type="slide" start="0,0" end="0,-100" center="640,225" delay="160" tween="cubic" time="200" />
<effect type="fade" delay="160" start="100" end="0" time="200" />
<effect type="slide" start="0,0" end="0,100" delay="160" time="160" />
<effect type="fade" delay="160" start="100" end="0" time="100" />
</animation>
<control type="image">
<!-- SCROLLBAR -->
<control type="scrollbar" id="61">
<visible allowhiddenfocus="true">Control.HasFocus(61)</visible>
<animation effect="slide" start="0,0" end="0,-9" time="100">Unfocus</animation>
<animation effect="slide" start="0,-9" end="0,0" time="100">Focus</animation>
<left>0</left>
<top>0</top>
<width>880</width>
<top>219</top>
<width>1100</width>
<height>10</height>
<texturesliderbackground colordiffuse="FFDCDCDC">Shortcut/white.png</texturesliderbackground>
<texturesliderbar colordiffuse="FF1f1f1f">Shortcut/white.png</texturesliderbar>
<texturesliderbarfocus colordiffuse="FF0082C2">Shortcut/white.png</texturesliderbarfocus>
<showonepage>false</showonepage>
<orientation>horizontal</orientation>
<ondown>32500</ondown>
</control>
<!-- BACKGROUND -->
<control type="image">
<width>1100</width>
<height>218</height>
<texture colordiffuse="FFDCDCDC">Shortcut/white.png</texture>
</control>
<control type="list" id="32500">
<left>-130</left>
<top>-1</top>
<width>1100</width>
<height>220</height>
<texture border="2" colordiffuse="FFEEEEEE">Shortcut/white.png</texture>
<onup>32501</onup>
<ondown>61</ondown>
<orientation>horizontal</orientation>
<scrolltime>200</scrolltime>
<pagecontrol>61</pagecontrol>
<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>
<itemlayout height="220" width="220">
<control type="image">
<width>220</width>
<height>220</height>
<texture>$INFO[ListItem.Property(thumbnail)]</texture>
<aspectratio>keep</aspectratio>
<align>center</align>
</control>
</itemlayout>
<focusedlayout height="220" width="220">
<control type="image">
<top>1</top>
<width>220</width>
<height>218</height>
<texture colordiffuse="FF0082C2">Shortcut/white.png</texture>
</control>
<control type="textbox">
<left>0</left>
<top>160</top>
<width>220</width>
<height>74</height>
<font>font12</font>
<textcolor>FFFFFFFF</textcolor>
<label>$INFO[ListItem.Label]</label>
<align>center</align>
<aligny>center</aligny>
</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 type="image">
<width>220</width>
<height>220</height>
<texture>$INFO[ListItem.Property(thumbnail)]</texture>
<aspectratio>keep</aspectratio>
<align>center</align>
</control>
</focusedlayout>
</control>
<control type="group">
<control type="image">
<left>-21</left>
<top>0</top>
<width>1011</width>
<height>220</height>
<texture>Shortcut/dialogbutton-nofo.png</texture>
</control>
<control type="list" id="32500">
<left>-130</left>
<top>0</top>
<width>880</width>
<height>220</height>
<onup>32501</onup>
<ondown>61</ondown>
<orientation>horizontal</orientation>
<scrolltime>200</scrolltime>
<pagecontrol>61</pagecontrol>
<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>
<itemlayout height="220" width="220">
<control type="image">
<top>0</top>
<left>0</left>
<width>220</width>
<height>220</height>
<texture>Shortcut/button-nofo.png</texture>
</control>
<control type="image">
<left>30</left>
<top>149</top>
<width>306</width>
<height>75</height>
<texture colordiffuse="60FFFFFF">Shortcut/black.png</texture>
</control>
<control type="image">
<width>220</width>
<height>220</height>
<texture>$INFO[ListItem.Property(thumbnail)]</texture>
<aspectratio>keep</aspectratio>
<align>center</align>
</control>
<control type="image">
<left>329</left>
<top>24</top>
<width>50</width>
<height>50</height>
<aspectratio>keep</aspectratio>
<texture>$INFO[ListItem.Overlay]</texture>
</control>
</itemlayout>
<focusedlayout height="220" width="220">
<control type="group">
<depth>0.10</depth>
<control type="image">
<width>220</width>
<height>220</height>
<texture>Shortcut/button-nofo.png</texture>
<animation effect="fade" start="0" end="100" time="0">Unfocus</animation>
<animation effect="fade" start="100" end="0" time="0">Focus</animation>
</control>
<control type="image">
<top>1</top>
<width>220</width>
<height>218</height>
<texture colordiffuse="FF0082C2">Shortcut/button-fo.png</texture>
<animation effect="fade" start="100" end="0" time="0">Unfocus</animation>
</control>
<control type="image">
<left>5</left>
<top>24</top>
<width>50</width>
<height>50</height>
<aspectratio>keep</aspectratio>
<texture>$INFO[ListItem.Overlay]</texture>
</control>
<control type="image">
<left>23</left>
<top>149</top>
<width>298</width>
<height>75</height>
<texture colordiffuse="60FFFFFF">Shortcut/black.png</texture>
</control>
<control type="image">
<width>220</width>
<height>220</height>
<texture>$INFO[ListItem.Property(thumbnail)]</texture>
<aspectratio>keep</aspectratio>
<align>center</align>
</control>
<control type="textbox">
<left>0</left>
<top>160</top>
<width>220</width>
<height>74</height>
<font>font12</font>
<textcolor>FF232323</textcolor>
<label>$INFO[ListItem.Label]</label>
<align>center</align>
<aligny>center</aligny>
</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>
</focusedlayout>
</control>
<control type="scrollbar" id="61">
<left>-120</left>
<top>220</top>
<width>880</width>
<height>10</height>
<texturesliderbackground colordiffuse="FFEEEEEE">Shortcut/white.png</texturesliderbackground>
<texturesliderbar colordiffuse="FFCCCCCCS">Shortcut/white.png</texturesliderbar>
<texturesliderbarfocus colordiffuse="FF0082C2">Shortcut/white.png</texturesliderbarfocus>
<textureslidernib>-</textureslidernib>
<textureslidernibfocus>-</textureslidernibfocus>
<showonepage>false</showonepage>
<orientation>horizontal</orientation>
<ondown>32500</ondown>
<!-- <onup>32500</onup> -->
<animation effect="slide" end="120,0" time="0" condition="!Control.IsVisible(5)">Conditional</animation>
</control>
</control>
</control>
</control> <!-- GROUP CONTROLS END -->
</controls>
</window>

View File

@@ -2,172 +2,113 @@
<window>
<depth>0.52</depth>
<coordinates>
<left>200</left>
<top>250</top>
<left>0</left>
<top>0</top>
</coordinates>
<defaultcontrol always="true">32500</defaultcontrol>
<animation type="WindowOpen" reversible="false">
<effect type="fade" delay="160" end="100" time="220" />
</animation>
<animation type="WindowClose" reversible="false">
<effect type="fade" delay="160" start="100" end="0" time="200" />
</animation>
<controls>
<control type="button">
<left>-200</left>
<top>-250</top>
<width>1280</width>
<height>720</height>
<texturefocus colordiffuse="88232323">Shortcut/white.png</texturefocus>
<texturenofocus colordiffuse="88232323">Shortcut/white.png</texturenofocus>
<!-- CLOSE BUTTON / BACKGROUND -->
<control type="button">
<left>0</left>
<top>0</top>
<width>100%</width>
<height>100%</height>
<texturefocus colordiffuse="80232323">Shortcut/white.png</texturefocus>
<texturenofocus colordiffuse="80232323">Shortcut/white.png</texturenofocus>
<animation effect="fade" time="200">WindowOpen</animation>
<animation effect="fade" time="200">WindowClose</animation>
<onclick>Action(close)</onclick>
</control>
<!-- GROUP CONTROLS -->
<control type="group">
<left>100</left>
<top>250</top>
<animation type="WindowOpen" reversible="false">
<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="220" />
<effect type="slide" start="0,100" end="0,0" delay="160" time="160" />
<effect type="fade" delay="160" end="100" time="100" />
</animation>
<animation type="WindowClose" reversible="false">
<effect type="slide" start="0,0" end="0,-100" center="640,225" delay="160" tween="cubic" time="200" />
<effect type="fade" delay="160" start="100" end="0" time="200" />
<effect type="slide" start="0,0" end="0,100" delay="160" time="160" />
<effect type="fade" delay="160" start="100" end="0" time="100" />
</animation>
<control type="image">
<!-- SCROLLBAR -->
<control type="scrollbar" id="61">
<visible allowhiddenfocus="true">Control.HasFocus(61)</visible>
<animation effect="slide" start="0,0" end="0,-9" time="100">Unfocus</animation>
<animation effect="slide" start="0,-9" end="0,0" time="100">Focus</animation>
<left>0</left>
<top>0</top>
<width>880</width>
<top>219</top>
<width>1100</width>
<height>10</height>
<texturesliderbackground colordiffuse="FF232323">Shortcut/white.png</texturesliderbackground>
<texturesliderbar colordiffuse="FF1f1f1f">Shortcut/white.png</texturesliderbar>
<texturesliderbarfocus colordiffuse="FF0082C2">Shortcut/white.png</texturesliderbarfocus>
<showonepage>false</showonepage>
<orientation>horizontal</orientation>
<ondown>32500</ondown>
</control>
<!-- BACKGROUND -->
<control type="image">
<width>1100</width>
<height>218</height>
<texture colordiffuse="FF232323">Shortcut/white.png</texture>
</control>
<control type="list" id="32500">
<left>-130</left>
<top>-1</top>
<width>1100</width>
<height>220</height>
<texture border="2" colordiffuse="FF232323">Shortcut/white.png</texture>
<onup>32501</onup>
<ondown>61</ondown>
<orientation>horizontal</orientation>
<scrolltime>200</scrolltime>
<pagecontrol>61</pagecontrol>
<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>
<itemlayout height="220" width="220">
<control type="image">
<width>220</width>
<height>220</height>
<texture>$INFO[ListItem.Property(thumbnail)]</texture>
<aspectratio>keep</aspectratio>
<align>center</align>
</control>
</itemlayout>
<focusedlayout height="220" width="220">
<control type="image">
<top>1</top>
<width>220</width>
<height>218</height>
<texture colordiffuse="FF0082C2">Shortcut/white.png</texture>
</control>
<control type="textbox">
<left>0</left>
<top>160</top>
<width>220</width>
<height>74</height>
<font>font12</font>
<textcolor>FFFFFFFF</textcolor>
<label>$INFO[ListItem.Label]</label>
<align>center</align>
<aligny>center</aligny>
</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 type="image">
<width>220</width>
<height>220</height>
<texture>$INFO[ListItem.Property(thumbnail)]</texture>
<aspectratio>keep</aspectratio>
<align>center</align>
</control>
</focusedlayout>
</control>
<control type="group">
<control type="image">
<left>-21</left>
<top>0</top>
<width>1011</width>
<height>220</height>
<texture>Shortcut/dialogbutton-nofo.png</texture>
</control>
<control type="list" id="32500">
<left>-130</left>
<top>0</top>
<width>880</width>
<height>220</height>
<onup>32501</onup>
<ondown>61</ondown>
<orientation>horizontal</orientation>
<scrolltime>200</scrolltime>
<pagecontrol>61</pagecontrol>
<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>
<itemlayout height="220" width="220">
<control type="image">
<top>0</top>
<left>0</left>
<width>220</width>
<height>220</height>
<texture>Shortcut/button-nofo.png</texture>
</control>
<control type="image">
<left>30</left>
<top>149</top>
<width>306</width>
<height>75</height>
<texture colordiffuse="60FFFFFF">Shortcut/black.png</texture>
</control>
<control type="image">
<width>220</width>
<height>220</height>
<texture>$INFO[ListItem.Property(thumbnail)]</texture>
<aspectratio>keep</aspectratio>
<align>center</align>
</control>
<control type="image">
<left>329</left>
<top>24</top>
<width>50</width>
<height>50</height>
<aspectratio>keep</aspectratio>
<texture>$INFO[ListItem.Overlay]</texture>
</control>
</itemlayout>
<focusedlayout height="220" width="220">
<control type="group">
<depth>0.10</depth>
<control type="image">
<width>220</width>
<height>220</height>
<texture>Shortcut/button-nofo.png</texture>
<animation effect="fade" start="0" end="100" time="0">Unfocus</animation>
<animation effect="fade" start="100" end="0" time="0">Focus</animation>
</control>
<control type="image">
<top>1</top>
<width>220</width>
<height>218</height>
<texture colordiffuse="FF0082C2">Shortcut/button-fo.png</texture>
<animation effect="fade" start="100" end="0" time="0">Unfocus</animation>
</control>
<control type="image">
<left>5</left>
<top>24</top>
<width>50</width>
<height>50</height>
<aspectratio>keep</aspectratio>
<texture>$INFO[ListItem.Overlay]</texture>
</control>
<control type="image">
<left>23</left>
<top>149</top>
<width>298</width>
<height>75</height>
<texture colordiffuse="60FFFFFF">Shortcut/black.png</texture>
</control>
<control type="image">
<width>220</width>
<height>220</height>
<texture>$INFO[ListItem.Property(thumbnail)]</texture>
<aspectratio>keep</aspectratio>
<align>center</align>
</control>
<control type="textbox">
<left>0</left>
<top>160</top>
<width>220</width>
<height>74</height>
<font>font12</font>
<textcolor>FFFFFFFF</textcolor>
<label>$INFO[ListItem.Label]</label>
<align>center</align>
<aligny>center</aligny>
</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>
</focusedlayout>
</control>
<control type="scrollbar" id="61">
<left>-120</left>
<top>220</top>
<width>880</width>
<height>10</height>
<texturesliderbackground colordiffuse="FF232323">Shortcut/white.png</texturesliderbackground>
<texturesliderbar colordiffuse="FF1f1f1f">Shortcut/white.png</texturesliderbar>
<texturesliderbarfocus colordiffuse="FF0082C2">Shortcut/white.png</texturesliderbarfocus>
<textureslidernib>-</textureslidernib>
<textureslidernibfocus>-</textureslidernibfocus>
<showonepage>false</showonepage>
<orientation>horizontal</orientation>
<ondown>32500</ondown>
<!-- <onup>32500</onup> -->
<animation effect="slide" end="120,0" time="0" condition="!Control.IsVisible(5)">Conditional</animation>
</control>
</control>
</control>
</control> <!-- GROUP CONTROLS END -->
</controls>
</window>

View File

@@ -37,9 +37,20 @@ def download(item=None):
def extract():
import zipfile
from platformcode.updater import fixZipGetHash, fOpen
support.log('Estraggo Elementum in:', elementum_path)
with zipfile.ZipFile(filename, 'r') as zip_ref:
zip_ref.extractall(xbmc.translatePath(addon_path))
try:
hash = fixZipGetHash(filename)
support.log(hash)
with zipfile.ZipFile(fOpen(filename, 'rb')) as zip_ref:
zip_ref.extractall(xbmc.translatePath(addon_path))
except Exception as e:
support.log('Non sono riuscito ad estrarre il file zip')
support.logger.error(e)
import traceback
support.logger.error(traceback.print_exc())
def setting():