Skip to content

Commit 2bcf7e7

Browse files
committed
Some cleanup. Added UI strings.
1 parent 738f514 commit 2bcf7e7

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

src/profiler/profiler_view.js

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,6 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
242242

243243
this.onresize = function()
244244
{
245-
// TODO: don't update stuff that don't have to be updated, e.g.
246-
// legend, details, status
247245
if (this._container)
248246
this._update_view();
249247
};
@@ -336,7 +334,7 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
336334
{
337335
var button_title = this._profiler.is_active
338336
? ui_strings.S_BUTTON_STOP_PROFILER
339-
: ui_strings.S_BUTTON_START_PROFILER
337+
: ui_strings.S_BUTTON_START_PROFILER;
340338
window.toolbars[this.id].set_button_title("profiler-start-stop", button_title);
341339
};
342340

@@ -355,14 +353,6 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
355353
}
356354
};
357355

358-
this._on_settings_initialized = function(msg)
359-
{
360-
//if (msg.view_id == "profiler_all")
361-
//{
362-
// this._min_event_time = window.settings["profiler_all"].get("min-event-time")
363-
//}
364-
};
365-
366356
this._on_single_select_changed = function(msg)
367357
{
368358
if (msg.name == "min-event-time")
@@ -553,7 +543,6 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
553543

554544
window.messages.addListener("profile-enabled", this._on_profile_enabled.bind(this));
555545
window.messages.addListener("single-select-changed", this._on_single_select_changed.bind(this));
556-
window.messages.addListener("settings-initialized", this._on_settings_initialized.bind(this));
557546

558547
window.event_handlers.click["profiler-start-stop"] = this._start_stop_profiler.bind(this);
559548
window.event_handlers.click["profiler-reload-window"] = this._reload_window.bind(this);
@@ -588,20 +577,20 @@ ProfilerView.create_ui_widgets = function()
588577
name: "min-event-time",
589578
items: [
590579
{
591-
text: "All",
592-
title: "Show all events",
580+
text: ui_strings.S_PROFILER_FILTER_ALL,
581+
title: ui_strings.S_PROFILER_FILTER_ALL_TITLE,
593582
value: "0"
594583
},
595584
{
596-
text: "> 1 ms",
597-
title: "Show events with a self time of at least 1 ms",
585+
text: ui_strings.S_PROFILER_FILTER_1MS,
586+
title: ui_strings.S_PROFILER_FILTER_1MS_TITLE,
598587
value: "1"
599588
},
600589
{
601-
text: "> 15 ms",
602-
title: "Show events with a self time of at least 15 ms",
590+
text: ui_strings.S_PROFILER_FILTER_15MS,
591+
title: ui_strings.S_PROFILER_FILTER_15MS_TITLE,
603592
value: "15"
604-
},
593+
}
605594
]
606595
}
607596
]

src/ui-strings/ui_strings-en.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ ui_strings.S_PROFILER_NO_DATA = "No data";
13361336
ui_strings.S_PROFILER_NO_DETAILS = "No details";
13371337

13381338
/* DESC: Message in the profiler when the profiler is active */
1339-
ui_strings.S_PROFILER_PROFILING = "Stop profiling to inspect the collected data.";
1339+
ui_strings.S_PROFILER_PROFILING = "Stop profiling to inspect the collected data.";
13401340

13411341
/* DESC: Message in the profiler when the profiler failed */
13421342
ui_strings.S_PROFILER_PROFILING_FAILED = "Profiling failed";
@@ -1755,3 +1755,21 @@ ui_strings.S_TOGGLE_PAUSED_UPDATING_NETWORK_VIEW = "Pause updating network activ
17551755
/* DESC: String shown instead of filename when file name is missing */
17561756
ui_strings.S_UNKNOWN_SCRIPT = "(Unknown script)";
17571757

1758+
/* DESC: Button text for filter showing all events */
1759+
ui_strings.S_PROFILER_FILTER_ALL = "All";
1760+
1761+
/* DESC: Button text for filter showing only events with a self time of at least 1 ms */
1762+
ui_strings.S_PROFILER_FILTER_1MS = "> 1 ms";
1763+
1764+
/* DESC: Button text for filter showing only events with a self time of at least 15 ms */
1765+
ui_strings.S_PROFILER_FILTER_15MS = "> 15 ms";
1766+
1767+
/* DESC: Button title for filter showing all events */
1768+
ui_strings.S_PROFILER_FILTER_ALL_TITLE = "Show all events";
1769+
1770+
/* DESC: Button title for filter showing only events with a self time of at least 1 ms */
1771+
ui_strings.S_PROFILER_FILTER_1MS_TITLE = "Show events with a self time of at least 1 ms";
1772+
1773+
/* DESC: Button title for filter showing only events with a self time of at least 15 ms */
1774+
ui_strings.S_PROFILER_FILTER_15MS_TITLE = "Show events with a self time of at least 15 ms";
1775+

0 commit comments

Comments
 (0)