[HOW-TO] Add a search button on XBMC home.

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Smb3M Offline
Junior Member
Posts: 3
Joined: Mar 2011
Reputation: 0
Post: #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.
(This post was last modified: 2011-03-24 14:07 by Smb3M.)
find quote
ronie Offline
Team-Kodi Member
Posts: 9,323
Joined: Jan 2009
Reputation: 161
Post: #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. :-)

Always read the Kodi online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #3
Nice touch. Adding this to Simplicity. Its a workaround...but it works.
find quote
butchabay Offline
Skilled Skinner
Posts: 3,826
Joined: Mar 2010
Reputation: 75
Location: Planet Crematoria
Post: #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)
find quote
castortray Offline
Fan
Posts: 496
Joined: May 2009
Reputation: 0
Post: #5
gr8, thx for that !!!

addedd to [MOD] Customizable Confluence

[Image: RHE2m.png]

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