2018-12-28, 18:16
Good day everyone,
Happy holidays to you all! I am trying to display the regional settings through scripting so that when I click on it, the regional changes. So far I have this code, it was barrowed from script that brings up the language settings. Only issue is that when I click on region, it does not change in Kodi settings. Can someone please assist? :
Happy holidays to you all! I am trying to display the regional settings through scripting so that when I click on it, the regional changes. So far I have this code, it was barrowed from script that brings up the language settings. Only issue is that when I click on region, it does not change in Kodi settings. Can someone please assist? :
python:import time, xbmc
import xbmcaddon
import xbmcgui
import xbmcplugin
ADDON_ID = 'script.region'
ADDON = xbmcaddon.Addon()
T = xbmc.getRegion()
wel = T(30703)
sel_lang = T(30704)
full_language_array = [ 'Australia(12h)','Australia(24h)','Canada','Central Europe','India(12h)','India(24h)','UK(12h)','UK(24)','USA(12h)','USA(24h)']
def doLanguageListing():
window = KodiRegionalListing('region-set.xml',ADDON.getAddonInfo('path'),'Default','720p')
window.doModal()
del window
class KodiRegionalListing(xbmcgui.WindowXMLDialog):
def onInit(self):
self.setProperty("WEL",wel)
self.setProperty("SEL_LANG",sel_lang)
self.ctrl = self.getControl(101)
item = []
for lang in full_language_array:
list_lang = xbmcgui.ListItem(label=lang)
item.append(list_lang)
self.ctrl.reset()
self.ctrl.addItems(item)
self.setFocusId(101)
def onClick(self, controlID):
self.setProperty("loader","2")
xbmc.sleep(1000)
select_lang = self.ctrl.getSelectedItem().getLabel()
xbmc.executebuiltin('getRegion(%s)' % select_lang)
xbmc.executebuiltin('Skin.SetString(Regionset,true)')
self.close()
def onAction(self, action):
pass