Add Button to a Python Plugin for XBMC on the Home Screen Menu?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Jimcando Offline
Junior Member
Posts: 40
Joined: Nov 2009
Reputation: 0
Question  Add Button to a Python Plugin for XBMC on the Home Screen Menu? Post: #1
I'm trying to get a button to the iPlayer plugin on my home screen. I have it all there, just have no idea how to actually link it to the iPlayer button. Can anybody help?
This is what I have currently (obviously, it's the onclick part that's wrong, I just guessed that bit Tongue)

Code:
<item id="12">
<label>iPlayer</label>
<onclick>ActivateWindow(plugin://iPlayer/)</onclick>
<icon>/home/pictures/backgrounds/iplayer.jpg</icon>
</item>
find quote
t2ffn Offline
Fan
Posts: 533
Joined: Oct 2009
Reputation: 0
Post: #2
PHP Code:
<!-- Custom Button -->
<
control type="button" id="3507">
    <
label>iPlayer TV</label>
    <
onclick>ActivateWindow(24,plugin://video/IPlayer/?tvradio=tv)</onclick>
    
<include>Home_MainMenuLabel</include>
</
control

Hitcher posted this in an Alaska thread, maybe it will help you find the right bit of code?

Its very similar to yours, I think it should be easy enough.
find quote
t2ffn Offline
Fan
Posts: 533
Joined: Oct 2009
Reputation: 0
Post: #3
Not tested, but this is my guess.

PHP Code:
<!-- Custom Button -->
<
control type="button" item id="12">
    <
label>iPlayer TV</label>
    <
onclick>ActivateWindow(24,plugin://video/IPlayer/?tvradio=tv)</onclick>
    
<icon>/home/pictures/backgrounds/iplayer.jpg</icon>
</
control

Which file are you editing to make the button? Home? I was looking in there, around line 425?

Let me know if you get it working, I might add it too
(This post was last modified: 2010-01-13 22:50 by t2ffn.)
find quote
Jimcando Offline
Junior Member
Posts: 40
Joined: Nov 2009
Reputation: 0
Post: #4
Code:
<onclick>ActivateWindow(24,plugin://video/IPlayer/?tvradio=tv)</onclick>
Thankyou, this works perfectly.

I am editing home.xml. But it's around line 850. This is where additions and changes to the main home menu are done.

It's very cool having an iPlayer button on the home screen now Big Grin

And if you're interested, I'm using this image as the background for it.
(This post was last modified: 2010-01-13 23:52 by Jimcando.)
find quote
t2ffn Offline
Fan
Posts: 533
Joined: Oct 2009
Reputation: 0
Post: #5
Glad it helped.

I've added it now too Big Grin is there any way to make the iPlayer text show as iPlayer, not IPLAYER?

Cheers
(This post was last modified: 2010-01-14 00:16 by t2ffn.)
find quote
Jimcando Offline
Junior Member
Posts: 40
Joined: Nov 2009
Reputation: 0
Post: #6
t2ffn Wrote:is there any way to make the iPlayer text show as iPlayer, not IPLAYER?

I'm not 100% sure how to achieve this. But you can change the font used for all the home menu items to use lowercase letters (as well as uppercase).

Around line 750 (for me) you can choose the font used.
Just search for
Code:
<font>font50caps_title</font>
There should be two instances of it, one for when the text is selected, and one for when it isn't.

You might have to open Font.xml to check or edit the current fonts.


I haven't really tried it out much, but it might give you something to play around with, or until someone else comes along with a better answer Big Grin
find quote
t2ffn Offline
Fan
Posts: 533
Joined: Oct 2009
Reputation: 0
Post: #7
Had a play with a few things but can't make it iPlayer, mixed upper lower case just yet, but think it needs it, just looks odd all caps.

Its a nice little feature to have it on the home screen though, good work.
find quote
t2ffn Offline
Fan
Posts: 533
Joined: Oct 2009
Reputation: 0
Post: #8
Could someone help describe how to change just the iplayer label from IPLAYER to iPlayer on the home screen please.

Tried a few font commands but none worked.
find quote
jonnyboom Offline
Junior Member
Posts: 14
Joined: Sep 2009
Reputation: 0
Post: #9
great stuff......how do i add the iplayer picture you posted?Big Grin

many thanks
find quote
t2ffn Offline
Fan
Posts: 533
Joined: Oct 2009
Reputation: 0
Post: #10
Save it to the backgrounds folder, then change the link in the above code to match your structure:

<icon>/home/pictures/backgrounds/iplayer.jpg</icon>
<icon>//720P/backgrounds/iplayer.jpg</icon>

Only you know the path.
find quote
Post Reply