mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 619518 - If a notification has no callback, use a toaster popup
This commit is contained in:
parent
cd19d688f1
commit
9ece094edb
@ -1173,7 +1173,7 @@ var BrowserUI = {
|
||||
Services.prefs.setBoolPref("toolkit.screen.lock", !locked);
|
||||
|
||||
let strings = Strings.browser;
|
||||
let alerts = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
|
||||
let alerts = Cc["@mozilla.org/toaster-alerts-service;1"].getService(Ci.nsIAlertsService);
|
||||
alerts.showAlertNotification(null, strings.GetStringFromName("alertLockScreen"),
|
||||
strings.GetStringFromName("alertLockScreen." + (!locked ? "locked" : "unlocked")), false, "", null);
|
||||
break;
|
||||
|
@ -387,7 +387,7 @@ var Browser = {
|
||||
let disabledStrings = Strings.browser.GetStringFromName("alertAddonsDisabled");
|
||||
let label = PluralForm.get(addons.length, disabledStrings).replace("#1", addons.length);
|
||||
|
||||
let alerts = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
|
||||
let alerts = Cc["@mozilla.org/toaster-alerts-service;1"].getService(Ci.nsIAlertsService);
|
||||
alerts.showAlertNotification(URI_GENERIC_ICON_XPINSTALL, Strings.browser.GetStringFromName("alertAddons"),
|
||||
label, false, "", null);
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ HelperAppLauncherDialog.prototype = {
|
||||
_notify: function hald_notify(aLauncher, aCallback) {
|
||||
let bundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
|
||||
|
||||
let notifier = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
|
||||
let notifier = Cc[aCallback ? "@mozilla.org/alerts-service;1" : "@mozilla.org/toaster-alerts-service;1"].getService(Ci.nsIAlertsService);
|
||||
notifier.showAlertNotification(URI_GENERIC_ICON_DOWNLOAD,
|
||||
bundle.GetStringFromName("alertDownloads"),
|
||||
bundle.GetStringFromName("alertCantOpenDownload"),
|
||||
|
@ -80,9 +80,7 @@ ifdef MOZ_UPDATER
|
||||
EXTRA_COMPONENTS += UpdatePrompt.js
|
||||
endif
|
||||
|
||||
ifndef ANDROID
|
||||
EXTRA_COMPONENTS += AlertsService.js
|
||||
endif
|
||||
|
||||
ifneq (Android,$(OS_TARGET))
|
||||
DIRS = phone \
|
||||
|
@ -43,9 +43,13 @@ component {C6E8C44D-9F39-4AF7-BCC0-76E38A8310F5} ContentPermissionPrompt.js
|
||||
contract @mozilla.org/content-permission/prompt;1 {C6E8C44D-9F39-4AF7-BCC0-76E38A8310F5}
|
||||
|
||||
# AlertsService.js
|
||||
|
||||
component {fe33c107-82a4-41d6-8c64-5353267e04c9} AlertsService.js
|
||||
#ifndef ANDROID
|
||||
contract @mozilla.org/system-alerts-service;1 {fe33c107-82a4-41d6-8c64-5353267e04c9}
|
||||
#endif
|
||||
|
||||
# ToasterAlertsService : alias to AlertsService
|
||||
contract @mozilla.org/toaster-alerts-service;1 {fe33c107-82a4-41d6-8c64-5353267e04c9}
|
||||
|
||||
# XPIDialogService.js
|
||||
component {c1242012-27d8-477e-a0f1-0b098ffc329b} XPIDialogService.js
|
||||
|
Loading…
Reference in New Issue
Block a user