Browse files

Provide an 'install update' context menu item.

In the 'user scripts' tab.  Fixes #1421
  • Loading branch information...
1 parent 0fe2d70 commit 7ed47f93310ab3903ebfc26e1a9723acb325345a @arantius committed Oct 10, 2011
Showing with 4 additions and 15 deletions.
  1. +2 −1 content/addons.js
  2. +2 −14 content/addons.xul
View
3 content/addons.js
@@ -442,7 +442,6 @@ var greasemonkeyAddons = {
'move_separator',
'edit', 'show',
'edit_separator',
- 'checkUpdate',
'uninstall'];
var uninstallItems = ['uninstall_now', 'cancelUninstall'];
@@ -456,6 +455,8 @@ var greasemonkeyAddons = {
// Set visibility.
setItemsHidden(false, standardItems);
setItemsHidden(false, script.enabled ? ['disable'] : ['enable']);
+ setItemsHidden(script.updateAvailable, ['checkUpdate']);
+ setItemsHidden(!script.updateAvailable, ['installUpdate']);
// Set disabled.
var atBottom = !selectedItem.nextSibling;
var atTop = !selectedItem.previousSibling;
View
16 content/addons.xul
@@ -130,25 +130,13 @@
<menuitem id="userscript_context_checkUpdate" command="cmd_userscript_checkUpdate"
label="&cmd.checkUpdate.label;" accesskey="&cmd.checkUpdate.accesskey;"/>
- <!--
- Todo: Make install/upgrade menu items like extensions if/when added.
- <menuitem id="userscript_context_cancelInstall" command="cmd_cancelInstall"
- label="&cmd.cancelInstall.label;" accesskey="&cmd.cancelInstall.accesskey;"/>
- <menuitem id="userscript_context_cancelUpgrade" command="cmd_cancelUpgrade"
- label="&cmd.cancelUpgrade.label;" accesskey="&cmd.cancelUpgrade.accesskey;"/>
- -->
+ <menuitem id="userscript_context_installUpdate" command="cmd_userscript_installUpdate"
+ label="&cmd.installUpdate.label;" accesskey="&cmd.installUpdate.accesskey;"/>
<menuitem id="userscript_context_enable" command="cmd_userscript_enable"
label="&cmd.enable.label;" accesskey="&cmd.enable.accesskey;"/>
<menuitem id="userscript_context_disable" command="cmd_userscript_disable"
label="&cmd.disable.label;" accesskey="&cmd.disable.accesskey;"/>
-
- <!--
- Todo: as above.
- <menuitem id="userscript_context_includeUpdate" command="cmd_includeUpdate"
- label="&cmd.includeUpdate.label;" accesskey="&cmd.includeUpdate.accesskey;"
- type="checkbox"/>
- -->
</menupopup>
</window>

0 comments on commit 7ed47f9

Please sign in to comment.