2011-03-24, 12:06
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:
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.
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.