Visor, XBMC skin by bobrooney_78
#31
i'm working on rearranging my skin to have easier access to the things i use more often.  rearranging the buttons was easy, but there are some elements of the skins that are not documented anywhere that i can find and that i can't figure out.

1) i can see that the <hyperlink>id</hyperlink> tag causes a button to load the xml file with <id>id</id>.  i can repeat this by modifying any of my buttons to point to an existing file.  however, if i create a new file with a new (unique) id, it doesn't work.  this implies that there is a registry of pages, but i can't find anything like that.

2) i would like to make more use of submenus, like dialogsubmenu.xml.  i am guessing that this is the key:

       <coordinates>
         <system>1</system>
         <posx>500</posx>
         <posy>80</posy>
       </coordinates>

posx and posy are obvious, but what is <system>1</system>?  is this some unique id?  or a note to xbmc as to what kind of window to load?

3) the reboot and shutdown buttons have no <hyperlink/> and no <execute/>.  how do they know what to do?

thanks to anyone willing to help!
Reply
#32
1) you can't make new (not already existing) files
2) you can only use one dialog sub menu
3) some id's of some buttons (reboot, power off...) are hardcoded in the .cpp-source of xbmc, so they only need the right id's and no hyperlink.

good luck!
Reply
#33
hmmm...that turns out to be much more restrictive than i thought.  i have changed the source code now to allow multiple submenus.  now i just have to figure out how to work cvs and post to appropriate forums :oops:

bool capplication::loaduserwindows()
{
tixmldocument xmldoc;

// load the "userwindows.xml" file
resolution restouse = invalid;
cstdstring strpath = g_skininfo.getskinpath("userwindows.xml", &restouse);

   if ( !xmldoc.loadfile(strpath.c_str()) )
   {
       clog::log(logerror, "unable to load:%s", strpath.c_str());
       return false;
   }

tixmlelement* prootelement = xmldoc.rootelement();
cstdstring strvalue=prootelement->value();
if (strvalue!=cstdstring("pages"))
{
clog::log(logerror, "file :%s doesnt contain <pages>", strpath.c_str());
return false;
}

// loop through the "page" elements
const tixmlnode *ppage = prootelement->firstchild("page");
while (ppage != null)
{
const tixmlnode *pfile = ppage->firstchild("filename");
if (pfile == null)
{
clog::log(logerror, "page section contains no filename element");
}
else
{
cstdstring strfilename = pfile->firstchild()->value();

// create the window
cguiwindow* pwindow;

const tixmlnode *ptype = ppage->firstchild("type");
if (ptype != null)
{
cstdstring strtype = ptype->firstchild()->value();
if (strtype == "dialog")
{
pwindow = new cguidialog(0);
}
else if (strtype == "submenu")
{
pwindow = new cguidialogsubmenu();
}
else
{
pwindow = new cguiwindow(0);
}
}
else
{
pwindow = new cguiwindow(0);
}

       clog::log(lognotice, "loading user page:%s", strfilename.c_str());

// try to load the page.  if the load fails, delete the pointer
if (pwindow->load(strfilename))
{
m_gwindowmanager.add(pwindow);
}
else
{
delete pwindow;
}
}
ppage = ppage->nextsibling();
}

return true;
}
Reply
#34
just a few notes.

first off, make sure you're not deleting an invalid pointer. initialize pwindow to null, and only delete if it's not null.

secondly, we need to think through exactly how this system would best operate. another "solution" to this problem would to change the current system so that it loads all *.xml files from the skin directory.

please discuss this (and other issues) in the thread in feature suggestions regarding post 1.1 skinning system features.

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

Logout Mark Read Team Forum Stats Members Help
Visor, XBMC skin by bobrooney_780