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