From 280342788ac6d6dfdd7538955ab68df0c66d6b80 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Thu, 8 Mar 2001 01:50:12 +0000 Subject: [PATCH] Skin uninstallation. Just do it, baby. r=danm, sr=brendan git-svn-id: svn://10.0.0.236/trunk@88882 18797224-902f-48f8-a5cc-f745e15eee43 --- .../resources/content/pref-themes.js | 18 ++++++++++++++++++ .../resources/content/pref-themes.xul | 4 +++- .../prefwindow/resources/content/preftree.xul | 6 +----- .../resources/locale/en-US/pref-themes.dtd | 3 +++ .../locale/en-US/prefutilities.properties | 3 ++- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/mozilla/xpfe/components/prefwindow/resources/content/pref-themes.js b/mozilla/xpfe/components/prefwindow/resources/content/pref-themes.js index f31530b644d..23de83f8b5e 100644 --- a/mozilla/xpfe/components/prefwindow/resources/content/pref-themes.js +++ b/mozilla/xpfe/components/prefwindow/resources/content/pref-themes.js @@ -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"); } } diff --git a/mozilla/xpfe/components/prefwindow/resources/content/pref-themes.xul b/mozilla/xpfe/components/prefwindow/resources/content/pref-themes.xul index 9b61be368c5..3ed3553222b 100644 --- a/mozilla/xpfe/components/prefwindow/resources/content/pref-themes.xul +++ b/mozilla/xpfe/components/prefwindow/resources/content/pref-themes.xul @@ -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"> @@ -89,6 +90,7 @@