Bug 1070957 - Show deprecation notice in App Manager. r=paul

This commit is contained in:
J. Ryan Stinnett 2014-10-02 08:30:00 -04:00
parent 5b02973fff
commit cd2741e613
2 changed files with 35 additions and 4 deletions

View File

@ -2,14 +2,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const Cu = Components.utils;
const {utils: Cu, interfaces: Ci} = Components;
Cu.import("resource:///modules/devtools/gDevTools.jsm");
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
const {require} = devtools;
const {ConnectionManager, Connection} = require("devtools/client/connection-manager");
const promise = require("devtools/toolkit/deprecated-sync-thenables");
const prefs = require('sdk/preferences/service');
const prefs = require("sdk/preferences/service");
const Services = require("Services");
const Strings = Services.strings.createBundle("chrome://browser/locale/devtools/app-manager.properties");
let UI = {
_toolboxTabCursor: 0,
@ -34,6 +35,7 @@ let UI = {
let defaultPanel = prefs.get("devtools.appmanager.lastTab");
let panelExists = !!document.querySelector("." + defaultPanel + "-panel");
this.selectTab(panelExists ? defaultPanel : "projects");
this.showDeprecationNotice();
},
onUnload: function() {
@ -178,7 +180,33 @@ let UI = {
} else {
return gDevTools.showToolbox(target, null, host);
}
},
showDeprecationNotice: function() {
let message = Strings.GetStringFromName("index.deprecationNotice");
let buttons = [
{
label: Strings.GetStringFromName("index.launchWebIDE"),
callback: gDevToolsBrowser.openWebIDE
},
{
label: Strings.GetStringFromName("index.readMoreAboutWebIDE"),
callback: () => {
window.open("https://developer.mozilla.org/docs/Tools/WebIDE");
}
}
];
let docShell = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let browser = docShell.chromeEventHandler;
let nbox = browser.ownerDocument.defaultView.gBrowser
.getNotificationBox(browser);
nbox.appendNotification(message, "app-manager-deprecation", null,
nbox.PRIORITY_WARNING_LOW, buttons);
}
}
};
UI.init();

View File

@ -2,6 +2,9 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
index.deprecationNotice=The App Manager will be removed in a future release. Your projects have been migrated to WebIDE.
index.launchWebIDE=Launch WebIDE
index.readMoreAboutWebIDE=Read More
# LOCALIZATION NOTE (device.deviceSize): %1$S is the device's width, %2$S is
# the device's height, %3$S is the device's pixel density.
# Example: 800x480 (86 DPI).