Changeset 703
- Timestamp:
- 03/28/08 13:29:30 (8 months ago)
- Files:
-
- branches/manage-ui2/src/chrome/chromeFiles/content/manage.js (modified) (1 diff)
- branches/manage-ui2/src/chrome/chromeFiles/content/manage.xul (modified) (1 diff)
- branches/manage-ui2/src/chrome/chromeFiles/content/prefmanager.js (modified) (1 diff)
- branches/manage-ui2/src/chrome/chromeFiles/locale/en-US/gm-manage.properties (modified) (1 diff)
- branches/manage-ui2/src/chrome/chromeFiles/locale/en-US/greasemonkey.dtd (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/manage-ui2/src/chrome/chromeFiles/content/manage.js
r700 r703 111 111 112 112 function handleUninstallButton() { 113 if (document.getElementById("chkUninstallPrefs").checked) { 114 // Remove saved preferences 115 GM_prefRoot.remove(selectedScript.prefBranch); 116 } 117 118 config.uninstall(selectedScript); 113 var gmManageBundle = document.getElementById("gm-manage-bundle"); 114 115 var hasPrefs = GM_prefRoot.existsBranch(selectedScript.prefBranch); 116 117 var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] 118 .getService(Components.interfaces.nsIPromptService); 119 120 var choice = promptService.confirmEx( 121 window, 122 gmManageBundle.getString("uninstallDialogTitle"), 123 gmManageBundle.getFormattedString(hasPrefs ? "uninstallTextWithPrefs" : 124 "uninstallTextWithoutPrefs", [selectedScript.name]), 125 promptService.BUTTON_POS_0_DEFAULT + 126 promptService.BUTTON_TITLE_IS_STRING * ( 127 promptService.BUTTON_POS_0 + 128 promptService.BUTTON_POS_1 + 129 (hasPrefs ? promptService.BUTTON_POS_2 : 0) 130 ), 131 gmManageBundle.getString("uninstallButtonRemoveScript"), // 0 132 gmManageBundle.getString("uninstallButtonCancel"), // 1 133 gmManageBundle.getString("uninstallButtonRemoveScriptAndPrefs"), // 2 134 null, {} 135 ); 136 137 if (choice == 2) GM_prefRoot.remove(selectedScript.prefBranch); 138 139 if (choice != 1) config.uninstall(selectedScript); 119 140 } 120 141 branches/manage-ui2/src/chrome/chromeFiles/content/manage.xul
r688 r703 59 59 <button id="btnUninstall" 60 60 label="&manage.label.btnUninstall;" /> 61 <checkbox id="chkUninstallPrefs"62 label="&manage.label.chkUninstall;"63 checked="false" />64 61 </hbox> 65 62 </vbox> branches/manage-ui2/src/chrome/chromeFiles/content/prefmanager.js
r692 r703 28 28 this.exists = function(prefName) { 29 29 return pref.getPrefType(prefName) != 0; 30 }; 31 32 /** 33 * whether a preference branch exists 34 */ 35 this.existsBranch = function(prefName) { 36 var out = {}; 37 pref.getChildList(prefName, out); 38 return !!out.value; 30 39 }; 31 40 branches/manage-ui2/src/chrome/chromeFiles/locale/en-US/gm-manage.properties
r652 r703 5 5 promptForEdit.msg=Modify the URL of the page below. You can specify multiple pages using the wildcard (*) character. 6 6 promptForEdit.title=Edit Page 7 8 uninstallDialogTitle=Uninstall User Script 9 uninstallTextWithPrefs=You are about to uninstall the user script "%S".\n\nWould you also like to delete associated preferences? 10 uninstallTextWithoutPrefs=You are about to uninstall the user script "%S".\n\nWould you like to continue? 11 uninstallButtonRemoveScriptAndPrefs=Uninstall and delete preferences 12 uninstallButtonRemoveScript=Uninstall 13 uninstallButtonCancel=Cancel branches/manage-ui2/src/chrome/chromeFiles/locale/en-US/greasemonkey.dtd
r673 r703 8 8 <!ENTITY manage.label.chkEnabled "Enabled"> 9 9 <!ENTITY manage.label.btnUninstall "Uninstall"> 10 <!ENTITY manage.label.chkUninstall "Also uninstall associated preferences">11 10 <!ENTITY manage.reorderHelp "Drag-and-drop with the mouse or press Alt-Up/Alt-Down to reorder scripts in this list."> 12 11
