diff --git a/extension/data/logging_disabled.svg b/extension/data/images/logging_disabled.svg similarity index 100% rename from extension/data/logging_disabled.svg rename to extension/data/images/logging_disabled.svg diff --git a/extension/data/logging_enabled.svg b/extension/data/images/logging_enabled.svg similarity index 100% rename from extension/data/logging_enabled.svg rename to extension/data/images/logging_enabled.svg diff --git a/extension/data/menu-button.svg b/extension/data/images/menu_button.svg similarity index 100% rename from extension/data/menu-button.svg rename to extension/data/images/menu_button.svg diff --git a/extension/lib/config.js b/extension/lib/config.js index a05f897..2e9e8e5 100644 --- a/extension/lib/config.js +++ b/extension/lib/config.js @@ -39,11 +39,11 @@ const APPLICATION = { * Extension related constants */ const EXTENSION = { - memory_poll_interval_default: 5000, - help_page_url: "https://github.com/mozilla/memchaser/blob/master/README.md#memchaser", - widget_tooltips : { + memory_poll_interval_default: 5000, + + ui_tooltips : { resident_label: "Memory used by the process that is present in physical memory. " + "It does not necessarily have to match the process manager.", resident_data: "Memory used by the process that is present in physical memory. " + @@ -56,8 +56,11 @@ const EXTENSION = { "groups of XPCOM objects that only refer to each other.", cc_duration: "Duration of the last cycle collector activity.", cc_age: "The interval between the last two cycle collection activities.", + logger_enabled: "MemChaser logging is currently enabled. Click to disable.", - logger_disabled: "MemChaser logging is currently disabled. Click to enable." + logger_disabled: "MemChaser logging is currently disabled. Click to enable.", + + tools_menu: "MemChaser Tools" } }; diff --git a/extension/lib/main.js b/extension/lib/main.js index cdee04e..7879975 100644 --- a/extension/lib/main.js +++ b/extension/lib/main.js @@ -5,11 +5,14 @@ "use strict"; const { Cc, Ci, Cu, CC } = require("chrome"); +const { Frame } = require("sdk/ui/frame"); const panel = require("sdk/panel"); const prefs = require("sdk/preferences/service"); const self = require("sdk/self"); const simple_prefs = require("sdk/simple-prefs"); const tabs = require("sdk/tabs"); +const { ToggleButton } = require('sdk/ui/button/toggle'); +const { Toolbar } = require("sdk/ui/toolbar"); const config = require("./config"); const garbage_collector = require("./garbage-collector"); @@ -82,25 +85,21 @@ exports.main = function (options, callbacks) { } }); - var { Frame } = require("sdk/ui/frame"); - var { ToggleButton } = require('sdk/ui/button/toggle'); - var { Toolbar } = require("sdk/ui/toolbar"); - var frame = new Frame({ url: "./frame/frame.html" }); var menuButton = ToggleButton({ id: "toolbar-menu-button", - label: "Memchaser Tools", - icon: "./menu-button.svg", + label: config.extension.ui_tooltips.tools_menu, + icon: "./images/menu_button.svg", onChange: handleMenuButtonChange }); var logButton = ToggleButton({ id: "toolbar-log-button", - label: "Logging is disabled", - icon: "./logging_disabled.svg", + label: config.extension.ui_tooltips.logger_disabled, + icon: "./images/logging_disabled.svg", onChange: handleLogButtonChange }); @@ -123,8 +122,8 @@ exports.main = function (options, callbacks) { function handleLogButtonChange(state) { logger.active = state.checked; var stateLabel = logger.active ? "enabled" : "disabled"; - logButton.label = "Logging is " + stateLabel; - logButton.icon = "./logging_" + stateLabel + ".svg"; + logButton.label = config.extension.ui_tooltips["logger_" + stateLabel]; + logButton.icon = "./images/logging_" + stateLabel + ".svg"; } function memoryStatisticsForwarder(aData) {