How to create a "Busy Dialog"?
#1
Hi all,

i have a Panel Control with Items that have a "onclick" attribute. That works great, when clicking on them the action is executed. However, this action takes 5-10 seconds to complete.
Now my question: While the action is performed, can i "fire up" a Busy Dialog indicating that Kodi is busy? In my imagination it would be perfect if i just could set a Property like "isBusy" and clear it when the action is done, using a try-catch-finally block where finally ensures the Busy Dialog is unset again.
But currently i don't know how to spawn this "Spinner Wheel". I tried to look in the Wiki and searched the forum here.
At best someone has an code example, i'll get along with it, thank you! Wink
Reply
#2
In most cases the busy spinner is an include with a visibility condition. For loading PVR artwork online (this takes som time too) I use an include like:

Code:
    <include name="BusyPvrArtworkSpinner">
        <param name="left">155</param>
        <param name="top">91</param>
        <definition>
            <control type="group">
                <left>$PARAM[left]</left>
                <top>$PARAM[top]</top>
                <visible>!Player.HasVideo + !Pvr.IsPlayingRadio + String.IsEqual(Window(Home).Property(PVR.Artwork.Lookup),busy)</visible>
                <animation effect="fade" delay="500">VisibleChange</animation>
                <control type="image">
                    <width>80</width>
                    <height>80</height>
                    <aspectratio aligny="center">keep</aspectratio>
                    <texture colordiffuse="black">dialogs/extendedprogress/loading-back.png</texture>
                </control>
                <control type="image">
                    <width>80</width>
                    <height>80</height>
                    <aspectratio aligny="center">keep</aspectratio>
                    <texture>dialogs/extendedprogress/loading.png</texture>
                    <animation effect="rotate" center="auto" start="360" end="0" time="1500" loop="true" condition="true">Conditional</animation>
                </control>
            </control>
        </definition>
    </include>

As you see in the visiblity condition of the control group the visibility depends on String.IsEqual(Window(Home).Property(PVR.Artwork.Lookup),busy) which is set/unset by the PVR artwork addon. Other spinners like in Estuary using a visibility condition as include parameter. You can simply use it as follows by setting the property "Lookup" to "isBusy" and clear it later:

Code:
<include content="BusyListSpinner">
    <param name="visible">String.IsEqual(Window(Home).Property(Lookup),isBusy)</param>
</include>
Reply
#3
Using Estuary, this works great - thank you very much!

(Though this "Spinner" is exactly what i was looking for, its a "White Circle spinning": Do you happen to know what this "extended" Estuary "Blue Circle Spinner" that even half-dimmed the screen while spinning is called? i.e. when you start a Video. Is that also an include that i can use in this easy way?)
Reply
#4
This is a dialog window (DialogBusy.xml) controlled by several visible conditions and (in my opinion) controlled by core. You cannot use this window as easy like the includes. Just take a look inside of the DialogBusy.xml.
Reply
#5
Thanks, i stick with "BusyListSpinner" - it fits perfectly for me.
Though DialogBusy.xml looks interresting and one may just copy the animations for some own brew Wink

Thank You for your precise help!
Reply

Logout Mark Read Team Forum Stats Members Help
How to create a "Busy Dialog"?0