Skip to content

Commit

Permalink
Issue mozilla#183 - images folder, tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
xabolcs committed Jun 29, 2015
1 parent 2fa5e67 commit 13b3752
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
11 changes: 7 additions & 4 deletions extension/lib/config.js
Expand Up @@ -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. " +
Expand All @@ -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"
}
};

Expand Down
19 changes: 9 additions & 10 deletions extension/lib/main.js
Expand Up @@ -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");
Expand Down Expand Up @@ -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
});

Expand All @@ -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) {
Expand Down

0 comments on commit 13b3752

Please sign in to comment.