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:
@@ -46,13 +46,13 @@ CtfVisualizerTool::CtfVisualizerTool()
|
||||
{
|
||||
ActionContainer *menu = ActionManager::actionContainer(Debugger::Constants::M_DEBUG_ANALYZER);
|
||||
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);
|
||||
options->menu()->setEnabled(true);
|
||||
|
||||
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,
|
||||
globalContext);
|
||||
connect(m_loadJson.get(), &QAction::triggered, this, &CtfVisualizerTool::loadJson);
|
||||
@@ -61,7 +61,7 @@ CtfVisualizerTool::CtfVisualizerTool()
|
||||
m_perspective.setAboutToActivateCallback([this]() { createViews(); });
|
||||
|
||||
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->setProperty("noArrow", true);
|
||||
m_restrictToThreadsButton->setMenu(m_restrictToThreadsMenu);
|
||||
@@ -76,11 +76,11 @@ CtfVisualizerTool::~CtfVisualizerTool() = default;
|
||||
void CtfVisualizerTool::createViews()
|
||||
{
|
||||
m_traceView = new CtfVisualizerTraceView(nullptr, this);
|
||||
m_traceView->setWindowTitle(tr("Timeline"));
|
||||
m_traceView->setWindowTitle(Tr::tr("Timeline"));
|
||||
|
||||
QMenu *contextMenu = new QMenu(m_traceView);
|
||||
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());
|
||||
});
|
||||
|
||||
@@ -93,7 +93,7 @@ void CtfVisualizerTool::createViews()
|
||||
m_perspective.addWindow(m_traceView, Utils::Perspective::OperationType::SplitVertical, nullptr);
|
||||
|
||||
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)
|
||||
{
|
||||
int typeId = m_traceManager->getSelectionId(title.toStdString());
|
||||
@@ -148,8 +148,8 @@ void CtfVisualizerTool::loadJson()
|
||||
m_isLoading = true;
|
||||
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
ICore::dialogParent(), tr("Load Chrome Trace Format File"),
|
||||
"", tr("JSON File (*.json)"));
|
||||
ICore::dialogParent(), Tr::tr("Load Chrome Trace Format File"),
|
||||
"", Tr::tr("JSON File (*.json)"));
|
||||
if (filename.isEmpty()) {
|
||||
m_isLoading = false;
|
||||
return;
|
||||
@@ -170,8 +170,8 @@ void CtfVisualizerTool::loadJson()
|
||||
// in main thread:
|
||||
if (m_traceManager->isEmpty()) {
|
||||
QMessageBox::warning(Core::ICore::dialogParent(),
|
||||
tr("CTF Visualizer"),
|
||||
tr("The file does not contain any trace data."));
|
||||
Tr::tr("CTF Visualizer"),
|
||||
Tr::tr("The file does not contain any trace data."));
|
||||
} else {
|
||||
m_traceManager->finalize();
|
||||
m_perspective.select();
|
||||
@@ -189,7 +189,7 @@ void CtfVisualizerTool::loadJson()
|
||||
m_modelAggregator->moveToThread(thread);
|
||||
|
||||
thread->start();
|
||||
Core::ProgressManager::addTask(*task, tr("Loading CTF File"), CtfVisualizerTaskLoadJson);
|
||||
Core::ProgressManager::addTask(*task, Tr::tr("Loading CTF File"), CtfVisualizerTaskLoadJson);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user