Archive:Xbmcaddon module: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
m (Karellen moved page Xbmcaddon module to Archive:Xbmcaddon module without leaving a redirect: Outdated)
mNo edit summary
 
Line 1: Line 1:
{{mininav|[[Development]]|[[Add-on development]]|[[Python development]]}}
 


The documentation for the xbmcaddon module may be found here https://codedocs.xyz/AlwinEsch/kodi/group__python__xbmcaddon.html. The '''getSetting''' and '''setSetting''' commands may be used to store state information between calls, in addition to accessing configuration information. '''openSettings''' pops up the configuration dialog allowing the user to change the configuration of your plugin source. '''getLocalizedString''' retrieves translated strings, and '''getAddonInfo''' returns pertinent information about your pluginsource should you want to display this via some other means.
The documentation for the xbmcaddon module may be found here https://codedocs.xyz/AlwinEsch/kodi/group__python__xbmcaddon.html. The '''getSetting''' and '''setSetting''' commands may be used to store state information between calls, in addition to accessing configuration information. '''openSettings''' pops up the configuration dialog allowing the user to change the configuration of your plugin source. '''getLocalizedString''' retrieves translated strings, and '''getAddonInfo''' returns pertinent information about your pluginsource should you want to display this via some other means.
Line 15: Line 15:




== See also ==
'''Development:'''
* [[Add-on development]]
* [[Python development]]


[[Category:Add-on development]]
[[Category:Development-Archived]]
[[Category:Development]]

Latest revision as of 01:03, 22 July 2020


The documentation for the xbmcaddon module may be found here https://codedocs.xyz/AlwinEsch/kodi/group__python__xbmcaddon.html. The getSetting and setSetting commands may be used to store state information between calls, in addition to accessing configuration information. openSettings pops up the configuration dialog allowing the user to change the configuration of your plugin source. getLocalizedString retrieves translated strings, and getAddonInfo returns pertinent information about your pluginsource should you want to display this via some other means.

 import xbmcaddon
 __settings__ = xbmcaddon.Addon(id='<your addons ID>')
 __language__ = __settings__.getLocalizedString
 __language__(30204)              # this will return localized string from resources/language/<name_of_language>/strings.xml
 __settings__.getSetting( "foo" ) # this will return "foo" setting value 
 __settings__.setSetting( "foo" ) # this will set "foo" setting value
 __settings__.openSettings()      # this will open settings window

please note that <your addons ID> mentioned above must be the same as addon id="<your addons ID> in addons.xml