[HOW-TO] Add a search button on XBMC home.
#1
What I need

A custom button on my XBMC home that made a search through my video library.
I wanna block the visual of library, so the search dialog will noy can be opened in the usual way and I need a simple button on my home that do it.

Do it works?

Yes.

Here a video.

Don't focus on the empty button, or the low res of my icons: I'm tryng to develop a custom skin, based on original alaska, for my parents low-res tv.
It search for a string anywhere in the XBMC video database; I didn't (yet) find a way to implement a global search, but can be add another button for music search.

How it works

It's a custom button with 2 onclick tags that open the video library and then the search dialog box.
Using SendClick(windowid,id) fuction http://wiki.xbmc.org/?title=List_of_Built_In_Functions that sends a click to a control in a given window (or active window if omitted), I add a second onclick tag on my button so it immediately open the search dialog box after videolibrary.
The search action ID in MyVideoNav.xml is 8 so I add SendClick(8).

This is my code:

Code:
<item id="7">
<description>Programs</description>
<label>$LOCALIZE[24001]</label>
<icon>special://skin/homeicons/programsicon.png</icon>
<onclick>ActivateWindow(Programs,Addons,return)</onclick>
<visible>!Skin.HasSetting(noprograms)</visible>
</item>

[b]    <item id="15">
    <description>Cerca</description>
    <label>Cerca</label>
    <icon>special://skin/homeicons/searchicon.png</icon>

        <onclick>ActivateWindow(VideoLibrary,movietitles)</onclick>
        <onclick>SendClick(8)</onclick>

    </item>[/b]

<item id="8">
<description>Settings</description>
<label>$LOCALIZE[5]</label>
<icon>special://skin/homeicons/settingsicon.png</icon>
<onclick>ActivateWindow(4)</onclick>
<visible>!Skin.HasSetting(nosettings)</visible>
</item>

Replacing the first onclick tag with ActivateWindow(musiclibrary) it will search through music library.

SendClick function permits to call action for specific windows, pointing a windws ID before the action ID; I tried with all the ID of VideoLibrary but it didn't work. The only way I found is open the VideoLibrary before.
Reply
#2
Smb3M Wrote:SendClick function permits to call action for specific windows, pointing a windws ID before the action ID; I tried with all the ID of VideoLibrary but it didn't work. The only way I found is open the VideoLibrary before.

i suppose specifying the window id is only usefull in dialogs,
to send a click to the window below.

nice howto btw. :-)
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
Nice touch. Adding this to Simplicity. Its a workaround...but it works.
Image
To learn more, click here.
Reply
#4
Thanx for the idea and the HOW TO ...
I've modified it to have a search button on each submenu, example:

Music: --> Search (Musiclibrary)

Video: --> Search (Videolibrary)

Movies: --> Search (VideoLibrary,MovieTitles)

TVShows: --> Search (VideoLibrary,TVShowTitles)
Reply
#5
gr8, thx for that !!!

addedd to [MOD] Customizable Confluence

Image

more details: http://forum.xbmc.org/showpost.php?p=771610&postcount=8
Reply

Logout Mark Read Team Forum Stats Members Help
[HOW-TO] Add a search button on XBMC home.0