Finestra selezione server possibilità di usare la selezione con la skin utilizzata da Kodi
This commit is contained in:
@@ -1788,6 +1788,91 @@ def serverWindow(item, itemlist):
|
|||||||
from platformcode.launcher import run
|
from platformcode.launcher import run
|
||||||
run(action)
|
run(action)
|
||||||
|
|
||||||
|
class ServerSkinWindow(xbmcgui.WindowXMLDialog):
|
||||||
|
def start(self, item, itemlist):
|
||||||
|
self.item = item
|
||||||
|
self.itemlist = itemlist
|
||||||
|
self.selection = -1
|
||||||
|
self.actions = []
|
||||||
|
self.doModal()
|
||||||
|
return self.selection
|
||||||
|
|
||||||
|
def onInit(self):
|
||||||
|
try:
|
||||||
|
self.list = self.getControl(6)
|
||||||
|
self.exit = self.getControl(5)
|
||||||
|
self.first = self.getControl(8)
|
||||||
|
self.second = self.getControl(7)
|
||||||
|
self.first.setVisible(False)
|
||||||
|
self.second.setVisible(False)
|
||||||
|
self.exit.setNavigation(self.exit, self.exit, self.list, self.list)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
self.exit.setLabel(config.get_localized_string(60396))
|
||||||
|
|
||||||
|
for item in itemlist:
|
||||||
|
if item.server: break
|
||||||
|
if item.contentSeason and item.contentEpisodeNumber:
|
||||||
|
title = '{}x{:02d}. {}'.format(item.contentSeason, item.contentEpisodeNumber, item.contentTitle)
|
||||||
|
elif item.contentEpisodeNumber:
|
||||||
|
title = '{:02d}. {}'.format(item.contentEpisodeNumber, item.contentTitle)
|
||||||
|
else:
|
||||||
|
title = item.fulltitle
|
||||||
|
|
||||||
|
self.getControl(1).setLabel(title)
|
||||||
|
|
||||||
|
items = []
|
||||||
|
|
||||||
|
from core.support import typo
|
||||||
|
for videoitem in self.itemlist:
|
||||||
|
videoitem.thumbnail = config.get_online_server_thumb(videoitem.server)
|
||||||
|
quality = ' [' + videoitem.quality + ']' if videoitem.quality else ''
|
||||||
|
if videoitem.server:
|
||||||
|
color = scrapertools.find_single_match(videoitem.alive, r'(FF[^\]]+)')
|
||||||
|
color = typo(' •', 'bold color 0x{}'.format(color)) if color else ''
|
||||||
|
it = xbmcgui.ListItem('{}{}{}'.format(videoitem.serverName, quality, color))
|
||||||
|
logger.debug('{}{}{}'.format(videoitem.serverName, quality, color))
|
||||||
|
|
||||||
|
it.setLabel2(videoitem.ch_name)
|
||||||
|
it.setArt({'thumb': videoitem.thumbnail})
|
||||||
|
items.append(it)
|
||||||
|
self.list.reset()
|
||||||
|
self.list.addItems(items)
|
||||||
|
self.setFocus(self.list)
|
||||||
|
else:
|
||||||
|
self.actions.append(videoitem)
|
||||||
|
|
||||||
|
for n, action in enumerate(self.actions):
|
||||||
|
label = ''
|
||||||
|
if 'library' in action.action:
|
||||||
|
label = config.get_localized_string(30131)
|
||||||
|
elif 'download' in action.action:
|
||||||
|
label = config.get_localized_string(30153)
|
||||||
|
if n == 0:
|
||||||
|
self.first.setLabel(label)
|
||||||
|
self.exit.setNavigation(self.first, self.first, self.list, self.list)
|
||||||
|
self.first.setNavigation(self.exit, self.exit, self.list, self.list)
|
||||||
|
self.first.setVisible(True)
|
||||||
|
elif n == 1:
|
||||||
|
self.second.setLabel(label)
|
||||||
|
self.first.setNavigation(self.exit, self.second, self.list, self.list)
|
||||||
|
self.second.setNavigation(self.first, self.exit, self.list, self.list)
|
||||||
|
self.second.setVisible(True)
|
||||||
|
|
||||||
|
|
||||||
|
def onClick(self, control):
|
||||||
|
if control == 6:
|
||||||
|
self.selection = self.itemlist[self.list.getSelectedPosition()]
|
||||||
|
self.close()
|
||||||
|
if control == 5:
|
||||||
|
self.close()
|
||||||
|
elif control == 7:
|
||||||
|
from platformcode.launcher import run
|
||||||
|
run(self.actions[1])
|
||||||
|
elif control == 8:
|
||||||
|
from platformcode.launcher import run
|
||||||
|
run(self.actions[0])
|
||||||
|
|
||||||
|
|
||||||
if itemlist:
|
if itemlist:
|
||||||
@@ -1804,8 +1889,10 @@ def serverWindow(item, itemlist):
|
|||||||
xbmc.sleep(200)
|
xbmc.sleep(200)
|
||||||
if not db['controls'].get('reopen', False):
|
if not db['controls'].get('reopen', False):
|
||||||
return
|
return
|
||||||
|
if config.get_setting('window_type') == 0:
|
||||||
selection = ServerWindow('Servers.xml', config.get_runtime_path()).start(item, itemlist)
|
selection = ServerSkinWindow("DialogSelect.xml", config.get_runtime_path()).start(item, itemlist)
|
||||||
|
else:
|
||||||
|
selection = ServerWindow('Servers.xml', config.get_runtime_path()).start(item, itemlist)
|
||||||
|
|
||||||
if selection == -1:
|
if selection == -1:
|
||||||
if item.fakevideo:
|
if item.fakevideo:
|
||||||
|
|||||||
@@ -2605,12 +2605,12 @@ msgid "Links view"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgctxt "#60622"
|
msgctxt "#60622"
|
||||||
msgid "Normal window"
|
msgid "Pop-up window"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgctxt "#60623"
|
msgctxt "#60623"
|
||||||
msgid "Pop-up window"
|
msgid "Fullscreen window"
|
||||||
msgstr ""
|
msgstr "
|
||||||
|
|
||||||
msgctxt "#60624"
|
msgctxt "#60624"
|
||||||
msgid " Maximum number of links to display"
|
msgid " Maximum number of links to display"
|
||||||
|
|||||||
@@ -2604,13 +2604,13 @@ msgid "Links view"
|
|||||||
msgstr "Visualizzazione collegamenti"
|
msgstr "Visualizzazione collegamenti"
|
||||||
|
|
||||||
msgctxt "#60622"
|
msgctxt "#60622"
|
||||||
msgid "Normal window"
|
|
||||||
msgstr "Finestra normale"
|
|
||||||
|
|
||||||
msgctxt "#60623"
|
|
||||||
msgid "Pop-up window"
|
msgid "Pop-up window"
|
||||||
msgstr "Finestra pop-up"
|
msgstr "Finestra pop-up"
|
||||||
|
|
||||||
|
msgctxt "#60623"
|
||||||
|
msgid "Fullscreen window"
|
||||||
|
msgstr "Finestra a schermo intero"
|
||||||
|
|
||||||
msgctxt "#60624"
|
msgctxt "#60624"
|
||||||
msgid " Maximum number of links to display"
|
msgid " Maximum number of links to display"
|
||||||
msgstr " Numero massimo di link da visualizzare"
|
msgstr " Numero massimo di link da visualizzare"
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
<setting id="autoplay" type="bool" label="70562" default="false" visible="true"/>
|
<setting id="autoplay" type="bool" label="70562" default="false" visible="true"/>
|
||||||
<setting id="servers_favorites" visible="true" type="action" label="60551" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAic2VydmVyc19mYXZvcml0ZXMiLA0KICAgICJjaGFubmVsIjogInNldHRpbmciDQp9==)"/>
|
<setting id="servers_favorites" visible="true" type="action" label="60551" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAic2VydmVyc19mYXZvcml0ZXMiLA0KICAgICJjaGFubmVsIjogInNldHRpbmciDQp9==)"/>
|
||||||
<setting id="servers_blacklist" visible="true" type="action" label="60550" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAic2VydmVyc19ibGFja2xpc3QiLA0KICAgICJjaGFubmVsIjogInNldHRpbmciDQp9==)"/>
|
<setting id="servers_blacklist" visible="true" type="action" label="60550" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAic2VydmVyc19ibGFja2xpc3QiLA0KICAgICJjaGFubmVsIjogInNldHRpbmciDQp9==)"/>
|
||||||
|
<setting id="window_type" type="select" lvalues="60622|60623" label="60621" default="0"/>
|
||||||
<!-- <setting id="hide_servers" type="bool" label="70747" default="false" visible="eq(-1,true)" subsetting="true"/> -->
|
<!-- <setting id="hide_servers" type="bool" label="70747" default="false" visible="eq(-1,true)" subsetting="true"/> -->
|
||||||
<setting id="checklinks" type="bool" label="30020" default="false"/>
|
<setting id="checklinks" type="bool" label="30020" default="false"/>
|
||||||
<setting id="checklinks_number" type="slider" option="int" range="5,5,20" label="30021" default="5" visible="eq(-1,true)" subsetting="true"/>
|
<setting id="checklinks_number" type="slider" option="int" range="5,5,20" label="30021" default="5" visible="eq(-1,true)" subsetting="true"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user