QmlPreview: Tr::tr()

Change-Id: Ie80134c114da277ab16e4305c57ae35e37adafb2
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2023-02-08 15:01:31 +01:00
parent 4f55dbdd38
commit 2b46d1943c
5 changed files with 9 additions and 10 deletions

View File

@@ -2,7 +2,9 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "qmlpreviewplugin.h"
#include "qmlpreviewruncontrol.h"
#include "qmlpreviewtr.h"
#ifdef WITH_TESTS
#include "tests/qmlpreviewclient_test.h"
@@ -146,8 +148,8 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent)
Core::ActionContainer *menu = Core::ActionManager::actionContainer(
Constants::M_BUILDPROJECT);
QAction *action = new QAction(QmlPreviewPlugin::tr("QML Preview"), this);
action->setToolTip(QLatin1String("Preview changes to QML code live in your application."));
QAction *action = new QAction(Tr::tr("QML Preview"), this);
action->setToolTip(Tr::tr("Preview changes to QML code live in your application."));
action->setEnabled(SessionManager::startupProject() != nullptr);
connect(SessionManager::instance(), &SessionManager::startupProjectChanged, action,
&QAction::setEnabled);
@@ -166,7 +168,7 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent)
Constants::G_BUILD_RUN);
menu = Core::ActionManager::actionContainer(Constants::M_FILECONTEXT);
action = new QAction(QmlPreviewPlugin::tr("Preview File"), this);
action = new QAction(Tr::tr("Preview File"), this);
action->setEnabled(false);
connect(q, &QmlPreviewPlugin::runningPreviewsChanged,
action, [action](const QmlPreviewRunControlList &previews) {