From fd61d7a6899bd6b73ac7555a2daf06edd8794376 Mon Sep 17 00:00:00 2001 From: "mats.palmgren%bredband.net" Date: Fri, 26 Jan 2007 20:51:12 +0000 Subject: [PATCH] Add a "Copy" context menu item that copies pref name and value in about:config list. b=239940 (part 1) r+sr=neil@httl.net --- toolkit/components/viewconfig/content/config.js | 9 +++++++++ toolkit/components/viewconfig/content/config.xul | 1 + toolkit/locales/en-US/chrome/global/config.dtd | 7 +++++-- xpfe/global/resources/content/config.js | 9 +++++++++ xpfe/global/resources/content/config.xul | 1 + xpfe/global/resources/locale/en-US/config.dtd | 7 +++++-- 6 files changed, 30 insertions(+), 4 deletions(-) diff --git a/toolkit/components/viewconfig/content/config.js b/toolkit/components/viewconfig/content/config.js index 8a7ef3d8217..f1286bdfb31 100644 --- a/toolkit/components/viewconfig/content/config.js +++ b/toolkit/components/viewconfig/content/config.js @@ -477,6 +477,9 @@ function updateContextMenu() copyDisabled = false; } + var copyPref = document.getElementById("copyPref"); + copyPref.setAttribute("disabled", copyDisabled); + var copyName = document.getElementById("copyName"); copyName.setAttribute("disabled", copyDisabled); @@ -502,6 +505,12 @@ function updateContextMenu() document.getElementById("unlockSelected").hidden = !isLocked; } +function copyPref() +{ + var pref = gPrefView[view.selection.currentIndex]; + gClipboardHelper.copyString(pref.prefCol + ';' + pref.valueCol); +} + function copyName() { gClipboardHelper.copyString(gPrefView[view.selection.currentIndex].prefCol); diff --git a/toolkit/components/viewconfig/content/config.xul b/toolkit/components/viewconfig/content/config.xul index e8af53bcffe..d5ad00285c6 100644 --- a/toolkit/components/viewconfig/content/config.xul +++ b/toolkit/components/viewconfig/content/config.xul @@ -56,6 +56,7 @@ + diff --git a/toolkit/locales/en-US/chrome/global/config.dtd b/toolkit/locales/en-US/chrome/global/config.dtd index e4d0b6e83aa..cc062ab749b 100644 --- a/toolkit/locales/en-US/chrome/global/config.dtd +++ b/toolkit/locales/en-US/chrome/global/config.dtd @@ -57,8 +57,11 @@ + + + - + @@ -68,7 +71,7 @@ - + diff --git a/xpfe/global/resources/content/config.js b/xpfe/global/resources/content/config.js index 60b053d2f3a..9052b66440c 100644 --- a/xpfe/global/resources/content/config.js +++ b/xpfe/global/resources/content/config.js @@ -478,6 +478,9 @@ function updateContextMenu() copyDisabled = false; } + var copyPref = document.getElementById("copyPref"); + copyPref.setAttribute("disabled", copyDisabled); + var copyName = document.getElementById("copyName"); copyName.setAttribute("disabled", copyDisabled); @@ -498,6 +501,12 @@ function updateContextMenu() toggleSelected.hidden = !canToggle; } +function copyPref() +{ + var pref = gPrefView[view.selection.currentIndex]; + gClipboardHelper.copyString(pref.prefCol + ';' + pref.valueCol); +} + function copyName() { gClipboardHelper.copyString(gPrefView[view.selection.currentIndex].prefCol); diff --git a/xpfe/global/resources/content/config.xul b/xpfe/global/resources/content/config.xul index 325bdb38cbe..d5b3000105d 100644 --- a/xpfe/global/resources/content/config.xul +++ b/xpfe/global/resources/content/config.xul @@ -57,6 +57,7 @@ + diff --git a/xpfe/global/resources/locale/en-US/config.dtd b/xpfe/global/resources/locale/en-US/config.dtd index 6aacd264051..cbc63722ad4 100644 --- a/xpfe/global/resources/locale/en-US/config.dtd +++ b/xpfe/global/resources/locale/en-US/config.dtd @@ -58,8 +58,11 @@ + + + - + @@ -69,7 +72,7 @@ - +