Fix 182928: Add confirmation for Set As Wallpaper. Patch mainly by Jeff Thieleke (sr=blake).

This commit is contained in:
blakeross%telocity.com 2004-02-10 04:05:34 +00:00
parent cdedbbd005
commit a78e91d15e
3 changed files with 18 additions and 1 deletions

View File

@ -3067,6 +3067,19 @@ nsContextMenu.prototype = {
openTopWin( this.bgImageURL );
},
setWallpaper: function() {
// Confirm since it's annoying if you hit this accidentally.
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
var promptTitle = gNavigatorBundle.getString("wallpaperConfirmTitle");
var promptMsg = gNavigatorBundle.getString("wallpaperConfirmMsg");
var buttonPressed = promptService.confirmEx(window, promptTitle, promptMsg,
(promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) +
(promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1),
promptTitle, null, null, null, {value:0});
if (buttonPressed != 0)
return;
var winhooks = Components.classes[ "@mozilla.org/winhooks;1" ].
getService(Components.interfaces.nsIWindowsHooks);

View File

@ -212,7 +212,7 @@
<!ENTITY viewImageCmd.accesskey "I">
<!ENTITY viewBGImageCmd.label "View Background Image">
<!ENTITY viewBGImageCmd.accesskey "w">
<!ENTITY setWallpaperCmd.label "Set As Wallpaper">
<!ENTITY setWallpaperCmd.label "Set As Wallpaper...">
<!ENTITY setWallpaperCmd.accesskey "S">
<!ENTITY bookmarkPageCmd.label "Bookmark This Page...">
<!ENTITY bookmarkPageCmd.accesskey "m">

View File

@ -47,3 +47,7 @@ addEngines=Add engines...
# Default name for the Web Panels sidebar
webPanels=Web Panels
# setWallpaper confirmation dialog
wallpaperConfirmTitle = Set Wallpaper
wallpaperConfirmMsg = Do you want to set this image as your desktop wallpaper?