Kodi Matrix alpha 1, addon settings do not show
#1
I am in the process of porting AML to Python 3. I am having a lot of trouble not with the Python language changes, but rather with the settings. As required for Matrix, I am using the new settings format in Matrix. I'm following the instructions in the Kodi wiki. AML has a decent amount of settings, however, I have created a small settings.xml for testing:

xml:

<?xml version="1.0" ?>
<settings version="1">
<section id="plugin.program.AML.dev">
<!--
Always use type="xxx" id="xxx" label="xxx" help="xxx" in <setting>
-->
<category id="main-operation" label="Main operation" help="Main operation help">
<setting type="enum" id="op_mode_raw" label="Mode" help="Test help">
<level>0</level>
<default>0</default>
<constraints>
<options>
<option label="Vanilla MAME">0</option>
<option label="Retroarch MAME 2003 Plus">1</option>
</options>
</constraints>
<control type="spinner" format="string" />
</setting>
</category>
</section>
</settings>

However, I am not able to open the settings. If I go to AML addon and open the context menu the addon settings don't show. I turned debug ON and look at kodi.log, this is the only thing I can find:

Code:
2020-08-05 20:05:12.243 T:41524   DEBUG <CAddonSettings[plugin.program.AML.dev]>: loading setting definitions
2020-08-05 20:05:12.245 T:41524    INFO <general>: Loading skin file: DialogContextMenu.xml, load type: KEEP_IN_MEMORY
2020-08-05 20:05:12.246 T:41524   DEBUG <general>: ------ Window Init (DialogContextMenu.xml) ------

No other warnings or errors related with this in the log.

1) If settings.xml has a syntax or logical error Kodi will issue a warning or error in the log, right?

2) A bit off-topic but relevant, if addons are allowed only one <section id="my.addon.id">, both the whole section tags and the id with the addon name are redundant. Kodi can create this when loading settings.xml automatically. Why not remove them completely for addons to reduce the complexity and indentation level of settings.xml?
Reply
#2
you're missing the <group> tag within the <category>
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Thanks @ronie. Can you please help me? How to use the <group> tag to replicate these old settings with the new format? Can the group tags be nested?

xml:

<category label="Main operation">
<setting label="Mode" type="enum" id="op_mode_raw" default="0" values="Vanilla MAME|Retroarch MAME 2003 Plus" />

<setting id="separator" type="lsep" label="Vanilla MAME" />
<setting label="Enable Software Lists" type="bool" id="enable_SL" default="true" />
<setting label="MAME executable path" type="file" id="mame_prog" />
<setting label="Software Lists hash path" type="folder" id="SL_hash_path" source="" />

<setting id="separator" type="lsep" label="Retroarch MAME 2003 Plus" />
<setting label="Retroarch executable path" type="file" id="retroarch_prog" />
<setting label="Libretro path" type="file" id="libretro_dir" />
<setting label="MAME XML path" type="file" id="xml_2003_path" />
</category>
Reply
#4
Ronie is the expert, but I believe you can remove the "lsep" lines and replace each by nesting the settings "under" the lsep into groups.  Then convert the settings to the new format.  AFAIK within a category, just use id="1", id="2"  etc for the groups.

Something like this:
xml:

<category label="Main operation">
<group id="1">
<setting label="Mode" type="enum" id="op_mode_raw" default="0" values="Vanilla MAME|Retroarch MAME 2003 Plus" />
</group>

<group id="2">
<setting label="Enable Software Lists" type="bool" id="enable_SL" default="true" />
<setting label="MAME executable path" type="file" id="mame_prog" />
<setting label="Software Lists hash path" type="folder" id="SL_hash_path" source="" />
</group>

<group id="3">
<setting label="Retroarch executable path" type="file" id="retroarch_prog" />
<setting label="Libretro path" type="file" id="libretro_dir" />
<setting label="MAME XML path" type="file" id="xml_2003_path" />
</group>
</category>

I've had mixed results using the settings convertor addon.

scott s.
.
Reply
#5
hah, far from an expert :-)
whatever i know has been accumulated by lots of trial & error and an attempt at reading the source code.

your example looks good to me though.

@Wintermute0110 please note that in the new settings format you need to use string id's instead of harcoded labels.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#6
Thanks @scott967 and @ronie. I managed to show the settings but labels are empty because my addons do not currently use strings.po files. But at least the addon settings show up again.

Somebody has changed the Add-on settings wiki page example in section 1 overnight, but it is not documented that settings MUST BE inside a <group> tag, otherwise they are ignored. The example in section "1 Description" won't work on Matrix alpha 1 as it is now.

I think that in Matrix I will keep using the traditional settings and the main reason is the inability to use textual label attributes, which is very inconvenient in my addons.

For the record, this is a list of issues I have found with the new settings (and please take these as hoped-to-be-useful feedback from an experienced Python addon developer, not as a personal criticism):

  1. <section id="my.addon.id"> is redundant and should be removed.

  2. <setting> must be enclosed by a <group> tag. With the old settings it was possible to have "root" settings and then create sections with separators. With the new settings this is not possible any more.

  3. In the docs it is not clear then meaning and/or purpose of the id attributes for <category> and <group> tags.

  4. In Matrix alpha 1, if <category> has no id attribute it is ignored and settings inside are not shown.

  5. In Matrix alpha 1, if <group> has no id attribute it is ignored and settings inside are not shown.

  6. The losing of text labels in label attributes is a clear feature regression. Basically, this is forcing to every addon that needs settings to use a strings.po file. For some addons, like AEL and AML, this is very inconvenient. I beg you to fix this regression, enabling label attribute to be a msgctxt or a textual label as in the old settings.
Reply
#7
(2020-08-06, 06:35)Wintermute0110 Wrote: Somebody has changed the Add-on settings wiki page example in section 1 overnight, but it is not documented that settings MUST BE inside a <group> tag, otherwise they are ignored. The example in section "1 Description" won't work on Matrix alpha 1 as it is now.

i'm a bit confused, that is the page for the old addon settings format... the old format doesn't require a group tag.
it works fine on my end if i test the example in section 1 on Matrix.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#8
(2020-08-06, 13:59)ronie Wrote:
(2020-08-06, 06:35)Wintermute0110 Wrote: Somebody has changed the Add-on settings wiki page example in section 1 overnight, but it is not documented that settings MUST BE inside a <group> tag, otherwise they are ignored. The example in section "1 Description" won't work on Matrix alpha 1 as it is now.

i'm a bit confused, that is the page for the old addon settings format... the old format doesn't require a group tag.
it works fine on my end if i test the example in section 1 on Matrix.

My mistake, I messed up. I have been thinking and maybe some of the statements I wrote in the list two posts ago are wrong. I could have been fooled by the fact that no labels with literal text are allowed with the new settings. In other words, maybe the setting was displayed but it was invisible with no labels to show which fooled me in the tests I did. Which leads to:

Quote:The losing of text labels in label attributes is a clear feature regression. Basically, this is forcing to every addon that needs settings to use a strings.po file. For some addons, like AEL and AML, this is very inconvenient. I beg you to fix this regression, enabling label attribute to be a msgctxt or a textual label as in the old settings.

OK, I will finish the conversion of the addon to Python 3 (it's taking some time because of changes in xbmcgui.DialogProgress(), AML has over 50 dialogs and many used line2 which has been removed) and then I will go back to the new settings stuff.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi Matrix alpha 1, addon settings do not show0