Meson: Convert to Tr::tr

Change-Id: I37e8a8c559464f7d55e17a5ca08e8d8d9760a4d6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2022-10-10 09:14:04 +02:00
parent 63faccdb7c
commit 9e2ec17f36
31 changed files with 104 additions and 278 deletions

View File

@@ -47917,7 +47917,7 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
</message> </message>
</context> </context>
<context> <context>
<name>MesonBuildSettingsWidget</name> <name>Meson</name>
<message> <message>
<source>Apply Configuration Changes</source> <source>Apply Configuration Changes</source>
<translation>Konfigurationsänderungen anwenden</translation> <translation>Konfigurationsänderungen anwenden</translation>
@@ -47926,9 +47926,6 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
<source>Filter</source> <source>Filter</source>
<translation>Filter</translation> <translation>Filter</translation>
</message> </message>
</context>
<context>
<name>MesonBuildStepConfigWidget</name>
<message> <message>
<source>Tool arguments:</source> <source>Tool arguments:</source>
<translation>Toolparameter:</translation> <translation>Toolparameter:</translation>
@@ -48420,7 +48417,7 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
</message> </message>
</context> </context>
<context> <context>
<name>MesonProjectManager::Internal::MesonActionsManager</name> <name>Meson</name>
<message> <message>
<source>Configure</source> <source>Configure</source>
<translation>Konfigurieren</translation> <translation>Konfigurieren</translation>
@@ -48433,24 +48430,15 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
<source>Build &quot;%1&quot;</source> <source>Build &quot;%1&quot;</source>
<translation>&quot;%1&quot; erstellen</translation> <translation>&quot;%1&quot; erstellen</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::MesonBuildSettingsWidget</name>
<message> <message>
<source>Meson</source> <source>Meson</source>
<translation>Meson</translation> <translation>Meson</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::MesonBuildStepConfigWidget</name>
<message> <message>
<source>Build</source> <source>Build</source>
<comment>MesonProjectManager::MesonBuildStepConfigWidget display name.</comment> <comment>MesonProjectManager::MesonBuildStepConfigWidget display name.</comment>
<translation>Erstellen</translation> <translation>Erstellen</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::BuidOptionsModel</name>
<message> <message>
<source>Key</source> <source>Key</source>
<translation>Schlüssel</translation> <translation>Schlüssel</translation>
@@ -48459,9 +48447,6 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
<source>Value</source> <source>Value</source>
<translation>Wert</translation> <translation>Wert</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::MesonProcess</name>
<message> <message>
<source>Configuring &quot;%1&quot;.</source> <source>Configuring &quot;%1&quot;.</source>
<translation>Konfiguriere &quot;%1&quot;</translation> <translation>Konfiguriere &quot;%1&quot;</translation>
@@ -48502,48 +48487,18 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
<source>Executable does not exist: %1</source> <source>Executable does not exist: %1</source>
<translation>Ausführbare Datei existiert nicht: %1</translation> <translation>Ausführbare Datei existiert nicht: %1</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::MesonProject</name>
<message> <message>
<source>No compilers set in kit.</source> <source>No compilers set in kit.</source>
<translation>Im Kit sind keine Compiler eingerichtet.</translation> <translation>Im Kit sind keine Compiler eingerichtet.</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::NinjaBuildStep</name>
<message>
<source>Meson</source>
<translation>Meson</translation>
</message>
</context>
<context>
<name>MesonProjectManager::Internal::GeneralSettingsPage</name>
<message> <message>
<source>General</source> <source>General</source>
<translation>Allgemein</translation> <translation>Allgemein</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::MesonToolKitAspect</name>
<message>
<source>Meson</source>
<translation>Meson</translation>
</message>
<message> <message>
<source>Unconfigured</source> <source>Unconfigured</source>
<translation>Nicht konfiguriert</translation> <translation>Nicht konfiguriert</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::NinjaToolKitAspect</name>
<message>
<source>Unconfigured</source>
<translation>Nicht konfiguriert</translation>
</message>
</context>
<context>
<name>MesonProjectManager::Internal::ToolsSettingsPage</name>
<message> <message>
<source>Name</source> <source>Name</source>
<translation>Name</translation> <translation>Name</translation>
@@ -48573,13 +48528,6 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
<translation>Kopie von %1</translation> <translation>Kopie von %1</translation>
</message> </message>
</context> </context>
<context>
<name>MesonProjectManager::MesonToolManager</name>
<message>
<source>Meson</source>
<translation>Meson</translation>
</message>
</context>
<context> <context>
<name>Nim::NimToolChain</name> <name>Nim::NimToolChain</name>
<message> <message>

View File

@@ -45835,7 +45835,7 @@ Output:
</message> </message>
</context> </context>
<context> <context>
<name>MesonProjectManager::Internal::MesonBuildSettingsWidget</name> <name>Meson</name>
<message> <message>
<source>Apply Configuration Changes</source> <source>Apply Configuration Changes</source>
<translation></translation> <translation></translation>
@@ -45844,9 +45844,6 @@ Output:
<source>Filter</source> <source>Filter</source>
<translation></translation> <translation></translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::ToolItemSettings</name>
<message> <message>
<source>Name:</source> <source>Name:</source>
<translation>:</translation> <translation>:</translation>
@@ -45855,9 +45852,6 @@ Output:
<source>Path:</source> <source>Path:</source>
<translation>:</translation> <translation>:</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::ToolsSettingsWidget</name>
<message> <message>
<source>Clone</source> <source>Clone</source>
<translation></translation> <translation></translation>
@@ -49749,7 +49743,7 @@ Stepping into the module or setting breakpoints by file and line is expected to
</message> </message>
</context> </context>
<context> <context>
<name>MesonProjectManager::Internal::MesonActionsManager</name> <name>Meson</name>
<message> <message>
<source>Configure</source> <source>Configure</source>
<translation></translation> <translation></translation>
@@ -49762,16 +49756,10 @@ Stepping into the module or setting breakpoints by file and line is expected to
<source>Build &quot;%1&quot;</source> <source>Build &quot;%1&quot;</source>
<translation>&quot;%1&quot; </translation> <translation>&quot;%1&quot; </translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::BuidOptionsModel</name>
<message> <message>
<source>Value</source> <source>Value</source>
<translation></translation> <translation></translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::MesonProcess</name>
<message> <message>
<source>Process timed out.</source> <source>Process timed out.</source>
<translation></translation> <translation></translation>
@@ -49780,9 +49768,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
<source>Executable does not exist: %1</source> <source>Executable does not exist: %1</source>
<translation> : %1</translation> <translation> : %1</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::NinjaBuildStep</name>
<message> <message>
<source>Build</source> <source>Build</source>
<comment>MesonProjectManager::MesonBuildStepConfigWidget display name.</comment> <comment>MesonProjectManager::MesonBuildStepConfigWidget display name.</comment>
@@ -49796,30 +49781,14 @@ Stepping into the module or setting breakpoints by file and line is expected to
<source>Targets:</source> <source>Targets:</source>
<translation>:</translation> <translation>:</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::GeneralSettingsPage</name>
<message> <message>
<source>General</source> <source>General</source>
<translation></translation> <translation></translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::MesonToolKitAspect</name>
<message> <message>
<source>Unconfigured</source> <source>Unconfigured</source>
<translation></translation> <translation></translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::NinjaToolKitAspect</name>
<message>
<source>Unconfigured</source>
<translation></translation>
</message>
</context>
<context>
<name>MesonProjectManager::Internal::ToolsSettingsPage</name>
<message> <message>
<source>Name</source> <source>Name</source>
<translation></translation> <translation></translation>

