forked from qt-creator/qt-creator
CtfVisualizer: Convert to using Tr::tr
Change-Id: Ide0c6556642c20a200fd72ec8e9596950af823b4 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -46917,7 +46917,7 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
|
|||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CtfVisualizer::Internal::CtfStatisticsModel</name>
|
<name>CtfVisualizer</name>
|
||||||
<message>
|
<message>
|
||||||
<source>Title</source>
|
<source>Title</source>
|
||||||
<translation>Titel</translation>
|
<translation>Titel</translation>
|
||||||
@@ -46930,9 +46930,6 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
|
|||||||
<source>Total Time</source>
|
<source>Total Time</source>
|
||||||
<translation>Gesamtdauer</translation>
|
<translation>Gesamtdauer</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>CtfVisualizer::Internal::CtfTimelineModel</name>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Value</source>
|
<source>Value</source>
|
||||||
<translation>Wert</translation>
|
<translation>Wert</translation>
|
||||||
@@ -46941,9 +46938,6 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
|
|||||||
<source>Arguments</source>
|
<source>Arguments</source>
|
||||||
<translation>Argumente</translation>
|
<translation>Argumente</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>CtfVisualizer::Internal::CtfVisualizerTool</name>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Reset Zoom</source>
|
<source>Reset Zoom</source>
|
||||||
<translation>Vergrößerung zurücksetzen</translation>
|
<translation>Vergrößerung zurücksetzen</translation>
|
||||||
|
|||||||
@@ -51523,7 +51523,7 @@ Continue?</source>
|
|||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CtfVisualizer::Internal::CtfStatisticsModel</name>
|
<name>CtfVisualizer</name>
|
||||||
<message>
|
<message>
|
||||||
<source>Title</source>
|
<source>Title</source>
|
||||||
<translation>タイトル</translation>
|
<translation>タイトル</translation>
|
||||||
@@ -51536,9 +51536,6 @@ Continue?</source>
|
|||||||
<source>Total Time</source>
|
<source>Total Time</source>
|
||||||
<translation>合計時間</translation>
|
<translation>合計時間</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>CtfVisualizer::Internal::CtfTimelineModel</name>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Value</source>
|
<source>Value</source>
|
||||||
<translation>値</translation>
|
<translation>値</translation>
|
||||||
@@ -51551,9 +51548,6 @@ Continue?</source>
|
|||||||
<source>Arguments</source>
|
<source>Arguments</source>
|
||||||
<translation>引数</translation>
|
<translation>引数</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>CtfVisualizer::Internal::CtfVisualizerTool</name>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Timeline</source>
|
<source>Timeline</source>
|
||||||
<translation>タイムライン</translation>
|
<translation>タイムライン</translation>
|
||||||
|
|||||||
@@ -13881,7 +13881,7 @@ Flags: %3</source>
|
|||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CtfVisualizer::Internal::CtfStatisticsModel</name>
|
<name>CtfVisualizer</name>
|
||||||
<message>
|
<message>
|
||||||
<source>Title</source>
|
<source>Title</source>
|
||||||
<translation>Заголовок</translation>
|
<translation>Заголовок</translation>
|
||||||
@@ -13910,9 +13910,6 @@ Flags: %3</source>
|
|||||||
<source>Maximum Time</source>
|
<source>Maximum Time</source>
|
||||||
<translation>Максимальное время</translation>
|
<translation>Максимальное время</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>CtfVisualizer::Internal::CtfTimelineModel</name>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Stack Level %1</source>
|
<source>Stack Level %1</source>
|
||||||
<translation>Уровень %1 стека</translation>
|
<translation>Уровень %1 стека</translation>
|
||||||
@@ -13981,9 +13978,6 @@ Flags: %3</source>
|
|||||||
<source>Return Arguments</source>
|
<source>Return Arguments</source>
|
||||||
<translation>Возвращаемые аргументы</translation>
|
<translation>Возвращаемые аргументы</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>CtfVisualizer::Internal::CtfTraceManager</name>
|
|
||||||
<message>
|
<message>
|
||||||
<source>CTF Visualizer</source>
|
<source>CTF Visualizer</source>
|
||||||
<translation>Визуализатор CTF</translation>
|
<translation>Визуализатор CTF</translation>
|
||||||
@@ -13998,9 +13992,6 @@ Do you want to display them anyway?</source>
|
|||||||
<translation>Трассировка содержит потоки с глубиной стека > 512.
|
<translation>Трассировка содержит потоки с глубиной стека > 512.
|
||||||
Всё равно отобразить?</translation>
|
Всё равно отобразить?</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>CtfVisualizer::Internal::CtfVisualizerTool</name>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Chrome Trace Format Viewer</source>
|
<source>Chrome Trace Format Viewer</source>
|
||||||
<translation>Просмотрщик Chrome Trace Format</translation>
|
<translation>Просмотрщик Chrome Trace Format</translation>
|
||||||
@@ -14033,10 +14024,6 @@ Do you want to display them anyway?</source>
|
|||||||
<source>JSON File (*.json)</source>
|
<source>JSON File (*.json)</source>
|
||||||
<translation>Файл JSON (*.json)</translation>
|
<translation>Файл JSON (*.json)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>CTF Visualizer</source>
|
|
||||||
<translation>Визуализатор CTF</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>The file does not contain any trace data.</source>
|
<source>The file does not contain any trace data.</source>
|
||||||
<translation>Файл не содержит данных трассировки.</translation>
|
<translation>Файл не содержит данных трассировки.</translation>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "ctfstatisticsmodel.h"
|
#include "ctfstatisticsmodel.h"
|
||||||
|
|
||||||
#include "ctfvisualizerconstants.h"
|
#include "ctfvisualizerconstants.h"
|
||||||
|
#include "ctfvisualizertr.h"
|
||||||
|
|
||||||
#include <tracing/timelineformattime.h>
|
#include <tracing/timelineformattime.h>
|
||||||
|
|
||||||
@@ -167,19 +168,19 @@ QVariant CtfStatisticsModel::headerData(int section, Qt::Orientation orientation
|
|||||||
|
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case Column::Title:
|
case Column::Title:
|
||||||
return tr("Title");
|
return Tr::tr("Title");
|
||||||
case Column::Count:
|
case Column::Count:
|
||||||
return tr("Count");
|
return Tr::tr("Count");
|
||||||
case Column::TotalDuration:
|
case Column::TotalDuration:
|
||||||
return tr("Total Time");
|
return Tr::tr("Total Time");
|
||||||
case Column::RelativeDuration:
|
case Column::RelativeDuration:
|
||||||
return tr("Percentage");
|
return Tr::tr("Percentage");
|
||||||
case Column::MinDuration:
|
case Column::MinDuration:
|
||||||
return tr("Minimum Time");
|
return Tr::tr("Minimum Time");
|
||||||
case Column::AvgDuration:
|
case Column::AvgDuration:
|
||||||
return tr("Average Time");
|
return Tr::tr("Average Time");
|
||||||
case Column::MaxDuration:
|
case Column::MaxDuration:
|
||||||
return tr("Maximum Time");
|
return Tr::tr("Maximum Time");
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "ctftracemanager.h"
|
#include "ctftracemanager.h"
|
||||||
#include "ctfvisualizerconstants.h"
|
#include "ctfvisualizerconstants.h"
|
||||||
|
#include "ctfvisualizertr.h"
|
||||||
|
|
||||||
#include <tracing/timelineformattime.h>
|
#include <tracing/timelineformattime.h>
|
||||||
#include <tracing/timelinemodelaggregator.h>
|
#include <tracing/timelinemodelaggregator.h>
|
||||||
@@ -54,7 +55,8 @@ QVariantList CtfTimelineModel::labels() const
|
|||||||
|
|
||||||
for (int i = 0; i < m_maxStackSize; ++i) {
|
for (int i = 0; i < m_maxStackSize; ++i) {
|
||||||
QVariantMap element;
|
QVariantMap element;
|
||||||
element.insert(QLatin1String("description"), QStringLiteral("- ").append(tr("Stack Level %1").arg(i)));
|
element.insert(QLatin1String("description"),
|
||||||
|
QStringLiteral("- ").append(Tr::tr("Stack Level %1").arg(i)));
|
||||||
element.insert(QLatin1String("id"), m_counterNames.size() + i);
|
element.insert(QLatin1String("id"), m_counterNames.size() + i);
|
||||||
result << element;
|
result << element;
|
||||||
}
|
}
|
||||||
@@ -68,12 +70,15 @@ QVariantMap CtfTimelineModel::orderedDetails(int index) const
|
|||||||
if (counterIdx > 0) {
|
if (counterIdx > 0) {
|
||||||
// this item is a counter, add its properties:
|
// this item is a counter, add its properties:
|
||||||
info.insert(0, {{}, QString::fromStdString(m_counterNames.at(counterIdx - 1))});
|
info.insert(0, {{}, QString::fromStdString(m_counterNames.at(counterIdx - 1))});
|
||||||
info.insert(4, {tr("Value"), QString::number(double(m_counterValues.at(index)), 'g')});
|
info.insert(4, {Tr::tr("Value"),
|
||||||
info.insert(5, {tr("Min"), QString::number(double(m_counterData.at(counterIdx - 1).min), 'g')});
|
QString::number(double(m_counterValues.at(index)), 'g')});
|
||||||
info.insert(6, {tr("Max"), QString::number(double(m_counterData.at(counterIdx - 1).max), 'g')});
|
info.insert(5, {Tr::tr("Min"),
|
||||||
|
QString::number(double(m_counterData.at(counterIdx - 1).min), 'g')});
|
||||||
|
info.insert(6, {Tr::tr("Max"),
|
||||||
|
QString::number(double(m_counterData.at(counterIdx - 1).max), 'g')});
|
||||||
}
|
}
|
||||||
info.insert(2, {tr("Start"), Timeline::formatTime(startTime(index))});
|
info.insert(2, {Tr::tr("Start"), Timeline::formatTime(startTime(index))});
|
||||||
info.insert(3, {tr("Wall Duration"), Timeline::formatTime(duration(index))});
|
info.insert(3, {Tr::tr("Wall Duration"), Timeline::formatTime(duration(index))});
|
||||||
QVariantMap data;
|
QVariantMap data;
|
||||||
QString title = info.value(0).second;
|
QString title = info.value(0).second;
|
||||||
data.insert("title", title);
|
data.insert("title", title);
|
||||||
@@ -176,8 +181,8 @@ void CtfTimelineModel::finalize(double traceBegin, double traceEnd, const QStrin
|
|||||||
int index = m_openEventIds.pop();
|
int index = m_openEventIds.pop();
|
||||||
qint64 duration = normalizedEnd - startTime(index);
|
qint64 duration = normalizedEnd - startTime(index);
|
||||||
insertEnd(index, duration);
|
insertEnd(index, duration);
|
||||||
m_details[index].insert(3, {reuse(tr("Wall Duration")), Timeline::formatTime(duration)});
|
m_details[index].insert(3, {reuse(Tr::tr("Wall Duration")), Timeline::formatTime(duration)});
|
||||||
m_details[index].insert(6, {reuse(tr("Unfinished")), reuse(tr("true"))});
|
m_details[index].insert(6, {reuse(Tr::tr("Unfinished")), reuse(Tr::tr("true"))});
|
||||||
}
|
}
|
||||||
computeNesting();
|
computeNesting();
|
||||||
|
|
||||||
@@ -211,7 +216,7 @@ QString CtfTimelineModel::eventTitle(int index) const
|
|||||||
void CtfTimelineModel::updateName()
|
void CtfTimelineModel::updateName()
|
||||||
{
|
{
|
||||||
if (m_threadName.isEmpty()) {
|
if (m_threadName.isEmpty()) {
|
||||||
setDisplayName(tr("Thread %1").arg(m_threadId));
|
setDisplayName(Tr::tr("Thread %1").arg(m_threadId));
|
||||||
} else {
|
} else {
|
||||||
setDisplayName(QString("%1 (%2)").arg(m_threadName).arg(m_threadId));
|
setDisplayName(QString("%1 (%2)").arg(m_threadName).arg(m_threadId));
|
||||||
}
|
}
|
||||||
@@ -281,24 +286,25 @@ qint64 CtfTimelineModel::newStackEvent(const json &event, qint64 normalizedTime,
|
|||||||
m_details[index].insert(0, {{}, reuse(QString::fromStdString(name))});
|
m_details[index].insert(0, {{}, reuse(QString::fromStdString(name))});
|
||||||
}
|
}
|
||||||
if (event.contains(CtfEventCategoryKey)) {
|
if (event.contains(CtfEventCategoryKey)) {
|
||||||
m_details[index].insert(1, {reuse(tr("Categories")), reuse(QString::fromStdString(event[CtfEventCategoryKey]))});
|
m_details[index].insert(1, {reuse(Tr::tr("Categories")),
|
||||||
|
reuse(QString::fromStdString(event[CtfEventCategoryKey]))});
|
||||||
}
|
}
|
||||||
if (event.contains("args") && !event["args"].empty()) {
|
if (event.contains("args") && !event["args"].empty()) {
|
||||||
QString argsJson = QString::fromStdString(event["args"].dump(1));
|
QString argsJson = QString::fromStdString(event["args"].dump(1));
|
||||||
// strip leading and trailing curled brackets:
|
// strip leading and trailing curled brackets:
|
||||||
argsJson = argsJson.size() > 4 ? argsJson.mid(2, argsJson.size() - 4) : argsJson;
|
argsJson = argsJson.size() > 4 ? argsJson.mid(2, argsJson.size() - 4) : argsJson;
|
||||||
m_details[index].insert(4, {reuse(tr("Arguments")), reuse(argsJson)});
|
m_details[index].insert(4, {reuse(Tr::tr("Arguments")), reuse(argsJson)});
|
||||||
}
|
}
|
||||||
if (eventPhase == CtfEventTypeInstant) {
|
if (eventPhase == CtfEventTypeInstant) {
|
||||||
m_details[index].insert(6, {reuse(tr("Instant")), reuse(tr("true"))});
|
m_details[index].insert(6, {reuse(Tr::tr("Instant")), reuse(Tr::tr("true"))});
|
||||||
if (event.contains("s")) {
|
if (event.contains("s")) {
|
||||||
std::string scope = event["s"];
|
std::string scope = event["s"];
|
||||||
if (scope == "g") {
|
if (scope == "g") {
|
||||||
m_details[index].insert(7, {reuse(tr("Scope")), reuse(tr("global"))});
|
m_details[index].insert(7, {reuse(Tr::tr("Scope")), reuse(Tr::tr("global"))});
|
||||||
} else if (scope == "p") {
|
} else if (scope == "p") {
|
||||||
m_details[index].insert(7, {reuse(tr("Scope")), reuse(tr("process"))});
|
m_details[index].insert(7, {reuse(Tr::tr("Scope")), reuse(Tr::tr("process"))});
|
||||||
} else {
|
} else {
|
||||||
m_details[index].insert(7, {reuse(tr("Scope")), reuse(tr("thread"))});
|
m_details[index].insert(7, {reuse(Tr::tr("Scope")), reuse(Tr::tr("thread"))});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -318,7 +324,7 @@ qint64 CtfTimelineModel::closeStackEvent(const json &event, double timestamp, qi
|
|||||||
QString argsJson = QString::fromStdString(event["args"].dump(1));
|
QString argsJson = QString::fromStdString(event["args"].dump(1));
|
||||||
// strip leading and trailing curled brackets:
|
// strip leading and trailing curled brackets:
|
||||||
argsJson = argsJson.size() > 4 ? argsJson.mid(2, argsJson.size() - 4) : argsJson;
|
argsJson = argsJson.size() > 4 ? argsJson.mid(2, argsJson.size() - 4) : argsJson;
|
||||||
m_details[index].insert(5, {reuse(tr("Return Arguments")), reuse(argsJson)});
|
m_details[index].insert(5, {reuse(Tr::tr("Return Arguments")), reuse(argsJson)});
|
||||||
}
|
}
|
||||||
return duration;
|
return duration;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||||
#include "ctftracemanager.h"
|
#include "ctftracemanager.h"
|
||||||
|
|
||||||
#include "ctftimelinemodel.h"
|
|
||||||
#include "ctfstatisticsmodel.h"
|
#include "ctfstatisticsmodel.h"
|
||||||
|
#include "ctftimelinemodel.h"
|
||||||
#include "ctfvisualizerconstants.h"
|
#include "ctfvisualizerconstants.h"
|
||||||
|
#include "ctfvisualizertr.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <tracing/timelinemodelaggregator.h>
|
#include <tracing/timelinemodelaggregator.h>
|
||||||
@@ -137,8 +138,8 @@ void CtfTraceManager::load(const QString &filename)
|
|||||||
std::ifstream file(filename.toStdString());
|
std::ifstream file(filename.toStdString());
|
||||||
if (!file.is_open()) {
|
if (!file.is_open()) {
|
||||||
QMessageBox::warning(Core::ICore::dialogParent(),
|
QMessageBox::warning(Core::ICore::dialogParent(),
|
||||||
tr("CTF Visualizer"),
|
Tr::tr("CTF Visualizer"),
|
||||||
tr("Cannot read the CTF file."));
|
Tr::tr("Cannot read the CTF file."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CtfJsonParserCallback ctfParser(this);
|
CtfJsonParserCallback ctfParser(this);
|
||||||
@@ -159,8 +160,8 @@ void CtfTraceManager::finalize()
|
|||||||
if (!userConsentToIgnoreDeepTraces) {
|
if (!userConsentToIgnoreDeepTraces) {
|
||||||
QMessageBox::StandardButton answer
|
QMessageBox::StandardButton answer
|
||||||
= QMessageBox::question(Core::ICore::dialogParent(),
|
= QMessageBox::question(Core::ICore::dialogParent(),
|
||||||
tr("CTF Visualizer"),
|
Tr::tr("CTF Visualizer"),
|
||||||
tr("The trace contains threads with stack depth > "
|
Tr::tr("The trace contains threads with stack depth > "
|
||||||
"512.\nDo you want to display them anyway?"),
|
"512.\nDo you want to display them anyway?"),
|
||||||
QMessageBox::Yes | QMessageBox::No,
|
QMessageBox::Yes | QMessageBox::No,
|
||||||
QMessageBox::No);
|
QMessageBox::No);
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ CtfVisualizerTool::CtfVisualizerTool()
|
|||||||
{
|
{
|
||||||
ActionContainer *menu = ActionManager::actionContainer(Debugger::Constants::M_DEBUG_ANALYZER);
|
ActionContainer *menu = ActionManager::actionContainer(Debugger::Constants::M_DEBUG_ANALYZER);
|
||||||
ActionContainer *options = ActionManager::createMenu(Constants::CtfVisualizerMenuId);
|
ActionContainer *options = ActionManager::createMenu(Constants::CtfVisualizerMenuId);
|
||||||
options->menu()->setTitle(tr("Chrome Trace Format Viewer"));
|
options->menu()->setTitle(Tr::tr("Chrome Trace Format Viewer"));
|
||||||
menu->addMenu(options, Debugger::Constants::G_ANALYZER_REMOTE_TOOLS);
|
menu->addMenu(options, Debugger::Constants::G_ANALYZER_REMOTE_TOOLS);
|
||||||
options->menu()->setEnabled(true);
|
options->menu()->setEnabled(true);
|
||||||
|
|
||||||
const Core::Context globalContext(Core::Constants::C_GLOBAL);
|
const Core::Context globalContext(Core::Constants::C_GLOBAL);
|
||||||
|
|
||||||
m_loadJson.reset(new QAction(tr("Load JSON File"), options));
|
m_loadJson.reset(new QAction(Tr::tr("Load JSON File"), options));
|
||||||
Core::Command *command = Core::ActionManager::registerAction(m_loadJson.get(), Constants::CtfVisualizerTaskLoadJson,
|
Core::Command *command = Core::ActionManager::registerAction(m_loadJson.get(), Constants::CtfVisualizerTaskLoadJson,
|
||||||
globalContext);
|
globalContext);
|
||||||
connect(m_loadJson.get(), &QAction::triggered, this, &CtfVisualizerTool::loadJson);
|
connect(m_loadJson.get(), &QAction::triggered, this, &CtfVisualizerTool::loadJson);
|
||||||
@@ -61,7 +61,7 @@ CtfVisualizerTool::CtfVisualizerTool()
|
|||||||
m_perspective.setAboutToActivateCallback([this]() { createViews(); });
|
m_perspective.setAboutToActivateCallback([this]() { createViews(); });
|
||||||
|
|
||||||
m_restrictToThreadsButton->setIcon(Utils::Icons::FILTER.icon());
|
m_restrictToThreadsButton->setIcon(Utils::Icons::FILTER.icon());
|
||||||
m_restrictToThreadsButton->setToolTip(tr("Restrict to Threads"));
|
m_restrictToThreadsButton->setToolTip(Tr::tr("Restrict to Threads"));
|
||||||
m_restrictToThreadsButton->setPopupMode(QToolButton::InstantPopup);
|
m_restrictToThreadsButton->setPopupMode(QToolButton::InstantPopup);
|
||||||
m_restrictToThreadsButton->setProperty("noArrow", true);
|
m_restrictToThreadsButton->setProperty("noArrow", true);
|
||||||
m_restrictToThreadsButton->setMenu(m_restrictToThreadsMenu);
|
m_restrictToThreadsButton->setMenu(m_restrictToThreadsMenu);
|
||||||
@@ -76,11 +76,11 @@ CtfVisualizerTool::~CtfVisualizerTool() = default;
|
|||||||
void CtfVisualizerTool::createViews()
|
void CtfVisualizerTool::createViews()
|
||||||
{
|
{
|
||||||
m_traceView = new CtfVisualizerTraceView(nullptr, this);
|
m_traceView = new CtfVisualizerTraceView(nullptr, this);
|
||||||
m_traceView->setWindowTitle(tr("Timeline"));
|
m_traceView->setWindowTitle(Tr::tr("Timeline"));
|
||||||
|
|
||||||
QMenu *contextMenu = new QMenu(m_traceView);
|
QMenu *contextMenu = new QMenu(m_traceView);
|
||||||
contextMenu->addAction(m_loadJson.get());
|
contextMenu->addAction(m_loadJson.get());
|
||||||
connect(contextMenu->addAction(tr("Reset Zoom")), &QAction::triggered, this, [this](){
|
connect(contextMenu->addAction(Tr::tr("Reset Zoom")), &QAction::triggered, this, [this](){
|
||||||
m_zoomControl->setRange(m_zoomControl->traceStart(), m_zoomControl->traceEnd());
|
m_zoomControl->setRange(m_zoomControl->traceStart(), m_zoomControl->traceEnd());
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ void CtfVisualizerTool::createViews()
|
|||||||
m_perspective.addWindow(m_traceView, Utils::Perspective::OperationType::SplitVertical, nullptr);
|
m_perspective.addWindow(m_traceView, Utils::Perspective::OperationType::SplitVertical, nullptr);
|
||||||
|
|
||||||
m_statisticsView = new CtfStatisticsView(m_statisticsModel.get());
|
m_statisticsView = new CtfStatisticsView(m_statisticsModel.get());
|
||||||
m_statisticsView->setWindowTitle(tr("Statistics"));
|
m_statisticsView->setWindowTitle(Tr::tr("Statistics"));
|
||||||
connect(m_statisticsView, &CtfStatisticsView::eventTypeSelected, [this] (QString title)
|
connect(m_statisticsView, &CtfStatisticsView::eventTypeSelected, [this] (QString title)
|
||||||
{
|
{
|
||||||
int typeId = m_traceManager->getSelectionId(title.toStdString());
|
int typeId = m_traceManager->getSelectionId(title.toStdString());
|
||||||
@@ -148,8 +148,8 @@ void CtfVisualizerTool::loadJson()
|
|||||||
m_isLoading = true;
|
m_isLoading = true;
|
||||||
|
|
||||||
QString filename = QFileDialog::getOpenFileName(
|
QString filename = QFileDialog::getOpenFileName(
|
||||||
ICore::dialogParent(), tr("Load Chrome Trace Format File"),
|
ICore::dialogParent(), Tr::tr("Load Chrome Trace Format File"),
|
||||||
"", tr("JSON File (*.json)"));
|
"", Tr::tr("JSON File (*.json)"));
|
||||||
if (filename.isEmpty()) {
|
if (filename.isEmpty()) {
|
||||||
m_isLoading = false;
|
m_isLoading = false;
|
||||||
return;
|
return;
|
||||||
@@ -170,8 +170,8 @@ void CtfVisualizerTool::loadJson()
|
|||||||
// in main thread:
|
// in main thread:
|
||||||
if (m_traceManager->isEmpty()) {
|
if (m_traceManager->isEmpty()) {
|
||||||
QMessageBox::warning(Core::ICore::dialogParent(),
|
QMessageBox::warning(Core::ICore::dialogParent(),
|
||||||
tr("CTF Visualizer"),
|
Tr::tr("CTF Visualizer"),
|
||||||
tr("The file does not contain any trace data."));
|
Tr::tr("The file does not contain any trace data."));
|
||||||
} else {
|
} else {
|
||||||
m_traceManager->finalize();
|
m_traceManager->finalize();
|
||||||
m_perspective.select();
|
m_perspective.select();
|
||||||
@@ -189,7 +189,7 @@ void CtfVisualizerTool::loadJson()
|
|||||||
m_modelAggregator->moveToThread(thread);
|
m_modelAggregator->moveToThread(thread);
|
||||||
|
|
||||||
thread->start();
|
thread->start();
|
||||||
Core::ProgressManager::addTask(*task, tr("Loading CTF File"), CtfVisualizerTaskLoadJson);
|
Core::ProgressManager::addTask(*task, Tr::tr("Loading CTF File"), CtfVisualizerTaskLoadJson);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ctfvisualizerconstants.h"
|
#include "ctfvisualizerconstants.h"
|
||||||
|
#include "ctfvisualizertr.h"
|
||||||
|
|
||||||
#include <debugger/debuggermainwindow.h>
|
#include <debugger/debuggermainwindow.h>
|
||||||
#include <tracing/timelinemodelaggregator.h>
|
#include <tracing/timelinemodelaggregator.h>
|
||||||
@@ -45,7 +46,7 @@ private:
|
|||||||
void toggleThreadRestriction(QAction *action);
|
void toggleThreadRestriction(QAction *action);
|
||||||
|
|
||||||
Utils::Perspective m_perspective{Constants::CtfVisualizerPerspectiveId,
|
Utils::Perspective m_perspective{Constants::CtfVisualizerPerspectiveId,
|
||||||
tr("Chrome Trace Format Visualizer")};
|
Tr::tr("Chrome Trace Format Visualizer")};
|
||||||
|
|
||||||
bool m_isLoading;
|
bool m_isLoading;
|
||||||
QScopedPointer<QAction> m_loadJson;
|
QScopedPointer<QAction> m_loadJson;
|
||||||
|
|||||||
Reference in New Issue
Block a user