Bug 233721 Add confirmation for Set As Wallpaper p=stefan@borggraefe.com r=me sr=tor

This commit is contained in:
neil%parkwaycc.co.uk 2006-07-29 05:41:49 +00:00
Родитель c514661a28
Коммит 174c6f7b9f
1 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -610,6 +610,21 @@ 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 gNavigatorBundle = document.getElementById("bundle_navigator");
var promptTitle = gNavigatorBundle.getString("wallpaperConfirmTitle");
var promptMsg = gNavigatorBundle.getString("wallpaperConfirmMsg");
var promptConfirmButton = gNavigatorBundle.getString("wallpaperConfirmButton");
var buttonPressed = promptService.confirmEx(window, promptTitle, promptMsg,
(promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) +
(promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1),
promptConfirmButton, null, null, null, {value:0});
if (buttonPressed != 0)
return;
var winhooks = Components.classes[ "@mozilla.org/winhooks;1" ].
getService(Components.interfaces.nsIWindowsHooks);