View File

@@ -26527,7 +26527,7 @@ Error: %5</translation>
</message> </message>
</context> </context>
<context> <context>
<name>MesonBuildStepConfigWidget</name> <name>Meson</name>
<message> <message>
<source>Form</source> <source>Form</source>
<translation></translation> <translation></translation>
@@ -26540,9 +26540,6 @@ Error: %5</translation>
<source>Targets:</source> <source>Targets:</source>
<translation>Цели:</translation> <translation>Цели:</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::BuidOptionsModel</name>
<message> <message>
<source>Key</source> <source>Key</source>
<translation>Ключ</translation> <translation>Ключ</translation>
@@ -26551,20 +26548,10 @@ Error: %5</translation>
<source>Value</source> <source>Value</source>
<translation>Значение</translation> <translation>Значение</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::GeneralSettingsPage</name>
<message> <message>
<source>General</source> <source>General</source>
<translation>Основное</translation> <translation>Основное</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::GeneralSettingsWidget</name>
<message>
<source>Form</source>
<translation></translation>
</message>
<message> <message>
<source>Automatically run Meson when needed.</source> <source>Automatically run Meson when needed.</source>
<translation>Запускать Meson по необходимости.</translation> <translation>Запускать Meson по необходимости.</translation>
@@ -26581,9 +26568,6 @@ Error: %5</translation>
<source>Ninja verbose mode</source> <source>Ninja verbose mode</source>
<translation>Ninja в подробном режиме</translation> <translation>Ninja в подробном режиме</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::MesonActionsManager</name>
<message> <message>
<source>Configure</source> <source>Configure</source>
<translation>Configure</translation> <translation>Configure</translation>
@@ -26596,17 +26580,10 @@ Error: %5</translation>
<source>Build &quot;%1&quot;</source> <source>Build &quot;%1&quot;</source>
<translation>Сборка «%1»</translation> <translation>Сборка «%1»</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::MesonBuildSettingsWidget</name>
<message> <message>
<source>Meson</source> <source>Meson</source>
<translation>Meson</translation> <translation>Meson</translation>
</message> </message>
<message>
<source>Form</source>
<translation></translation>
</message>
<message> <message>
<source>Apply Configuration Changes</source> <source>Apply Configuration Changes</source>
<translation>Применить изменения</translation> <translation>Применить изменения</translation>
@@ -26625,17 +26602,11 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
<source>Filter</source> <source>Filter</source>
<translation>Фильтр</translation> <translation>Фильтр</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::MesonBuildStepConfigWidget</name>
<message> <message>
<source>Build</source> <source>Build</source>
<comment>MesonProjectManager::MesonBuildStepConfigWidget display name.</comment> <comment>MesonProjectManager::MesonBuildStepConfigWidget display name.</comment>
<translation>Сборка</translation> <translation>Сборка</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::MesonProcess</name>
<message> <message>
<source>Configuring &quot;%1&quot;.</source> <source>Configuring &quot;%1&quot;.</source>
<translation>Настройка «%1».</translation> <translation>Настройка «%1».</translation>
@@ -26680,9 +26651,6 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
<source>Command is not executable: %1</source> <source>Command is not executable: %1</source>
<translation>Команда не запускается: %1</translation> <translation>Команда не запускается: %1</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::MesonProject</name>
<message> <message>
<source>No Meson tool set.</source> <source>No Meson tool set.</source>
<translation>Программа Meson не указана.</translation> <translation>Программа Meson не указана.</translation>
@@ -26695,9 +26663,6 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
<source>No compilers set in kit.</source> <source>No compilers set in kit.</source>
<translation>У комплекта не заданы компиляторы.</translation> <translation>У комплекта не заданы компиляторы.</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::MesonToolKitAspect</name>
<message> <message>
<source>Meson Tool</source> <source>Meson Tool</source>
<translation>Утилита Meson</translation> <translation>Утилита Meson</translation>
@@ -26710,28 +26675,14 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
<source>Cannot validate this meson executable.</source> <source>Cannot validate this meson executable.</source>
<translation>Невозможно проверить эту программу Meson.</translation> <translation>Невозможно проверить эту программу Meson.</translation>
</message> </message>
<message>
<source>Meson</source>
<translation>Meson</translation>
</message>
<message> <message>
<source>Unconfigured</source> <source>Unconfigured</source>
<translation>Не настроено</translation> <translation>Не настроено</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::NinjaBuildStep</name>
<message> <message>
<source>Meson Build</source> <source>Meson Build</source>
<translation>Сборка Meson</translation> <translation>Сборка Meson</translation>
</message> </message>
<message>
<source>Meson</source>
<translation>Meson</translation>
</message>
</context>
<context>
<name>MesonProjectManager::Internal::NinjaToolKitAspect</name>
<message> <message>
<source>Ninja Tool</source> <source>Ninja Tool</source>
<translation>Утилита Ninja</translation> <translation>Утилита Ninja</translation>
@@ -26748,17 +26699,6 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
<source>Ninja</source> <source>Ninja</source>
<translation>Ninja</translation> <translation>Ninja</translation>
</message> </message>
<message>
<source>Unconfigured</source>
<translation>Не настроено</translation>
</message>
</context>
<context>
<name>MesonProjectManager::Internal::ToolItemSettings</name>
<message>
<source>Form</source>
<translation></translation>
</message>
<message> <message>
<source>Name:</source> <source>Name:</source>
<translation>Имя:</translation> <translation>Имя:</translation>
@@ -26767,9 +26707,6 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
<source>Path:</source> <source>Path:</source>
<translation>Путь:</translation> <translation>Путь:</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::ToolTreeItem</name>
<message> <message>
<source>Meson executable path does not exist.</source> <source>Meson executable path does not exist.</source>
<translation>Не найден путь к программе Meson.</translation> <translation>Не найден путь к программе Meson.</translation>
@@ -26782,9 +26719,6 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
<source>Meson executable path is not executable.</source> <source>Meson executable path is not executable.</source>
<translation>Путь к программе Meson не исполняемый.</translation> <translation>Путь к программе Meson не исполняемый.</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::ToolsSettingsPage</name>
<message> <message>
<source>Name</source> <source>Name</source>
<translation>Имя</translation> <translation>Имя</translation>
@@ -26821,13 +26755,6 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
<source>Cannot get tool version.</source> <source>Cannot get tool version.</source>
<translation>Не удалось получить версию инструмента.</translation> <translation>Не удалось получить версию инструмента.</translation>
</message> </message>
</context>
<context>
<name>MesonProjectManager::Internal::ToolsSettingsWidget</name>
<message>
<source>Form</source>
<translation></translation>
</message>
<message> <message>
<source>Add</source> <source>Add</source>
<translation>Добавить</translation> <translation>Добавить</translation>
@@ -26849,13 +26776,6 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
<translation>Сделать по умолчанию</translation> <translation>Сделать по умолчанию</translation>
</message> </message>
</context> </context>
<context>
<name>MesonProjectManager::MesonToolManager</name>
<message>
<source>Meson</source>
<translation>Meson</translation>
</message>
</context>
<context> <context>
<name>MimeTypeDialog</name> <name>MimeTypeDialog</name>
<message> <message>

View File

@@ -13,7 +13,6 @@ namespace Internal {
class RegexHighlighter : public QSyntaxHighlighter class RegexHighlighter : public QSyntaxHighlighter
{ {
Q_OBJECT
const QRegularExpression m_regex{R"('([^']+)'+|([^', ]+)[, ]*)"}; const QRegularExpression m_regex{R"('([^']+)'+|([^', ]+)[, ]*)"};
QTextCharFormat m_format; QTextCharFormat m_format;

View File

@@ -3,7 +3,7 @@
#pragma once #pragma once
#include "mesoninfoparser.h" #include "buildoptions.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/treemodel.h> #include <utils/treemodel.h>
@@ -66,6 +66,7 @@ public:
} }
inline BuildOption::Type type() { return m_currentValue->type(); } inline BuildOption::Type type() { return m_currentValue->type(); }
}; };
using CancellableOptionsList = std::vector<std::unique_ptr<CancellableOption>>; using CancellableOptionsList = std::vector<std::unique_ptr<CancellableOption>>;
class BuidOptionsModel final : public Utils::TreeModel<> class BuidOptionsModel final : public Utils::TreeModel<>
{ {

View File

@@ -3,6 +3,7 @@
#pragma once #pragma once
#include "common.h"
#include "mesoninfo.h" #include "mesoninfo.h"
#include "mesonpluginconstants.h" #include "mesonpluginconstants.h"

View File

@@ -3,6 +3,8 @@
#pragma once #pragma once
#include "mesonprojectmanagertr.h"
#include <utils/parameteraction.h> #include <utils/parameteraction.h>
namespace MesonProjectManager { namespace MesonProjectManager {
@@ -12,7 +14,8 @@ class MesonActionsManager : public QObject
{ {
Q_OBJECT Q_OBJECT
Utils::ParameterAction buildTargetContextAction{ Utils::ParameterAction buildTargetContextAction{
tr("Build"), tr("Build \"%1\""), Utils::ParameterAction::AlwaysEnabled /*handled manually*/ Tr::tr("Build"), Tr::tr("Build \"%1\""),
Utils::ParameterAction::AlwaysEnabled /*handled manually*/
}; };
QAction configureActionMenu; QAction configureActionMenu;
QAction configureActionContextMenu; QAction configureActionContextMenu;

View File

@@ -5,6 +5,7 @@
#include "mesonbuildconfiguration.h" #include "mesonbuildconfiguration.h"
#include "mesonbuildsystem.h" #include "mesonbuildsystem.h"
#include "mesonprojectmanagertr.h"
#include <coreplugin/find/itemviewfind.h> #include <coreplugin/find/itemviewfind.h>
@@ -25,17 +26,17 @@ using namespace Utils;
namespace MesonProjectManager::Internal { namespace MesonProjectManager::Internal {
MesonBuildSettingsWidget::MesonBuildSettingsWidget(MesonBuildConfiguration *buildCfg) MesonBuildSettingsWidget::MesonBuildSettingsWidget(MesonBuildConfiguration *buildCfg)
: ProjectExplorer::NamedWidget{tr("Meson")} : ProjectExplorer::NamedWidget(Tr::tr("Meson"))
, m_progressIndicator(ProgressIndicatorSize::Large) , m_progressIndicator(ProgressIndicatorSize::Large)
{ {
auto configureButton = new QPushButton(tr("Apply Configuration Changes")); auto configureButton = new QPushButton(Tr::tr("Apply Configuration Changes"));
configureButton->setEnabled(false); configureButton->setEnabled(false);
configureButton->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); configureButton->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
auto wipeButton = new QPushButton(tr("Wipe Project")); auto wipeButton = new QPushButton(Tr::tr("Wipe Project"));
wipeButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); wipeButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
wipeButton->setIcon(Utils::Icons::WARNING.icon()); wipeButton->setIcon(Utils::Icons::WARNING.icon());
wipeButton->setToolTip(tr("Wipes build directory and reconfigures using previous command " wipeButton->setToolTip(Tr::tr("Wipes build directory and reconfigures using previous command "
"line options.\nUseful if build directory is corrupted or when " "line options.\nUseful if build directory is corrupted or when "
"rebuilding with a newer version of Meson.")); "rebuilding with a newer version of Meson."));
@@ -62,7 +63,7 @@ MesonBuildSettingsWidget::MesonBuildSettingsWidget(MesonBuildConfiguration *buil
using namespace Layouting; using namespace Layouting;
Column { Column {
Form { tr("Parameters"), parametersLineEdit, br, }, Form { Tr::tr("Parameters"), parametersLineEdit, br, },
buildDirWidget, buildDirWidget,
optionsFilterLineEdit, optionsFilterLineEdit,
optionsTreeView, optionsTreeView,

View File

@@ -6,6 +6,7 @@
#include "kithelper.h" #include "kithelper.h"
#include "machinefilemanager.h" #include "machinefilemanager.h"
#include "mesonbuildconfiguration.h" #include "mesonbuildconfiguration.h"
#include "mesonprojectmanagertr.h"
#include "mesontoolkitaspect.h" #include "mesontoolkitaspect.h"
#include "settings.h" #include "settings.h"
@@ -82,7 +83,7 @@ void MesonBuildSystem::parsingCompleted(bool success)
UNLOCK(true); UNLOCK(true);
emitBuildSystemUpdated(); emitBuildSystemUpdated();
} else { } else {
TaskHub::addTask(BuildSystemTask(Task::Error, tr("Meson build: Parsing failed"))); TaskHub::addTask(BuildSystemTask(Task::Error, Tr::tr("Meson build: Parsing failed")));
UNLOCK(false); UNLOCK(false);
emitBuildSystemUpdated(); emitBuildSystemUpdated();
} }

View File

@@ -3,7 +3,7 @@
#include "mesonprocess.h" #include "mesonprocess.h"
#include "mesonoutputparser.h" #include "mesonprojectmanagertr.h"
#include <coreplugin/messagemanager.h> #include <coreplugin/messagemanager.h>
#include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/progressmanager/progressmanager.h>
@@ -44,7 +44,7 @@ bool MesonProcess::run(const Command &command,
setupProcess(command, env, captureStdo); setupProcess(command, env, captureStdo);
m_future.setProgressRange(0, 1); m_future.setProgressRange(0, 1);
Core::ProgressManager::addTimedTask(m_future, Core::ProgressManager::addTimedTask(m_future,
tr("Configuring \"%1\".").arg(projectName), Tr::tr("Configuring \"%1\".").arg(projectName),
"Meson.Configure", "Meson.Configure",
10); 10);
emit started(); emit started();
@@ -121,7 +121,7 @@ void MesonProcess::setupProcess(const Command &command,
m_process->setWorkingDirectory(command.workDir()); m_process->setWorkingDirectory(command.workDir());
m_process->setEnvironment(env); m_process->setEnvironment(env);
Core::MessageManager::writeFlashing( Core::MessageManager::writeFlashing(
tr("Running %1 in %2.").arg(command.toUserOutput()).arg(command.workDir().toUserOutput())); Tr::tr("Running %1 in %2.").arg(command.toUserOutput()).arg(command.workDir().toUserOutput()));
m_process->setCommand(command.cmdLine()); m_process->setCommand(command.cmdLine());
} }
@@ -132,14 +132,14 @@ bool MesonProcess::sanityCheck(const Command &command) const
//Should only reach this point if Meson exe is removed while a Meson project is opened //Should only reach this point if Meson exe is removed while a Meson project is opened
ProjectExplorer::TaskHub::addTask( ProjectExplorer::TaskHub::addTask(
ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::TaskType::Error, ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::TaskType::Error,
tr("Executable does not exist: %1") Tr::tr("Executable does not exist: %1")
.arg(exe.toUserOutput())}); .arg(exe.toUserOutput())});
return false; return false;
} }
if (!exe.toFileInfo().isExecutable()) { if (!exe.toFileInfo().isExecutable()) {
ProjectExplorer::TaskHub::addTask( ProjectExplorer::TaskHub::addTask(
ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::TaskType::Error, ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::TaskType::Error,
tr("Command is not executable: %1") Tr::tr("Command is not executable: %1")
.arg(exe.toUserOutput())}); .arg(exe.toUserOutput())});
return false; return false;
} }

View File

@@ -4,6 +4,7 @@
#include "mesonproject.h" #include "mesonproject.h"
#include "mesonpluginconstants.h" #include "mesonpluginconstants.h"
#include "mesonprojectmanagertr.h"
#include "mesontoolkitaspect.h" #include "mesontoolkitaspect.h"
#include "ninjatoolkitaspect.h" #include "ninjatoolkitaspect.h"
@@ -13,11 +14,13 @@
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
using namespace ProjectExplorer;
namespace MesonProjectManager { namespace MesonProjectManager {
namespace Internal { namespace Internal {
MesonProject::MesonProject(const Utils::FilePath &path) MesonProject::MesonProject(const Utils::FilePath &path)
: ProjectExplorer::Project{Constants::Project::MIMETYPE, path} : Project{Constants::Project::MIMETYPE, path}
{ {
setId(Constants::Project::ID); setId(Constants::Project::ID);
setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID)); setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
@@ -26,33 +29,33 @@ MesonProject::MesonProject(const Utils::FilePath &path)
setHasMakeInstallEquivalent(true); setHasMakeInstallEquivalent(true);
} }
ProjectExplorer::Tasks MesonProject::projectIssues(const ProjectExplorer::Kit *k) const Tasks MesonProject::projectIssues(const Kit *k) const
{ {
ProjectExplorer::Tasks result = Project::projectIssues(k); Tasks result = Project::projectIssues(k);
if (!MesonToolKitAspect::isValid(k)) if (!MesonToolKitAspect::isValid(k))
result.append( result.append(
createProjectTask(ProjectExplorer::Task::TaskType::Error, tr("No Meson tool set."))); createProjectTask(Task::TaskType::Error, Tr::tr("No Meson tool set.")));
if (!NinjaToolKitAspect::isValid(k)) if (!NinjaToolKitAspect::isValid(k))
result.append( result.append(
createProjectTask(ProjectExplorer::Task::TaskType::Error, tr("No Ninja tool set."))); createProjectTask(Task::TaskType::Error, Tr::tr("No Ninja tool set.")));
if (ProjectExplorer::ToolChainKitAspect::toolChains(k).isEmpty()) if (ToolChainKitAspect::toolChains(k).isEmpty())
result.append(createProjectTask(ProjectExplorer::Task::TaskType::Warning, result.append(createProjectTask(Task::TaskType::Warning,
tr("No compilers set in kit."))); Tr::tr("No compilers set in kit.")));
return result; return result;
} }
ProjectExplorer::ProjectImporter *MesonProject::projectImporter() const ProjectImporter *MesonProject::projectImporter() const
{ {
if (m_projectImporter) if (m_projectImporter)
m_projectImporter = std::make_unique<MesonProjectImporter>(projectFilePath()); m_projectImporter = std::make_unique<MesonProjectImporter>(projectFilePath());
return m_projectImporter.get(); return m_projectImporter.get();
} }
ProjectExplorer::DeploymentKnowledge MesonProject::deploymentKnowledge() const DeploymentKnowledge MesonProject::deploymentKnowledge() const
{ {
// TODO in next releases // TODO in next releases
return ProjectExplorer::DeploymentKnowledge::Bad; return DeploymentKnowledge::Bad;
} }
} // namespace Internal } // namespace Internal

View File

@@ -5,13 +5,11 @@
#include <QLoggingCategory> #include <QLoggingCategory>
namespace {
static Q_LOGGING_CATEGORY(mInputLog, "qtc.meson.import", QtWarningMsg);
}
namespace MesonProjectManager { namespace MesonProjectManager {
namespace Internal { namespace Internal {
static Q_LOGGING_CATEGORY(mInputLog, "qtc.meson.import", QtWarningMsg);
MesonProjectImporter::MesonProjectImporter(const Utils::FilePath &path) MesonProjectImporter::MesonProjectImporter(const Utils::FilePath &path)
: QtSupport::QtProjectImporter{path} : QtSupport::QtProjectImporter{path}
{} {}

View File

@@ -3,6 +3,7 @@
#include "mesontoolkitaspect.h" #include "mesontoolkitaspect.h"
#include "mesonprojectmanagertr.h"
#include "toolkitaspectwidget.h" #include "toolkitaspectwidget.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -16,8 +17,8 @@ MesonToolKitAspect::MesonToolKitAspect()
{ {
setObjectName(QLatin1String("MesonKitAspect")); setObjectName(QLatin1String("MesonKitAspect"));
setId(TOOL_ID); setId(TOOL_ID);
setDisplayName(tr("Meson Tool")); setDisplayName(Tr::tr("Meson Tool"));
setDescription(tr("The Meson tool to use when building a project with Meson.<br>" setDescription(Tr::tr("The Meson tool to use when building a project with Meson.<br>"
"This setting is ignored when using other build systems.")); "This setting is ignored when using other build systems."));
setPriority(9000); setPriority(9000);
} }
@@ -28,7 +29,7 @@ ProjectExplorer::Tasks MesonToolKitAspect::validate(const ProjectExplorer::Kit *
const auto tool = mesonTool(k); const auto tool = mesonTool(k);
if (tool && !tool->isValid()) if (tool && !tool->isValid())
tasks << ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::Warning, tasks << ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::Warning,
tr("Cannot validate this meson executable.")}; Tr::tr("Cannot validate this meson executable.")};
return tasks; return tasks;
} }
@@ -52,8 +53,8 @@ ProjectExplorer::KitAspect::ItemList MesonToolKitAspect::toUserOutput(
{ {
const auto tool = mesonTool(k); const auto tool = mesonTool(k);
if (tool) if (tool)
return {{tr("Meson"), tool->name()}}; return {{Tr::tr("Meson"), tool->name()}};
return {{tr("Meson"), tr("Unconfigured")}}; return {{Tr::tr("Meson"), Tr::tr("Unconfigured")}};
} }
ProjectExplorer::KitAspectWidget *MesonToolKitAspect::createConfigWidget(ProjectExplorer::Kit *k) const ProjectExplorer::KitAspectWidget *MesonToolKitAspect::createConfigWidget(ProjectExplorer::Kit *k) const

View File

@@ -13,8 +13,6 @@ namespace Internal {
class MesonToolKitAspect final : public ProjectExplorer::KitAspect class MesonToolKitAspect final : public ProjectExplorer::KitAspect
{ {
Q_DECLARE_TR_FUNCTIONS(MesonProjectManager::Internal::MesonToolKitAspect)
public: public:
MesonToolKitAspect(); MesonToolKitAspect();

View File

@@ -3,8 +3,6 @@
#include "nativefilegenerator.h" #include "nativefilegenerator.h"
#include "kithelper.h"
#include <projectexplorer/kitinformation.h> #include <projectexplorer/kitinformation.h>
#include <projectexplorer/kitmanager.h> #include <projectexplorer/kitmanager.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>

View File

@@ -6,6 +6,7 @@
#include "mesonbuildconfiguration.h" #include "mesonbuildconfiguration.h"
#include "mesonbuildsystem.h" #include "mesonbuildsystem.h"
#include "mesonpluginconstants.h" #include "mesonpluginconstants.h"
#include "mesonprojectmanagertr.h"
#include "mesonoutputparser.h" #include "mesonoutputparser.h"
#include "ninjatoolkitaspect.h" #include "ninjatoolkitaspect.h"
#include "settings.h" #include "settings.h"
@@ -32,8 +33,8 @@ namespace Internal {
const char TARGETS_KEY[] = "MesonProjectManager.BuildStep.BuildTargets"; const char TARGETS_KEY[] = "MesonProjectManager.BuildStep.BuildTargets";
const char TOOL_ARGUMENTS_KEY[] = "MesonProjectManager.BuildStep.AdditionalArguments"; const char TOOL_ARGUMENTS_KEY[] = "MesonProjectManager.BuildStep.AdditionalArguments";
NinjaBuildStep::NinjaBuildStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id) NinjaBuildStep::NinjaBuildStep(BuildStepList *bsl, Id id)
: ProjectExplorer::AbstractProcessStep{bsl, id} : AbstractProcessStep{bsl, id}
{ {
if (m_targetName.isEmpty()) if (m_targetName.isEmpty())
setBuildTarget(defaultBuildTarget()); setBuildTarget(defaultBuildTarget());
@@ -43,16 +44,14 @@ NinjaBuildStep::NinjaBuildStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id
setUseEnglishOutput(); setUseEnglishOutput();
connect(target(), &ProjectExplorer::Target::parsingFinished, this, &NinjaBuildStep::update); connect(target(), &ProjectExplorer::Target::parsingFinished, this, &NinjaBuildStep::update);
connect(&Settings::instance()->verboseNinja, connect(&Settings::instance()->verboseNinja, &BaseAspect::changed,
&BaseAspect::changed, this, &NinjaBuildStep::commandChanged);
this,
&NinjaBuildStep::commandChanged);
} }
QWidget *NinjaBuildStep::createConfigWidget() QWidget *NinjaBuildStep::createConfigWidget()
{ {
auto widget = new QWidget; auto widget = new QWidget;
setDisplayName(tr("Build", "MesonProjectManager::MesonBuildStepConfigWidget display name.")); setDisplayName(Tr::tr("Build", "MesonProjectManager::MesonBuildStepConfigWidget display name."));
auto buildTargetsList = new QListWidget(widget); auto buildTargetsList = new QListWidget(widget);
buildTargetsList->setMinimumHeight(200); buildTargetsList->setMinimumHeight(200);
@@ -67,8 +66,8 @@ QWidget *NinjaBuildStep::createConfigWidget()
auto formLayout = new QFormLayout(widget); auto formLayout = new QFormLayout(widget);
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
formLayout->setContentsMargins(0, 0, 0, 0); formLayout->setContentsMargins(0, 0, 0, 0);
formLayout->addRow(tr("Tool arguments:"), toolArguments); formLayout->addRow(Tr::tr("Tool arguments:"), toolArguments);
formLayout->addRow(tr("Targets:"), wrapper); formLayout->addRow(Tr::tr("Targets:"), wrapper);
auto updateDetails = [this] { auto updateDetails = [this] {
ProcessParameters param; ProcessParameters param;
@@ -188,7 +187,7 @@ MesonBuildStepFactory::MesonBuildStepFactory()
{ {
registerStep<NinjaBuildStep>(Constants::MESON_BUILD_STEP_ID); registerStep<NinjaBuildStep>(Constants::MESON_BUILD_STEP_ID);
setSupportedProjectType(Constants::Project::ID); setSupportedProjectType(Constants::Project::ID);
setDisplayName(NinjaBuildStep::tr("Meson Build")); setDisplayName(Tr::tr("Meson Build"));
} }
void MesonProjectManager::Internal::NinjaBuildStep::setBuildTarget(const QString &targetName) void MesonProjectManager::Internal::NinjaBuildStep::setBuildTarget(const QString &targetName)

View File

@@ -3,6 +3,7 @@
#include "ninjatoolkitaspect.h" #include "ninjatoolkitaspect.h"
#include "mesonprojectmanagertr.h"
#include "toolkitaspectwidget.h" #include "toolkitaspectwidget.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -16,8 +17,8 @@ NinjaToolKitAspect::NinjaToolKitAspect()
{ {
setObjectName(QLatin1String("NinjaKitAspect")); setObjectName(QLatin1String("NinjaKitAspect"));
setId(TOOL_ID); setId(TOOL_ID);
setDisplayName(tr("Ninja Tool")); setDisplayName(Tr::tr("Ninja Tool"));
setDescription(tr("The Ninja tool to use when building a project with Meson.<br>" setDescription(Tr::tr("The Ninja tool to use when building a project with Meson.<br>"
"This setting is ignored when using other build systems.")); "This setting is ignored when using other build systems."));
setPriority(9000); setPriority(9000);
} }
@@ -28,7 +29,7 @@ ProjectExplorer::Tasks NinjaToolKitAspect::validate(const ProjectExplorer::Kit *
const auto tool = ninjaTool(k); const auto tool = ninjaTool(k);
if (tool && !tool->isValid()) if (tool && !tool->isValid())
tasks << ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::Warning, tasks << ProjectExplorer::BuildSystemTask{ProjectExplorer::Task::Warning,
tr("Cannot validate this Ninja executable.")}; Tr::tr("Cannot validate this Ninja executable.")};
return tasks; return tasks;
} }
@@ -52,8 +53,8 @@ ProjectExplorer::KitAspect::ItemList NinjaToolKitAspect::toUserOutput(
{ {
const auto tool = ninjaTool(k); const auto tool = ninjaTool(k);
if (tool) if (tool)
return {{tr("Ninja"), tool->name()}}; return {{Tr::tr("Ninja"), tool->name()}};
return {{tr("Ninja"), tr("Unconfigured")}}; return {{Tr::tr("Ninja"), Tr::tr("Unconfigured")}};
} }
ProjectExplorer::KitAspectWidget *NinjaToolKitAspect::createConfigWidget(ProjectExplorer::Kit *k) const ProjectExplorer::KitAspectWidget *NinjaToolKitAspect::createConfigWidget(ProjectExplorer::Kit *k) const

View File

@@ -13,8 +13,6 @@ namespace Internal {
class NinjaToolKitAspect final : public ProjectExplorer::KitAspect class NinjaToolKitAspect final : public ProjectExplorer::KitAspect
{ {
Q_DECLARE_TR_FUNCTIONS(MesonProjectManager::Internal::NinjaToolKitAspect)
public: public:
NinjaToolKitAspect(); NinjaToolKitAspect();

View File

@@ -4,6 +4,7 @@
#include "settings.h" #include "settings.h"
#include "mesonpluginconstants.h" #include "mesonpluginconstants.h"
#include "mesonprojectmanagertr.h"
#include <utils/layoutbuilder.h> #include <utils/layoutbuilder.h>
@@ -16,12 +17,12 @@ Settings::Settings()
setAutoApply(false); setAutoApply(false);
autorunMeson.setSettingsKey("meson.autorun"); autorunMeson.setSettingsKey("meson.autorun");
autorunMeson.setLabelText(tr("Autorun Meson")); autorunMeson.setLabelText(Tr::tr("Autorun Meson"));
autorunMeson.setToolTip(tr("Automatically run Meson when needed.")); autorunMeson.setToolTip(Tr::tr("Automatically run Meson when needed."));
verboseNinja.setSettingsKey("ninja.verbose"); verboseNinja.setSettingsKey("ninja.verbose");
verboseNinja.setLabelText(tr("Ninja verbose mode")); verboseNinja.setLabelText(Tr::tr("Ninja verbose mode"));
verboseNinja.setToolTip(tr("Enables verbose mode by default when invoking Ninja.")); verboseNinja.setToolTip(Tr::tr("Enables verbose mode by default when invoking Ninja."));
registerAspect(&autorunMeson); registerAspect(&autorunMeson);
registerAspect(&verboseNinja); registerAspect(&verboseNinja);
@@ -36,7 +37,7 @@ Settings *Settings::instance()
GeneralSettingsPage::GeneralSettingsPage() GeneralSettingsPage::GeneralSettingsPage()
{ {
setId(Constants::SettingsPage::GENERAL_ID); setId(Constants::SettingsPage::GENERAL_ID);
setDisplayName(tr("General")); setDisplayName(Tr::tr("General"));
setDisplayCategory("Meson"); setDisplayCategory("Meson");
setCategory(Constants::SettingsPage::CATEGORY); setCategory(Constants::SettingsPage::CATEGORY);
setCategoryIconPath(Constants::Icons::MESON_BW); setCategoryIconPath(Constants::Icons::MESON_BW);

View File

@@ -12,8 +12,6 @@ namespace Internal {
class Settings : public Utils::AspectContainer class Settings : public Utils::AspectContainer
{ {
Q_DECLARE_TR_FUNCTIONS(MesonProjectManager::Internal::Settings)
public: public:
Settings(); Settings();
@@ -25,8 +23,6 @@ public:
class GeneralSettingsPage final : public Core::IOptionsPage class GeneralSettingsPage final : public Core::IOptionsPage
{ {
Q_DECLARE_TR_FUNCTIONS(MesonProjectManager::Internal::GeneralSettingsPage)
public: public:
GeneralSettingsPage(); GeneralSettingsPage();
}; };

View File

@@ -3,6 +3,7 @@
#include "toolitemsettings.h" #include "toolitemsettings.h"
#include "mesonprojectmanagertr.h"
#include "tooltreeitem.h" #include "tooltreeitem.h"
#include <utils/layoutbuilder.h> #include <utils/layoutbuilder.h>
@@ -26,8 +27,8 @@ ToolItemSettings::ToolItemSettings(QWidget *parent)
using namespace Layouting; using namespace Layouting;
Form { Form {
tr("Name:"), m_mesonNameLineEdit, br, Tr::tr("Name:"), m_mesonNameLineEdit, br,
tr("Path:"), m_mesonPathChooser, br, Tr::tr("Path:"), m_mesonPathChooser, br,
}.attachTo(this, WithoutMargins); }.attachTo(this, WithoutMargins);
connect(m_mesonPathChooser, &PathChooser::rawPathChanged, this, &ToolItemSettings::store); connect(m_mesonPathChooser, &PathChooser::rawPathChanged, this, &ToolItemSettings::store);

View File

@@ -3,7 +3,6 @@
#pragma once #pragma once
#include "mesontoolkitaspect.h" #include "mesontoolkitaspect.h"
#include "mesonwrapper.h"
#include "ninjatoolkitaspect.h" #include "ninjatoolkitaspect.h"
#include <projectexplorer/kitmanager.h> #include <projectexplorer/kitmanager.h>
@@ -18,7 +17,6 @@ namespace Internal {
class ToolKitAspectWidget final : public ProjectExplorer::KitAspectWidget class ToolKitAspectWidget final : public ProjectExplorer::KitAspectWidget
{ {
Q_DECLARE_TR_FUNCTIONS(MesonProjectManager::Internal::ToolKitAspect)
public: public:
enum class ToolType { Meson, Ninja }; enum class ToolType { Meson, Ninja };

View File

@@ -4,6 +4,7 @@
#include "toolsmodel.h" #include "toolsmodel.h"
#include "tooltreeitem.h" #include "tooltreeitem.h"
#include "mesonprojectmanagertr.h"
#include "mesontools.h" #include "mesontools.h"
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
@@ -15,7 +16,7 @@ namespace Internal {
ToolsModel::ToolsModel() ToolsModel::ToolsModel()
{ {
setHeader({tr("Name"), tr("Location")}); setHeader({Tr::tr("Name"), Tr::tr("Location")});
rootItem()->appendChild( rootItem()->appendChild(
new Utils::StaticTreeItem({ProjectExplorer::Constants::msgAutoDetected()}, new Utils::StaticTreeItem({ProjectExplorer::Constants::msgAutoDetected()},
{ProjectExplorer::Constants::msgAutoDetectedToolTip()})); {ProjectExplorer::Constants::msgAutoDetectedToolTip()}));
@@ -39,7 +40,7 @@ void ToolsModel::updateItem(const Utils::Id &itemId, const QString &name, const
void ToolsModel::addMesonTool() void ToolsModel::addMesonTool()
{ {
manualGroup()->appendChild(new ToolTreeItem{uniqueName(tr("New Meson or Ninja tool"))}); manualGroup()->appendChild(new ToolTreeItem{uniqueName(Tr::tr("New Meson or Ninja tool"))});
} }
void ToolsModel::removeMesonTool(ToolTreeItem *item) void ToolsModel::removeMesonTool(ToolTreeItem *item)

View File

@@ -17,9 +17,9 @@ class ToolTreeItem;
class ToolsModel final : public Utils::TreeModel<Utils::TreeItem, Utils::TreeItem, ToolTreeItem> class ToolsModel final : public Utils::TreeModel<Utils::TreeItem, Utils::TreeItem, ToolTreeItem>
{ {
Q_DECLARE_TR_FUNCTIONS(MesonProjectManager::Internal::ToolsSettingsPage)
public: public:
ToolsModel(); ToolsModel();
ToolTreeItem *mesoneToolTreeItem(const QModelIndex &index) const; ToolTreeItem *mesoneToolTreeItem(const QModelIndex &index) const;
void updateItem(const Utils::Id &itemId, const QString &name, const Utils::FilePath &exe); void updateItem(const Utils::Id &itemId, const QString &name, const Utils::FilePath &exe);
void addMesonTool(); void addMesonTool();

View File

@@ -4,6 +4,7 @@
#include "toolssettingsaccessor.h" #include "toolssettingsaccessor.h"
#include "mesonpluginconstants.h" #include "mesonpluginconstants.h"
#include "mesonprojectmanagertr.h"
#include <app/app_version.h> #include <app/app_version.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
@@ -18,18 +19,15 @@
namespace MesonProjectManager { namespace MesonProjectManager {
namespace Internal { namespace Internal {
namespace { static QString entryName(int index)
inline QString entryName(int index)
{ {
using namespace Constants; using namespace Constants;
return QString("%1%2").arg(ToolsSettings::ENTRY_KEY).arg(index); return QString("%1%2").arg(ToolsSettings::ENTRY_KEY).arg(index);
} }
} // namespace
ToolsSettingsAccessor::ToolsSettingsAccessor() ToolsSettingsAccessor::ToolsSettingsAccessor()
: UpgradingSettingsAccessor("QtCreatorMesonTools", : UpgradingSettingsAccessor("QtCreatorMesonTools",
QCoreApplication::translate("MesonProjectManager::MesonToolManager", Tr::tr("Meson"),
"Meson"),
Core::Constants::IDE_DISPLAY_NAME) Core::Constants::IDE_DISPLAY_NAME)
{ {
setBaseFilePath(Core::ICore::userResourcePath(Constants::ToolsSettings::FILENAME)); setBaseFilePath(Core::ICore::userResourcePath(Constants::ToolsSettings::FILENAME));

View File

@@ -4,6 +4,7 @@
#include "toolssettingspage.h" #include "toolssettingspage.h"
#include "mesonpluginconstants.h" #include "mesonpluginconstants.h"
#include "mesonprojectmanagertr.h"
#include "toolssettingswidget.h" #include "toolssettingswidget.h"
namespace MesonProjectManager { namespace MesonProjectManager {
@@ -12,7 +13,7 @@ namespace Internal {
ToolsSettingsPage::ToolsSettingsPage() ToolsSettingsPage::ToolsSettingsPage()
{ {
setId(Constants::SettingsPage::TOOLS_ID); setId(Constants::SettingsPage::TOOLS_ID);
setDisplayName(tr("Tools")); setDisplayName(Tr::tr("Tools"));
setCategory(Constants::SettingsPage::CATEGORY); setCategory(Constants::SettingsPage::CATEGORY);
setWidgetCreator([]() { return new ToolsSettingsWidget; }); setWidgetCreator([]() { return new ToolsSettingsWidget; });
} }

View File

@@ -5,17 +5,11 @@
#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/dialogs/ioptionspage.h>
#include <QCoreApplication>
namespace MesonProjectManager { namespace MesonProjectManager {
namespace Internal { namespace Internal {
class MesonTools;
class ToolsSettingsPage final : public Core::IOptionsPage class ToolsSettingsPage final : public Core::IOptionsPage
{ {
Q_DECLARE_TR_FUNCTIONS(MesonProjectManager::Internal::ToolsSettingsPage)
public: public:
ToolsSettingsPage(); ToolsSettingsPage();
}; };

View File

@@ -3,6 +3,7 @@
#include "toolssettingswidget.h" #include "toolssettingswidget.h"
#include "mesonprojectmanagertr.h"
#include "toolsmodel.h" #include "toolsmodel.h"
#include "tooltreeitem.h" #include "tooltreeitem.h"
@@ -33,18 +34,18 @@ ToolsSettingsWidget::ToolsSettingsWidget()
m_mesonDetails->setVisible(false); m_mesonDetails->setVisible(false);
m_mesonDetails->setWidget(m_itemSettings); m_mesonDetails->setWidget(m_itemSettings);
auto addButton = new QPushButton(tr("Add")); auto addButton = new QPushButton(Tr::tr("Add"));
m_cloneButton = new QPushButton(tr("Clone")); m_cloneButton = new QPushButton(Tr::tr("Clone"));
m_cloneButton->setEnabled(false); m_cloneButton->setEnabled(false);
m_removeButton = new QPushButton(tr("Remove")); m_removeButton = new QPushButton(Tr::tr("Remove"));
m_removeButton->setEnabled(false); m_removeButton->setEnabled(false);
auto makeDefaultButton = new QPushButton(tr("Make Default")); auto makeDefaultButton = new QPushButton(Tr::tr("Make Default"));
makeDefaultButton->setEnabled(false); makeDefaultButton->setEnabled(false);
makeDefaultButton->setVisible(false); makeDefaultButton->setVisible(false);
makeDefaultButton->setToolTip(tr("Set as the default Meson executable to use " makeDefaultButton->setToolTip(Tr::tr("Set as the default Meson executable to use "
"when creating a new kit or when no value is set.")); "when creating a new kit or when no value is set."));
using namespace Layouting; using namespace Layouting;

View File

@@ -8,23 +8,21 @@
#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/dialogs/ioptionspage.h>
#include <QCoreApplication>
namespace Utils { class DetailsWidget; } namespace Utils { class DetailsWidget; }
namespace MesonProjectManager::Internal { namespace MesonProjectManager::Internal {
class ToolTreeItem; class ToolTreeItem;
class ToolsSettingsWidget final : public Core::IOptionsPageWidget class ToolsSettingsWidget final : public Core::IOptionsPageWidget
{ {
Q_DECLARE_TR_FUNCTIONS(MesonProjectManager::Internal::ToolsSettingsWidget)
void apply() final;
public: public:
explicit ToolsSettingsWidget(); explicit ToolsSettingsWidget();
~ToolsSettingsWidget(); ~ToolsSettingsWidget();
private: private:
void apply() final;
void cloneMesonTool(); void cloneMesonTool();
void removeMesonTool(); void removeMesonTool();
void currentMesonToolChanged(const QModelIndex &newCurrent); void currentMesonToolChanged(const QModelIndex &newCurrent);

View File

@@ -3,6 +3,8 @@
#include "tooltreeitem.h" #include "tooltreeitem.h"
#include "mesonprojectmanagertr.h"
#include <utils/utilsicons.h> #include <utils/utilsicons.h>
#include <QFileInfo> #include <QFileInfo>
@@ -27,12 +29,12 @@ ToolTreeItem::ToolTreeItem(const MesonTools::Tool_t &tool)
, m_autoDetected{tool->autoDetected()} , m_autoDetected{tool->autoDetected()}
, m_id{tool->id()} , m_id{tool->id()}
{ {
m_tooltip = tr("Version: %1").arg(tool->version().toQString()); m_tooltip = Tr::tr("Version: %1").arg(tool->version().toQString());
self_check(); self_check();
} }
ToolTreeItem::ToolTreeItem(const ToolTreeItem &other) ToolTreeItem::ToolTreeItem(const ToolTreeItem &other)
: m_name{tr("Clone of %1").arg(other.m_name)} : m_name{Tr::tr("Clone of %1").arg(other.m_name)}
, m_executable{other.m_executable} , m_executable{other.m_executable}
, m_autoDetected{false} , m_autoDetected{false}
, m_id{Utils::Id::fromString(QUuid::createUuid().toString())} , m_id{Utils::Id::fromString(QUuid::createUuid().toString())}
@@ -63,14 +65,11 @@ QVariant ToolTreeItem::data(int column, int role) const
} }
case Qt::ToolTipRole: { case Qt::ToolTipRole: {
if (!m_pathExists) if (!m_pathExists)
return QCoreApplication::translate("MesonProjectManager::Internal::ToolTreeItem", return Tr::tr("Meson executable path does not exist.");
"Meson executable path does not exist.");
if (!m_pathIsFile) if (!m_pathIsFile)
return QCoreApplication::translate("MesonProjectManager::Internal::ToolTreeItem", return Tr::tr("Meson executable path is not a file.");
"Meson executable path is not a file.");
if (!m_pathIsExecutable) if (!m_pathIsExecutable)
return QCoreApplication::translate("MesonProjectManager::Internal::ToolTreeItem", return Tr::tr("Meson executable path is not executable.");
"Meson executable path is not executable.");
return m_tooltip; return m_tooltip;
} }
case Qt::DecorationRole: { case Qt::DecorationRole: {
@@ -103,9 +102,9 @@ void ToolTreeItem::self_check()
void ToolTreeItem::update_tooltip(const Version &version) void ToolTreeItem::update_tooltip(const Version &version)
{ {
if (version.isValid) if (version.isValid)
m_tooltip = tr("Version: %1").arg(version.toQString()); m_tooltip = Tr::tr("Version: %1").arg(version.toQString());
else else
m_tooltip = tr("Cannot get tool version."); m_tooltip = Tr::tr("Cannot get tool version.");
} }
void ToolTreeItem::update_tooltip() void ToolTreeItem::update_tooltip()

View File

@@ -4,7 +4,6 @@
#pragma once #pragma once
#include "mesontools.h" #include "mesontools.h"
#include "toolssettingspage.h"
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/id.h> #include <utils/id.h>
@@ -20,11 +19,11 @@ namespace Internal {
class ToolTreeItem final : public Utils::TreeItem class ToolTreeItem final : public Utils::TreeItem
{ {
Q_DECLARE_TR_FUNCTIONS(MesonProjectManager::Internal::ToolsSettingsPage)
public: public:
ToolTreeItem(const QString &name); ToolTreeItem(const QString &name);
ToolTreeItem(const MesonTools::Tool_t &tool); ToolTreeItem(const MesonTools::Tool_t &tool);
ToolTreeItem(const ToolTreeItem &other); ToolTreeItem(const ToolTreeItem &other);
QVariant data(int column, int role) const override; QVariant data(int column, int role) const override;
inline bool isAutoDetected() const noexcept { return m_autoDetected; } inline bool isAutoDetected() const noexcept { return m_autoDetected; }
inline QString name() const noexcept { return m_name; } inline QString name() const noexcept { return m_name; }