Adding a new labelA
#1
i just added some small info to the video system (for a rating mod) but i have no idea how to send this info to the screen. right now is basically just

a).-a number between 0-5 (stars)
b).-a image (with the stars)


<control>
<info>videofile.rating</info>
</control>

but i have no idea how to declare those in code. i think they are an extra label for the skin , but i dont know where or how to declare them.


any help would be apreciated, thanks!
added manually by pike, check your gmail for verification mail anyhow
Reply
#2
please be more specific on exactly what you are trying to do.

where are you attempting to add this information?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
hmm. ok, ill try to be more specific. per example ive added a rating to the videos in their db and also ive added a function to get that info getrating() videodatabase.h and videodatabase.cpp, now i want to show that rating in the thumbnails or through a <info> tag.

you know the same way you can use:

<control>
<info>weather.temperature</info>
</control>



added manually by pike, check your gmail for verification mail anyhow
Reply
#4
you can't do that in the thumbnail panel without a whole bunch of extra code.

you can, however, display the information on the video info dialog. just add a label control with a unique id to the skin xml file, and add the code to fill this in to the code for that window (it'd just be a set_control_label())

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
thanks jmarshall but after trying a bit with labels, ive realized thats not what i want. i want to add data to the thumbnails and buttons, ive actually coded a bit of my own functions for this, but i just cant get the data to show on screen.

i went to the gui video cpp and h file and added data to the strname variable so it would show along with the name, it didnt worked. my second try was to add data to the description of the file, when the fileobject is created (this passes data to the label) no go.

could you tell me where the label for the button is created? i just want to show some extra data there, video rating, actor, etc. i know is hard due to the skins but there has to be a way.
added manually by pike, check your gmail for verification mail anyhow
Reply
#6
the label is created by cfileitem:Confusedetlabel() which actually drops down to cguilistitem:Confusedetlabel().

change that, and you change what is on screen.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
excellent! thanks, i finally have been able to add the data to the label, (it wasnt easy though) now i need to ask how can i call a function (i have previously made) to modify the value of the data (rating in this case) from a dialog?

something like this:

imdb
modify rating: (with a slider from 1 to 5)
added manually by pike, check your gmail for verification mail anyhow
Reply
#8
you will need to create a custom dialog window. look at the guidialog* files. those are all the current dialog windows.

then to call the custom dialog. for an example, look at cguiwindowmusicbase, onsearch(). it calls the keyboard dialog.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#9
hmm, im reading the code for those files but im not sure if i understood, all i want is a contextmenu with the option to modify the rating (with numbers) isnt there a way to modify a skin (xml) file for that? i need to create an entire new dialog for it?
added manually by pike, check your gmail for verification mail anyhow
Reply
#10
1. you could just call the numeric input dialog. there is the obvious difficulty though that it would allow a greater than 5 input to deal with.

2. you can just alter the onpopupmenu() command to add a button for "set rating" and then call the numeric input dialog.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#11
Quote:hmm, im reading the code for those files but im not sure if i understood, all i want is a contextmenu with the option to modify the rating (with numbers) isnt there a way to modify a skin (xml) file for that? i need to create an entire new dialog for it?

no, the context menu is fixed in the code. it's not skinnable. and yes, you are right. the context menu is the correct place for this. onpopupmenu controls the context menu. i would imagine there would be a new entry of "set rating".

choosing "set rating" would then bring up another dialog window for user input. as jmarshall suggests, the numeric dialog would be the easiest since its already created. you just need to deal with the fact that the user can enter 0-9.

however, using a slider, like you proposed earlier, would require a brand new dialog window.



Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#12
it worked! i just found a small problem inside my onpopupmenu i have some code like this:

problem is when the button is pressed (a) the popup screen dissapears then when i press (white) again i get the numericdialog.

Quote:
if (btnid == btn_setrating)
{
//increasetime(iitem);
cstdstring strheading="your movie rating?";
if (cguidialognumeric::showandgetnumber(strrating, strheading)){
itime = atoi(strrating.c_str());
modifytime(iitem, itime);
};
}

is there a way not to close the contextdialog when the numeric dialog appears?

thanks!
added manually by pike, check your gmail for verification mail anyhow
Reply
#13
are you saying that your dialog doesnt open when you select "set rating" from the context menu?

and whats with the reference to "time" and not "rating" ?

** edit ** try it this way...

onpopupmenu()
Quote: if (btn == btn_setrating)
{
setrating(iitem);
}

setrating()
Quote:void setrating(int iitem)
{
if (iitem < 0 || iitem >= m_vecitems.size()) return;

cstdstring strheading="your movie rating?";
cstdstring strrating;
if (!cguidialognumeric:Confusedhowandgetnumber(strrating, strheading)) return;

modifytime(iitem, atoi(strrating.c_str()));
}



Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#14
thanks i've tried but i still get the same problem, maybe is not possible to open two subwindows in xbmc so that may be it. jmarshall was right i need a new dialog. im working on it right now.

oops! about the modify time command, yeah i got the example on how to do the numeric dialog from the date and time settings thanks for pointing that out.
added manually by pike, check your gmail for verification mail anyhow
Reply
#15
its possible but the context menu will close after the new dialog opens because the contextmenu dialog is calling another dialog.
"edit title" in the video context menu does this. it calls the keyboard dialog window to get user input.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
Adding a new labelA0