forked from qt-creator/qt-creator
WebAssembly: Convert to using Tr::tr
Change-Id: I7fb420363884236ebd7eeb589a29a475f8911915 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -52186,7 +52186,7 @@ What do you want to do?</source>
|
|||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>WebAssembly::Internal::EmrunRunConfigurationFactory</name>
|
<name>WebAssembly</name>
|
||||||
<message>
|
<message>
|
||||||
<source>Effective emrun call:</source>
|
<source>Effective emrun call:</source>
|
||||||
<translation>Команда запуска emrun:</translation>
|
<translation>Команда запуска emrun:</translation>
|
||||||
@@ -52195,9 +52195,6 @@ What do you want to do?</source>
|
|||||||
<source>Launch with emrun</source>
|
<source>Launch with emrun</source>
|
||||||
<translation>Запустить через emrun</translation>
|
<translation>Запустить через emrun</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>WebAssembly::Internal::WebAssemblyDevice</name>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Web Browser</source>
|
<source>Web Browser</source>
|
||||||
<translation>Браузер</translation>
|
<translation>Браузер</translation>
|
||||||
@@ -52206,9 +52203,6 @@ What do you want to do?</source>
|
|||||||
<source>WebAssembly Runtime</source>
|
<source>WebAssembly Runtime</source>
|
||||||
<translation>Среда WebAssembly</translation>
|
<translation>Среда WebAssembly</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>WebAssembly::Internal::WebAssemblyToolChain</name>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Emscripten Compiler</source>
|
<source>Emscripten Compiler</source>
|
||||||
<translation>Компилятор Emscripten</translation>
|
<translation>Компилятор Emscripten</translation>
|
||||||
@@ -52217,9 +52211,6 @@ What do you want to do?</source>
|
|||||||
<source>WebAssembly</source>
|
<source>WebAssembly</source>
|
||||||
<translation>WebAssembly</translation>
|
<translation>WebAssembly</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>WebAssembly::Internal::WebBrowserSelectionAspect</name>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Web browser</source>
|
<source>Web browser</source>
|
||||||
<translation>Браузер</translation>
|
<translation>Браузер</translation>
|
||||||
@@ -52228,9 +52219,6 @@ What do you want to do?</source>
|
|||||||
<source>Web browser:</source>
|
<source>Web browser:</source>
|
||||||
<translation>Браузер:</translation>
|
<translation>Браузер:</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
|
||||||
<context>
|
|
||||||
<name>WebAssemblyPlugin</name>
|
|
||||||
<message>
|
<message>
|
||||||
<source>WebAssembly</source>
|
<source>WebAssembly</source>
|
||||||
<comment>Qt Version is meant for WebAssembly</comment>
|
<comment>Qt Version is meant for WebAssembly</comment>
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "webassemblyconstants.h"
|
#include "webassemblyconstants.h"
|
||||||
#include "webassemblydevice.h"
|
#include "webassemblydevice.h"
|
||||||
|
#include "webassemblytr.h"
|
||||||
|
|
||||||
#include <projectexplorer/runcontrol.h>
|
#include <projectexplorer/runcontrol.h>
|
||||||
|
|
||||||
@@ -16,7 +17,7 @@ WebAssemblyDevice::WebAssemblyDevice()
|
|||||||
{
|
{
|
||||||
setupId(IDevice::AutoDetected, Constants::WEBASSEMBLY_DEVICE_DEVICE_ID);
|
setupId(IDevice::AutoDetected, Constants::WEBASSEMBLY_DEVICE_DEVICE_ID);
|
||||||
setType(Constants::WEBASSEMBLY_DEVICE_TYPE);
|
setType(Constants::WEBASSEMBLY_DEVICE_TYPE);
|
||||||
const QString displayNameAndType = tr("Web Browser");
|
const QString displayNameAndType = Tr::tr("Web Browser");
|
||||||
setDefaultDisplayName(displayNameAndType);
|
setDefaultDisplayName(displayNameAndType);
|
||||||
setDisplayType(displayNameAndType);
|
setDisplayType(displayNameAndType);
|
||||||
setDeviceState(IDevice::DeviceStateUnknown);
|
setDeviceState(IDevice::DeviceStateUnknown);
|
||||||
@@ -26,13 +27,13 @@ WebAssemblyDevice::WebAssemblyDevice()
|
|||||||
|
|
||||||
IDevice::Ptr WebAssemblyDevice::create()
|
IDevice::Ptr WebAssemblyDevice::create()
|
||||||
{
|
{
|
||||||
return IDevice::Ptr(new WebAssemblyDevice);
|
return IDevicePtr(new WebAssemblyDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebAssemblyDeviceFactory::WebAssemblyDeviceFactory()
|
WebAssemblyDeviceFactory::WebAssemblyDeviceFactory()
|
||||||
: ProjectExplorer::IDeviceFactory(Constants::WEBASSEMBLY_DEVICE_TYPE)
|
: ProjectExplorer::IDeviceFactory(Constants::WEBASSEMBLY_DEVICE_TYPE)
|
||||||
{
|
{
|
||||||
setDisplayName(WebAssemblyDevice::tr("WebAssembly Runtime"));
|
setDisplayName(Tr::tr("WebAssembly Runtime"));
|
||||||
setCombinedIcon(":/webassembly/images/webassemblydevicesmall.png",
|
setCombinedIcon(":/webassembly/images/webassemblydevicesmall.png",
|
||||||
":/webassembly/images/webassemblydevice.png");
|
":/webassembly/images/webassemblydevice.png");
|
||||||
setConstructionFunction(&WebAssemblyDevice::create);
|
setConstructionFunction(&WebAssemblyDevice::create);
|
||||||
|
@@ -10,8 +10,6 @@ namespace Internal {
|
|||||||
|
|
||||||
class WebAssemblyDevice final : public ProjectExplorer::DesktopDevice
|
class WebAssemblyDevice final : public ProjectExplorer::DesktopDevice
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(WebAssembly::Internal::WebAssemblyDevice)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static ProjectExplorer::IDevice::Ptr create();
|
static ProjectExplorer::IDevice::Ptr create();
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#include "webassemblyoptionspage.h"
|
#include "webassemblyoptionspage.h"
|
||||||
#include "webassemblyqtversion.h"
|
#include "webassemblyqtversion.h"
|
||||||
#include "webassemblytoolchain.h"
|
#include "webassemblytoolchain.h"
|
||||||
|
#include "webassemblytr.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
@@ -24,8 +25,6 @@ namespace Internal {
|
|||||||
|
|
||||||
class WebAssemblyOptionsWidget : public Core::IOptionsPageWidget
|
class WebAssemblyOptionsWidget : public Core::IOptionsPageWidget
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(WebAssembly::Internal::WebAssemblyOptionsWidget)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WebAssemblyOptionsWidget();
|
WebAssemblyOptionsWidget();
|
||||||
|
|
||||||
@@ -47,18 +46,16 @@ WebAssemblyOptionsWidget::WebAssemblyOptionsWidget()
|
|||||||
auto mainLayout = new QVBoxLayout(this);
|
auto mainLayout = new QVBoxLayout(this);
|
||||||
|
|
||||||
{
|
{
|
||||||
auto pathChooserBox = new QGroupBox(tr("Emscripten SDK path:"));
|
auto pathChooserBox = new QGroupBox(Tr::tr("Emscripten SDK path:"));
|
||||||
pathChooserBox->setFlat(true);
|
pathChooserBox->setFlat(true);
|
||||||
auto layout = new QVBoxLayout(pathChooserBox);
|
auto layout = new QVBoxLayout(pathChooserBox);
|
||||||
auto instruction = new QLabel(
|
auto instruction = new QLabel(
|
||||||
tr("Select the root directory of an "
|
Tr::tr("Select the root directory of an installed %1. "
|
||||||
"<a href=\"https://emscripten.org/docs/getting_started/downloads.html\">"
|
"Ensure that the activated SDK version is compatible with the %2 "
|
||||||
"installed Emscripten SDK</a>. Ensure that the activated SDK version is "
|
"or %3 version that you plan to develop against.")
|
||||||
"compatible with the "
|
.arg(R"(<a href="https://emscripten.org/docs/getting_started/downloads.html">Emscripten SDK</a>)")
|
||||||
"<a href=\"https://doc.qt.io/qt-5/wasm.html#install-emscripten\">Qt 5</a> "
|
.arg(R"(<a href="https://doc.qt.io/qt-5/wasm.html#install-emscripten">Qt 5</a>)")
|
||||||
"or "
|
.arg(R"(<a href="https://doc.qt.io/qt-6/wasm.html#install-emscripten">Qt 6</a>)"));
|
||||||
"<a href=\"https://doc.qt.io/qt-6/wasm.html#install-emscripten\">Qt 6</a> "
|
|
||||||
"version that you plan to develop against."));
|
|
||||||
|
|
||||||
instruction->setOpenExternalLinks(true);
|
instruction->setOpenExternalLinks(true);
|
||||||
instruction->setWordWrap(true);
|
instruction->setWordWrap(true);
|
||||||
@@ -78,7 +75,7 @@ WebAssemblyOptionsWidget::WebAssemblyOptionsWidget()
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
m_emSdkEnvGroupBox = new QGroupBox(tr("Emscripten SDK environment:"));
|
m_emSdkEnvGroupBox = new QGroupBox(Tr::tr("Emscripten SDK environment:"));
|
||||||
m_emSdkEnvGroupBox->setFlat(true);
|
m_emSdkEnvGroupBox->setFlat(true);
|
||||||
m_emSdkEnvGroupBox->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::MinimumExpanding);
|
m_emSdkEnvGroupBox->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::MinimumExpanding);
|
||||||
auto layout = new QVBoxLayout(m_emSdkEnvGroupBox);
|
auto layout = new QVBoxLayout(m_emSdkEnvGroupBox);
|
||||||
@@ -95,8 +92,8 @@ WebAssemblyOptionsWidget::WebAssemblyOptionsWidget()
|
|||||||
const QString minimumSupportedQtVersion =
|
const QString minimumSupportedQtVersion =
|
||||||
WebAssemblyQtVersion::minimumSupportedQtVersion().toString();
|
WebAssemblyQtVersion::minimumSupportedQtVersion().toString();
|
||||||
m_qtVersionDisplay = new InfoLabel(
|
m_qtVersionDisplay = new InfoLabel(
|
||||||
tr("Note: %1 supports Qt %2 for WebAssembly and higher. "
|
Tr::tr("Note: %1 supports Qt %2 for WebAssembly and higher. "
|
||||||
"Your installed lower version(s) are not supported.")
|
"Your installed lower Qt version(s) are not supported.")
|
||||||
.arg(Core::ICore::versionString(), minimumSupportedQtVersion),
|
.arg(Core::ICore::versionString(), minimumSupportedQtVersion),
|
||||||
InfoLabel::Warning);
|
InfoLabel::Warning);
|
||||||
m_qtVersionDisplay->setElideMode(Qt::ElideNone);
|
m_qtVersionDisplay->setElideMode(Qt::ElideNone);
|
||||||
@@ -110,9 +107,10 @@ static QString environmentDisplay(const FilePath &sdkRoot)
|
|||||||
Environment env;
|
Environment env;
|
||||||
WebAssemblyEmSdk::addToEnvironment(sdkRoot, env);
|
WebAssemblyEmSdk::addToEnvironment(sdkRoot, env);
|
||||||
QString result;
|
QString result;
|
||||||
result.append(WebAssemblyOptionsWidget::tr("<h4>Adding directories to PATH:</h4>"));
|
auto h4 = [](const QString &text) { return QString("<h4>" + text + "</h4>"); };
|
||||||
|
result.append(h4(Tr::tr("Adding directories to PATH:")));
|
||||||
result.append(env.value("PATH").replace(OsSpecificAspects::pathListSeparator(sdkRoot.osType()), "<br/>"));
|
result.append(env.value("PATH").replace(OsSpecificAspects::pathListSeparator(sdkRoot.osType()), "<br/>"));
|
||||||
result.append(WebAssemblyOptionsWidget::tr("<h4>Setting environment variables:</h4>"));
|
result.append(h4(Tr::tr("Setting environment variables:")));
|
||||||
for (const QString &envVar : env.toStringList()) {
|
for (const QString &envVar : env.toStringList()) {
|
||||||
if (!envVar.startsWith("PATH")) // Path was already printed out above
|
if (!envVar.startsWith("PATH")) // Path was already printed out above
|
||||||
result.append(envVar + "<br/>");
|
result.append(envVar + "<br/>");
|
||||||
@@ -135,12 +133,15 @@ void WebAssemblyOptionsWidget::updateStatus()
|
|||||||
const QVersionNumber minVersion = WebAssemblyToolChain::minimumSupportedEmSdkVersion();
|
const QVersionNumber minVersion = WebAssemblyToolChain::minimumSupportedEmSdkVersion();
|
||||||
const bool versionTooLow = sdkVersion < minVersion;
|
const bool versionTooLow = sdkVersion < minVersion;
|
||||||
m_emSdkVersionDisplay->setType(versionTooLow ? InfoLabel::NotOk : InfoLabel::Ok);
|
m_emSdkVersionDisplay->setType(versionTooLow ? InfoLabel::NotOk : InfoLabel::Ok);
|
||||||
|
auto bold = [](const QString &text) { return QString("<b>" + text + "</b>"); };
|
||||||
m_emSdkVersionDisplay->setText(
|
m_emSdkVersionDisplay->setText(
|
||||||
versionTooLow ? tr("The activated version <b>%1</b> is not supported by %2."
|
versionTooLow ? Tr::tr("The activated version %1 is not supported by %2. "
|
||||||
"<br/>Activate version <b>%3</b> or higher.")
|
"Activate version %3 or higher.")
|
||||||
.arg(sdkVersion.toString(), Core::ICore::versionString(),
|
.arg(bold(sdkVersion.toString()))
|
||||||
minVersion.toString())
|
.arg(bold(Core::ICore::versionString()))
|
||||||
: tr("Activated version: <b>%1</b>").arg(sdkVersion.toString()));
|
.arg(bold(minVersion.toString()))
|
||||||
|
: Tr::tr("Activated version: %1")
|
||||||
|
.arg(bold(sdkVersion.toString())));
|
||||||
m_emSdkEnvDisplay->setText(environmentDisplay(sdkPath));
|
m_emSdkEnvDisplay->setText(environmentDisplay(sdkPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +166,7 @@ void WebAssemblyOptionsWidget::apply()
|
|||||||
WebAssemblyOptionsPage::WebAssemblyOptionsPage()
|
WebAssemblyOptionsPage::WebAssemblyOptionsPage()
|
||||||
{
|
{
|
||||||
setId(Id(Constants::SETTINGS_ID));
|
setId(Id(Constants::SETTINGS_ID));
|
||||||
setDisplayName(WebAssemblyOptionsWidget::tr("WebAssembly"));
|
setDisplayName(Tr::tr("WebAssembly"));
|
||||||
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
|
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
|
||||||
setWidgetCreator([] { return new WebAssemblyOptionsWidget; });
|
setWidgetCreator([] { return new WebAssemblyOptionsWidget; });
|
||||||
}
|
}
|
||||||
|
@@ -1,13 +1,14 @@
|
|||||||
// Copyright (C) 2020 The Qt Company Ltd.
|
// Copyright (C) 2020 The Qt Company Ltd.
|
||||||
// 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 "webassemblyplugin.h"
|
|
||||||
#include "webassemblyconstants.h"
|
#include "webassemblyconstants.h"
|
||||||
#include "webassemblydevice.h"
|
#include "webassemblydevice.h"
|
||||||
#include "webassemblyoptionspage.h"
|
#include "webassemblyoptionspage.h"
|
||||||
|
#include "webassemblyplugin.h"
|
||||||
#include "webassemblyqtversion.h"
|
#include "webassemblyqtversion.h"
|
||||||
#include "webassemblyrunconfiguration.h"
|
#include "webassemblyrunconfiguration.h"
|
||||||
#include "webassemblytoolchain.h"
|
#include "webassemblytoolchain.h"
|
||||||
|
#include "webassemblytr.h"
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
@@ -83,10 +84,10 @@ void WebAssemblyPlugin::askUserAboutEmSdkSetup()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
InfoBarEntry info(setupWebAssemblyEmSdk,
|
InfoBarEntry info(setupWebAssemblyEmSdk,
|
||||||
tr("Setup Emscripten SDK for WebAssembly? "
|
Tr::tr("Setup Emscripten SDK for WebAssembly? "
|
||||||
"To do it later, select Edit > Preferences > Devices > WebAssembly."),
|
"To do it later, select Edit > Preferences > Devices > WebAssembly."),
|
||||||
InfoBarEntry::GlobalSuppression::Enabled);
|
InfoBarEntry::GlobalSuppression::Enabled);
|
||||||
info.addCustomButton(tr("Setup Emscripten SDK"), [setupWebAssemblyEmSdk] {
|
info.addCustomButton(Tr::tr("Setup Emscripten SDK"), [setupWebAssemblyEmSdk] {
|
||||||
ICore::infoBar()->removeInfo(setupWebAssemblyEmSdk);
|
ICore::infoBar()->removeInfo(setupWebAssemblyEmSdk);
|
||||||
QTimer::singleShot(0, []() { ICore::showOptionsDialog(Constants::SETTINGS_ID); });
|
QTimer::singleShot(0, []() { ICore::showOptionsDialog(Constants::SETTINGS_ID); });
|
||||||
});
|
});
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "webassemblyconstants.h"
|
#include "webassemblyconstants.h"
|
||||||
#include "webassemblyqtversion.h"
|
#include "webassemblyqtversion.h"
|
||||||
|
#include "webassemblytr.h"
|
||||||
|
|
||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
@@ -29,8 +30,7 @@ WebAssemblyQtVersion::WebAssemblyQtVersion() = default;
|
|||||||
|
|
||||||
QString WebAssemblyQtVersion::description() const
|
QString WebAssemblyQtVersion::description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("WebAssemblyPlugin", "WebAssembly",
|
return Tr::tr("WebAssembly", "Qt Version is meant for WebAssembly");
|
||||||
"Qt Version is meant for WebAssembly");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<Id> WebAssemblyQtVersion::targetDeviceTypes() const
|
QSet<Id> WebAssemblyQtVersion::targetDeviceTypes() const
|
||||||
@@ -59,7 +59,7 @@ QString WebAssemblyQtVersion::invalidReason() const
|
|||||||
if (!baseReason.isEmpty())
|
if (!baseReason.isEmpty())
|
||||||
return baseReason;
|
return baseReason;
|
||||||
|
|
||||||
return tr("%1 does not support Qt for WebAssembly below version %2.")
|
return Tr::tr("%1 does not support Qt for WebAssembly below version %2.")
|
||||||
.arg(Core::ICore::versionString())
|
.arg(Core::ICore::versionString())
|
||||||
.arg(minimumSupportedQtVersion().toString());
|
.arg(minimumSupportedQtVersion().toString());
|
||||||
}
|
}
|
||||||
|
@@ -11,8 +11,6 @@ namespace Internal {
|
|||||||
|
|
||||||
class WebAssemblyQtVersion : public QtSupport::QtVersion
|
class WebAssemblyQtVersion : public QtSupport::QtVersion
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(WebAssembly::Internal::WebAssemblyQtVersion)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WebAssemblyQtVersion();
|
WebAssemblyQtVersion();
|
||||||
|
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
// Copyright (C) 2020 The Qt Company Ltd.
|
// Copyright (C) 2020 The Qt Company Ltd.
|
||||||
// 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 "webassemblyrunconfigurationaspects.h"
|
|
||||||
#include "webassemblyrunconfiguration.h"
|
|
||||||
#include "webassemblyconstants.h"
|
#include "webassemblyconstants.h"
|
||||||
|
#include "webassemblyrunconfiguration.h"
|
||||||
|
#include "webassemblyrunconfigurationaspects.h"
|
||||||
|
#include "webassemblytr.h"
|
||||||
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/buildsystem.h>
|
#include <projectexplorer/buildsystem.h>
|
||||||
@@ -73,7 +74,7 @@ public:
|
|||||||
auto webBrowserAspect = addAspect<WebBrowserSelectionAspect>(target);
|
auto webBrowserAspect = addAspect<WebBrowserSelectionAspect>(target);
|
||||||
|
|
||||||
auto effectiveEmrunCall = addAspect<StringAspect>();
|
auto effectiveEmrunCall = addAspect<StringAspect>();
|
||||||
effectiveEmrunCall->setLabelText(EmrunRunConfigurationFactory::tr("Effective emrun call:"));
|
effectiveEmrunCall->setLabelText(Tr::tr("Effective emrun call:"));
|
||||||
effectiveEmrunCall->setDisplayStyle(StringAspect::TextEditDisplay);
|
effectiveEmrunCall->setDisplayStyle(StringAspect::TextEditDisplay);
|
||||||
effectiveEmrunCall->setReadOnly(true);
|
effectiveEmrunCall->setReadOnly(true);
|
||||||
|
|
||||||
|
@@ -11,8 +11,6 @@ namespace Internal {
|
|||||||
|
|
||||||
class EmrunRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory
|
class EmrunRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(WebAssembly::Internal::EmrunRunConfigurationFactory)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EmrunRunConfigurationFactory();
|
EmrunRunConfigurationFactory();
|
||||||
};
|
};
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
// 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 "webassemblyrunconfigurationaspects.h"
|
#include "webassemblyrunconfigurationaspects.h"
|
||||||
|
#include "webassemblytr.h"
|
||||||
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/runcontrol.h>
|
#include <projectexplorer/runcontrol.h>
|
||||||
@@ -41,7 +42,8 @@ static WebBrowserEntries parseEmrunOutput(const QByteArray &output)
|
|||||||
|
|
||||||
static WebBrowserEntries emrunBrowsers(ProjectExplorer::Target *target)
|
static WebBrowserEntries emrunBrowsers(ProjectExplorer::Target *target)
|
||||||
{
|
{
|
||||||
WebBrowserEntries result{{{}, WebBrowserSelectionAspect::tr("Default Browser")}};
|
WebBrowserEntries result;
|
||||||
|
result.append(qMakePair(QString(), Tr::tr("Default Browser")));
|
||||||
if (auto bc = target->activeBuildConfiguration()) {
|
if (auto bc = target->activeBuildConfiguration()) {
|
||||||
const Utils::Environment environment = bc->environment();
|
const Utils::Environment environment = bc->environment();
|
||||||
const Utils::FilePath emrunPath = environment.searchInPath("emrun");
|
const Utils::FilePath emrunPath = environment.searchInPath("emrun");
|
||||||
@@ -64,7 +66,7 @@ WebBrowserSelectionAspect::WebBrowserSelectionAspect(ProjectExplorer::Target *ta
|
|||||||
const int defaultIndex = qBound(0, m_availableBrowsers.count() - 1, 1);
|
const int defaultIndex = qBound(0, m_availableBrowsers.count() - 1, 1);
|
||||||
m_currentBrowser = m_availableBrowsers.at(defaultIndex).first;
|
m_currentBrowser = m_availableBrowsers.at(defaultIndex).first;
|
||||||
}
|
}
|
||||||
setDisplayName(tr("Web Browser"));
|
setDisplayName(Tr::tr("Web Browser"));
|
||||||
setId("WebBrowserAspect");
|
setId("WebBrowserAspect");
|
||||||
setSettingsKey("RunConfiguration.WebBrowser");
|
setSettingsKey("RunConfiguration.WebBrowser");
|
||||||
|
|
||||||
@@ -82,7 +84,7 @@ void WebBrowserSelectionAspect::addToLayout(LayoutBuilder &builder)
|
|||||||
m_currentBrowser = m_webBrowserComboBox->currentData().toString();
|
m_currentBrowser = m_webBrowserComboBox->currentData().toString();
|
||||||
emit changed();
|
emit changed();
|
||||||
});
|
});
|
||||||
builder.addItems({tr("Web browser:"), m_webBrowserComboBox});
|
builder.addItems({Tr::tr("Web browser:"), m_webBrowserComboBox});
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebBrowserSelectionAspect::fromMap(const QVariantMap &map)
|
void WebBrowserSelectionAspect::fromMap(const QVariantMap &map)
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
// Copyright (C) 2020 The Qt Company Ltd.
|
// Copyright (C) 2020 The Qt Company Ltd.
|
||||||
// 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 "webassemblytoolchain.h"
|
|
||||||
#include "webassemblyconstants.h"
|
#include "webassemblyconstants.h"
|
||||||
#include "webassemblyemsdk.h"
|
#include "webassemblyemsdk.h"
|
||||||
|
#include "webassemblytoolchain.h"
|
||||||
|
#include "webassemblytr.h"
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||||
#include <projectexplorer/kitmanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
@@ -58,7 +59,7 @@ WebAssemblyToolChain::WebAssemblyToolChain() :
|
|||||||
{
|
{
|
||||||
setSupportedAbis({toolChainAbi()});
|
setSupportedAbis({toolChainAbi()});
|
||||||
setTargetAbi(toolChainAbi());
|
setTargetAbi(toolChainAbi());
|
||||||
setTypeDisplayName(tr("Emscripten Compiler"));
|
setTypeDisplayName(Tr::tr("Emscripten Compiler"));
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePath WebAssemblyToolChain::makeCommand(const Environment &environment) const
|
FilePath WebAssemblyToolChain::makeCommand(const Environment &environment) const
|
||||||
@@ -117,7 +118,7 @@ static Toolchains doAutoDetect(const ToolchainDetector &detector)
|
|||||||
const FilePath scriptFile = sdk.withNewPath(script).searchInDirectories(env.path());
|
const FilePath scriptFile = sdk.withNewPath(script).searchInDirectories(env.path());
|
||||||
toolChain->setCompilerCommand(scriptFile);
|
toolChain->setCompilerCommand(scriptFile);
|
||||||
|
|
||||||
const QString displayName = WebAssemblyToolChain::tr("Emscripten Compiler %1 for %2")
|
const QString displayName = Tr::tr("Emscripten Compiler %1 for %2")
|
||||||
.arg(toolChain->version(), QLatin1String(cLanguage ? "C" : "C++"));
|
.arg(toolChain->version(), QLatin1String(cLanguage ? "C" : "C++"));
|
||||||
toolChain->setDisplayName(displayName);
|
toolChain->setDisplayName(displayName);
|
||||||
result.append(toolChain);
|
result.append(toolChain);
|
||||||
@@ -159,7 +160,7 @@ bool WebAssemblyToolChain::areToolChainsRegistered()
|
|||||||
|
|
||||||
WebAssemblyToolChainFactory::WebAssemblyToolChainFactory()
|
WebAssemblyToolChainFactory::WebAssemblyToolChainFactory()
|
||||||
{
|
{
|
||||||
setDisplayName(WebAssemblyToolChain::tr("Emscripten"));
|
setDisplayName(Tr::tr("Emscripten"));
|
||||||
setSupportedToolChainType(Constants::WEBASSEMBLY_TOOLCHAIN_TYPEID);
|
setSupportedToolChainType(Constants::WEBASSEMBLY_TOOLCHAIN_TYPEID);
|
||||||
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
|
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
|
||||||
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
||||||
|
@@ -12,8 +12,6 @@ namespace Internal {
|
|||||||
|
|
||||||
class WebAssemblyToolChain final : public ProjectExplorer::GccToolChain
|
class WebAssemblyToolChain final : public ProjectExplorer::GccToolChain
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(WebAssembly::Internal::WebAssemblyToolChain)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WebAssemblyToolChain();
|
WebAssemblyToolChain();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user