v19 New settings.xml enable not working
#1
I'm converting a settings.xml to the new format.  The problem I'm having is that the dependency type="enable" is always enabled.  Here is file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<settings version="1">
    <section id="service.skin.widgets">
        <category id="General" label="32012">
            <group id="1">
                <setting label="32013" type="boolean" id="plot_enable">
                    <level>1</level>
                    <default>true</default>
                    <control type="toggle"/>
                </setting>
            </group>
        </category>
        <category id="Recommended (in progress)" label="32001">
            <group id="1">
                <setting label="32001" type="boolean" id="recommended_enable">
                    <level>1</level>
                    <default>true</default>
                    <control type="toggle"/>
                </setting>
            </group>
        </category>
        <category id="Random items" label="32002">
            <group id="1">
                <setting label="32002" type="boolean" id="randomitems_enable">
                    <level>1</level>
                    <default>true</default>
                    <control type="toggle"/>
                </setting>
                <setting label="32011" type="boolean" id="randomitems_unplayed" parent="randomitems_enable">
                    <level>1</level>
                    <default>true</default>
                    <control type="toggle"/>
                    <dependency type="enable" operator="is" setting="randomitems_enable">true</dependency>
                </setting>
                <setting label="32005" type="boolean" id="randomitems_seasonfolders" parent="randomitems_enable">
                    <level>1</level>
                    <default>true</default>
                    <control type="toggle"/>
                    <dependency type="enable" operator="is" setting="randomitems_enable">true</dependency>
                </setting>
                <setting label="32008" type="integer" id="randomitems_method" parent="randomitems_enable">
                    <level>1</level>
                    <default>0</default>
                    <constraints>
                        <options>
                            <option label="32006">0</option>
                            <option label="32007">1</option>
                        </options>
                    </constraints>
                    <control type="spinner" format="string"/>
                    <dependency type="enable" operator="is" setting="randomitems_enable">true</dependency>
                </setting>
                <setting label="32004" type="integer" id="randomitems_time" parent="randomitems_enable">
                    <level>1</level>
                    <default>10</default>
                    <constraints>
                        <minimum>5</minimum>
                        <step>5</step>
                        <maximum>60</maximum>
                    </constraints>
                    <control type="slider" format="integer"/>
                    <dependency type="enable" operator="is" setting="randomitems_time">0</dependency>
                </setting>
            </group>
        </category>
        <category id="Recent items" label="32009">
            <group id="1">
                <setting label="32009" type="boolean" id="recentitems_enable">
                    <level>1</level>
                    <default>true</default>
                    <control type="toggle"/>
                </setting>
                <setting label="32011" type="boolean" id="recentitems_unplayed" parent="recentitems_enable">
                    <level>1</level>
                    <default>true</default>
                    <control type="toggle"/>
                    <dependency type="enable" operator="is" setting="recentitems_enable">true</dependency>
                </setting>
                <setting label="32010" type="boolean" id="recentitems_homeupdate">
                    <level>1</level>
                    <default>false</default>
                    <control type="toggle"/>
                </setting>
            </group>
        </category>
    </section>
</settings>

As you can see, they are all enabled when a certain setting is true except one is an integer.
eg <dependency type="enable" operator="is" setting="recentitems_enable">true</dependency>

Am I doing something wrong?

I also notice that for the setting "randomitems_method" the default is integer 0 but when settings.xml gets written to addon_data it writes default="true"

<setting id="randomitems_method" default="true">0</setting>

scott s.
.
maintainer of skin  Aeon MQ5 mods for post-Gotham Kodi releases:
Matrix
Leia see: 304472
Reply
#2
i've looked into it, and i think the correct way to write a dependency must be:
<dependencies>
    <dependency type="enable" operator="is" setting="randomitems_enable">true</dependency>
</dependencies>
 
(2020-02-06, 03:45)scott967 Wrote: I also notice that for the setting "randomitems_method" the default is integer 0 but when settings.xml gets written to addon_data it writes default="true"
it means the setting has not been changed by the user.


btw, i noticed your setting randomitems_time depends on itself... that can never work i think?
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
Making <dependency> a child of <dependencies> was the trick.  Also thanks for finding that bug.  So my new settings is working great.

Thanks again

scott s.
.
maintainer of skin  Aeon MQ5 mods for post-Gotham Kodi releases:
Matrix
Leia see: 304472
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
New settings.xml enable not working00