XUL app and registering third-party themes

"Reidar Djupvik" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpinstall
Message-ID <[email protected]>
Hello,

I'm making a XUL app called the Home Button (found at 
http://home.no.net/trihand/mozilla/home/en/ ). In version 0.4 I added 
support for some of the themes at http://themes.mozdev.org/ , but I found 
out there were some problems with the theme support.

For all the themes that the user don't have, a blank line is added in the 
View > Apply Theme menu.

Secondly: My package is installed in the Chrome (Mozilla/chrome) folder, and 
the extra skin files are installed and registered in the Chrome folder too. 
This works well with Classic and Modern, but third-party themes are 
installed in the Profile folder.

How can I detect what themes are installed and only register them, or 
otherwise avoid the blank lines? Should I change my app to install in the 
Profile folder? (I have tried to experiment with it using a constant 
PROFILE_CHROME (the documentation doesn't mention it, seems to be outdated), 
but it didn't work.) Or should I give up and live at the mercy of the theme 
creators? Do something else?

If someone can help me, I will be very thankful, as this problem is stealing 
the time i ought to be sleeping.

Heres the install.js for 0.4:

initInstall("Home Button", "home", "0.4");
setPackageFolder(getFolder("Chrome"));
addFile("home.jar");
logComment("lastError "+getLastError());
registerChrome(CONTENT | DELAYED_CHROME, getFolder("Chrome", "home.jar"), 
"content/");
registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome", "home.jar"), 
"skin/classic/");
registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome", "home.jar"), 
"skin/modern/");
registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome", "home.jar"), 
"skin/ieskin/");
registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome", "home.jar"), 
"skin/eskimo/");
registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome", "home.jar"), 
"skin/littlemozilla/");
registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome", "home.jar"), 
"skin/wood/");
registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome", "home.jar"), 
"skin/lofi/");
registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome", "home.jar"), 
"skin/pinball/");
registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome", "home.jar"), 
"skin/skypilot/");
registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome", "home.jar"), 
"skin/lopburi/");
registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome", "home.jar"), 
"skin/kzilla/");
var err = getLastError();
if(err == SUCCESS) {
logComment("Installing Home Button");
performInstall();
}
else {
logComment("Error installing Home Button " + err);
cancelInstall(err);
}

If you see something else that is wrong with the install script, please tell 
me.

Reidar Djupvik

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.