Skin uninstallation. Just do it, baby. r=danm, sr=brendan

This commit is contained in:
hyatt%netscape.com 2001-03-08 01:50:12 +00:00
parent 42df68efdd
commit 77c106212e
5 changed files with 27 additions and 7 deletions

View File

@ -40,6 +40,18 @@ function deselectSkin()
chromeRegistry.refreshSkins();
}
function uninstallSkin()
{
var tree = document.getElementById( "skinsTree" );
var selectedSkinItem = tree.selectedItems[0];
var skinName = selectedSkinItem.getAttribute( "name" );
var inUse = chromeRegistry.isSkinSelected(skinName, DEBUG_USE_PROFILE);
chromeRegistry.uninstallSkin( skinName, DEBUG_USE_PROFILE );
if (inUse)
chromeRegistry.refreshSkins();
tree.selectedIndex = 0;
}
// XXX DEBUG ONLY. DO NOT LOCALIZE
function installSkin()
{
@ -65,9 +77,15 @@ function themeSelect()
description.removeChild(description.firstChild);
description.appendChild(descText);
var applyButton = document.getElementById("applySkin");
var uninstallButton = document.getElementById("uninstallSkin");
var applyLabel = bundle.GetStringFromName("applyThemePrefix");
var uninstallLabel = bundle.GetStringFromName("uninstallThemePrefix");
applyLabel = applyLabel.replace(/%theme_name%/, themeName);
uninstallLabel = uninstallLabel.replace(/%theme_name%/, themeName);
applyButton.value = applyLabel;
uninstallButton.value = uninstallLabel;
var locType = selectedItem.getAttribute("loctype");
uninstallButton.disabled = (locType == "install");
}
}

View File

@ -59,7 +59,8 @@
displayName="rdf:http://www.mozilla.org/rdf/chrome#displayName"
name="rdf:http://www.mozilla.org/rdf/chrome#name"
description="rdf:http://www.mozilla.org/rdf/chrome#description"
image="rdf:http://www.mozilla.org/rdf/chrome#image">
image="rdf:http://www.mozilla.org/rdf/chrome#image"
loctype="rdf:http://www.mozilla.org/rdf/chrome#locType">
<treerow>
<treecell value="rdf:http://www.mozilla.org/rdf/chrome#displayName"/>
</treerow>
@ -89,6 +90,7 @@
</box>
<box orient="vertical" align="top">
<button id="applySkin" value="&selectSkin.label;" accesskey="&selectSkin.accesskey;" oncommand="applySkin();"/>
<button id="uninstallSkin" value="&uninstallSkin.label;" oncommand="uninstallSkin();"/>
</box>
</box>

View File

@ -39,11 +39,7 @@
<tree id="prefsTree"
onselect="if( hPrefWindow ) hPrefWindow.switchPage();">
<treecolgroup>
<treecol flex="1"/>
</treecolgroup>
<treehead name="tree">
<treerow>
<treecell class="treecell-header outset" url="__header" value="&categoryHeader;"/>

View File

@ -8,6 +8,9 @@
<!ENTITY selectSkin.label "Apply Theme">
<!ENTITY selectSkin.accesskey "a">
<!ENTITY uninstallSkin.label "Uninstall Theme">
<!ENTITY uninstallSkin.accesskey "u">
<!ENTITY general.label "General">
<!ENTITY preview.label "Preview Image">
<!ENTITY author.label "Author">

View File

@ -7,4 +7,5 @@ nofontsforlang=No fonts available for this language
# Themes preferences panel inserts the name of the selected
# theme into the %theme_name% segment
applyThemePrefix=Apply %theme_name%
applyThemePrefix=Apply %theme_name%
uninstallThemePrefix=Uninstall %theme_name%