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 2004-02-19 11:15:29 +00:00
Родитель e36a7933da
Коммит 69c56a6074
2 изменённых файлов: 20 добавлений и 0 удалений

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

@ -50,6 +50,11 @@ oldthemetitle=Warning: incompatible theme
oldTheme=You have selected a theme which was designed for an earlier version of %brand% and is incompatible with your current %brand% version. Please check %brand% theme sites for an updated version of the theme. You can uninstall this theme by clicking \"OK\" button.
noPopupControl=can't control popups for this site
#nsContextMenu.js (setWallpaper confirmation dialog)
wallpaperConfirmTitle = Set As Wallpaper
wallpaperConfirmButton = Set Wallpaper
wallpaperConfirmMsg = Do you want to set this image as your desktop wallpaper?
# XXX - this sucks and should only be temporary.
switchskins=Theme changes will take effect when you restart %S.
switchskinstitle=Apply Theme

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

@ -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);