зеркало из https://github.com/mozilla/pjs.git
Bug 233721 Add confirmation for Set As Wallpaper p=stefan@borggraefe.com r=me sr=tor
This commit is contained in:
Родитель
c514661a28
Коммит
174c6f7b9f
|
@ -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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче