McuSupport: Inline FlashAndRunConfiguration

Add a tr() to the label.

Change-Id: Iefacd6c6646b9f5e5124d907d0516ebc5556ae76
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2020-02-11 10:44:04 +01:00
parent 783967f550
commit 8d0361a8c9
2 changed files with 19 additions and 21 deletions

View File

@@ -62,11 +62,16 @@ static QStringList flashAndRunArgs(const Target *target)
return {"--build", ".", "--target", targetName}; return {"--build", ".", "--target", targetName};
} }
FlashAndRunConfiguration::FlashAndRunConfiguration(Target *target, Core::Id id) class FlashAndRunConfiguration final : public RunConfiguration
{
Q_DECLARE_TR_FUNCTIONS(McuSupport::Internal::FlashAndRunConfiguration)
public:
FlashAndRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id) : RunConfiguration(target, id)
{ {
auto flashAndRunParameters = addAspect<BaseStringAspect>(); auto flashAndRunParameters = addAspect<BaseStringAspect>();
flashAndRunParameters->setLabelText("Flash and run CMake parameters:"); flashAndRunParameters->setLabelText(tr("Flash and run CMake parameters:"));
flashAndRunParameters->setDisplayStyle(BaseStringAspect::TextEditDisplay); flashAndRunParameters->setDisplayStyle(BaseStringAspect::TextEditDisplay);
flashAndRunParameters->setSettingsKey("FlashAndRunConfiguration.Parameters"); flashAndRunParameters->setSettingsKey("FlashAndRunConfiguration.Parameters");
@@ -78,6 +83,7 @@ FlashAndRunConfiguration::FlashAndRunConfiguration(Target *target, Core::Id id)
connect(target->project(), &Project::displayNameChanged, this, &RunConfiguration::update); connect(target->project(), &Project::displayNameChanged, this, &RunConfiguration::update);
} }
};
class FlashAndRunWorker : public SimpleTargetRunner class FlashAndRunWorker : public SimpleTargetRunner
{ {

View File

@@ -31,20 +31,12 @@
namespace McuSupport { namespace McuSupport {
namespace Internal { namespace Internal {
class McuSupportRunConfigurationFactory : public ProjectExplorer::FixedRunConfigurationFactory class McuSupportRunConfigurationFactory final : public ProjectExplorer::FixedRunConfigurationFactory
{ {
public: public:
McuSupportRunConfigurationFactory(); McuSupportRunConfigurationFactory();
}; };
class FlashAndRunConfiguration : public ProjectExplorer::RunConfiguration
{
Q_OBJECT
public:
FlashAndRunConfiguration(ProjectExplorer::Target *target, Core::Id id);
};
ProjectExplorer::RunWorkerFactory::WorkerCreator makeFlashAndRunWorker(); ProjectExplorer::RunWorkerFactory::WorkerCreator makeFlashAndRunWorker();
} // namespace Internal } // namespace Internal