RemoteLinux: Reduce visibility of KillAppStep

Change-Id: Ib90a25ea5d3f2c7636aa099c87a3f71721ab9ea6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2022-07-01 15:59:17 +02:00
parent 1afbeb696a
commit 95c1f37a31
8 changed files with 45 additions and 68 deletions

View File

@@ -45632,7 +45632,7 @@ Gemning mislykkedes.</translation>
</message>
</context>
<context>
<name>RemoteLinux::RemoteLinuxKillAppService</name>
<name>RemoteLinux::Tr</name>
<message>
<source>Trying to kill &quot;%1&quot; on remote device...</source>
<translation>Prøver at dræbe &quot;%1&quot; fjern-enhed...</translation>
@@ -45645,9 +45645,6 @@ Gemning mislykkedes.</translation>
<source>Failed to kill remote application. Assuming it was not running.</source>
<translation>Kunne ikke dræbe fjern-program. Formoder at den ikke kørte.</translation>
</message>
</context>
<context>
<name>RemoteLinux::RemoteLinuxKillAppStep</name>
<message>
<source>Kill current application instance</source>
<translation>Dræb aktuelle programinstans</translation>

View File

@@ -42038,7 +42038,7 @@ Breche ausstehende Operationen ab...
</message>
</context>
<context>
<name>RemoteLinux::RemoteLinuxKillAppService</name>
<name>RemoteLinux::Tr</name>
<message>
<source>Trying to kill &quot;%1&quot; on remote device...</source>
<translation>Versuche &quot;%1&quot; auf anderem Gerät zu beenden...</translation>
@@ -42051,9 +42051,6 @@ Breche ausstehende Operationen ab...
<source>Failed to kill remote application. Assuming it was not running.</source>
<translation>Anwendung auf anderem Gerät konnte nicht beendet werden. Vermutlich lief sie nicht.</translation>
</message>
</context>
<context>
<name>RemoteLinux::RemoteLinuxKillAppStep</name>
<message>
<source>Kill current application instance</source>
<translation>Aktuelle Instanz der Anwendung beenden</translation>

View File

@@ -42539,7 +42539,7 @@ If you do not have a private key yet, you can also create one here.</source>
</message>
</context>
<context>
<name>RemoteLinux::RemoteLinuxKillAppService</name>
<name>RemoteLinux::Tr</name>
<message>
<source>Trying to kill &quot;%1&quot; on remote device...</source>
<translation type="unfinished"></translation>
@@ -42552,9 +42552,6 @@ If you do not have a private key yet, you can also create one here.</source>
<source>Failed to kill remote application. Assuming it was not running.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RemoteLinux::RemoteLinuxKillAppStep</name>
<message>
<source>Kill current application instance</source>
<translation type="unfinished"></translation>

View File

@@ -58368,7 +58368,7 @@ Stepping into the module or setting breakpoints by file and line is expected to
</message>
</context>
<context>
<name>RemoteLinux::RemoteLinuxKillAppService</name>
<name>RemoteLinux::Tr</name>
<message>
<source>Trying to kill &quot;%1&quot; on remote device...</source>
<translation> &quot;%1&quot; ...</translation>
@@ -58381,9 +58381,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
<source>Failed to kill remote application. Assuming it was not running.</source>
<translation></translation>
</message>
</context>
<context>
<name>RemoteLinux::RemoteLinuxKillAppStep</name>
<message>
<source>Kill current application instance</source>
<translation></translation>

View File

@@ -46224,7 +46224,7 @@ If you do not have a private key yet, you can also create one here.</source>
</message>
</context>
<context>
<name>RemoteLinux::RemoteLinuxKillAppService</name>
<name>RemoteLinux::Tr</name>
<message>
<source>Trying to kill &quot;%1&quot; on remote device...</source>
<translation>Попытка уничтожить «%1» на внешнем устройстве...</translation>
@@ -46237,9 +46237,6 @@ If you do not have a private key yet, you can also create one here.</source>
<source>Failed to kill remote application. Assuming it was not running.</source>
<translation>Не удалось уничтожить внешнее приложение. Возможно, оно не было запущено.</translation>
</message>
</context>
<context>
<name>RemoteLinux::RemoteLinuxKillAppStep</name>
<message>
<source>Kill current application instance</source>
<translation>Уничтожение текущего экземпляра приложения</translation>

View File

@@ -25,23 +25,25 @@
#include "killappstep.h"
#include "abstractremotelinuxdeploystep.h"
#include "abstractremotelinuxdeployservice.h"
#include "remotelinux_constants.h"
#include "remotelinuxtr.h"
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/runcontrol.h>
#include <projectexplorer/target.h>
#include <utils/qtcassert.h>
using namespace ProjectExplorer;
using namespace Utils;
namespace RemoteLinux {
namespace Internal {
namespace RemoteLinux::Internal {
class KillAppService : public AbstractRemoteLinuxDeployService
{
Q_OBJECT
public:
~KillAppService() override;
@@ -61,7 +63,7 @@ private:
void finishDeployment();
QString m_remoteExecutable;
ProjectExplorer::DeviceProcessSignalOperation::Ptr m_signalOperation;
DeviceProcessSignalOperation::Ptr m_signalOperation;
};
KillAppService::~KillAppService()
@@ -86,9 +88,9 @@ void KillAppService::doDeploy()
handleDeploymentDone();
return;
}
connect(m_signalOperation.data(), &ProjectExplorer::DeviceProcessSignalOperation::finished,
connect(m_signalOperation.data(), &DeviceProcessSignalOperation::finished,
this, &KillAppService::handleSignalOpFinished);
emit progressMessage(tr("Trying to kill \"%1\" on remote device...").arg(m_remoteExecutable));
emit progressMessage(Tr::tr("Trying to kill \"%1\" on remote device...").arg(m_remoteExecutable));
m_signalOperation->killProcess(m_remoteExecutable);
}
@@ -114,17 +116,17 @@ void KillAppService::stopDeployment()
void KillAppService::handleSignalOpFinished(const QString &errorMessage)
{
if (errorMessage.isEmpty())
emit progressMessage(tr("Remote application killed."));
emit progressMessage(Tr::tr("Remote application killed."));
else
emit progressMessage(tr("Failed to kill remote application. Assuming it was not running."));
emit progressMessage(Tr::tr("Failed to kill remote application. Assuming it was not running."));
finishDeployment();
}
} // namespace Internal
KillAppStep::KillAppStep(BuildStepList *bsl, Id id)
: AbstractRemoteLinuxDeployStep(bsl, id)
class KillAppStep : public AbstractRemoteLinuxDeployStep
{
public:
KillAppStep(BuildStepList *bsl, Id id) : AbstractRemoteLinuxDeployStep(bsl, id)
{
auto service = createDeployService<Internal::KillAppService>();
setWidgetExpandedByDefault(false);
@@ -137,18 +139,15 @@ KillAppStep::KillAppStep(BuildStepList *bsl, Id id)
service->setRemoteExecutable(remoteExe);
return CheckResult::success();
});
}
}
};
Id KillAppStep::stepId()
KillAppStepFactory::KillAppStepFactory()
{
return Constants::KillAppStepId;
registerStep<KillAppStep>(Constants::KillAppStepId);
setDisplayName(Tr::tr("Kill current application instance"));
setSupportedConfiguration(RemoteLinux::Constants::DeployToGenericLinux);
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY);
}
QString KillAppStep::displayName()
{
return tr("Kill current application instance");
}
} // namespace RemoteLinux
#include "killappstep.moc"
} // RemoteLinux::Internal

View File

@@ -25,21 +25,14 @@
#pragma once
#include "remotelinux_export.h"
#include <projectexplorer/buildstep.h>
#include "abstractremotelinuxdeploystep.h"
namespace RemoteLinux::Internal {
namespace RemoteLinux {
class REMOTELINUX_EXPORT KillAppStep : public AbstractRemoteLinuxDeployStep
class KillAppStepFactory : public ProjectExplorer::BuildStepFactory
{
Q_OBJECT
public:
explicit KillAppStep(ProjectExplorer::BuildStepList *bsl,
Utils::Id id = stepId());
static Utils::Id stepId();
static QString displayName();
KillAppStepFactory();
};
} // namespace RemoteLinux
} // RemoteLinux::Internal

View File

@@ -79,7 +79,7 @@ public:
GenericDeployStepFactory<GenericDirectUploadStep> genericDirectUploadStepFactory;
GenericDeployStepFactory<RsyncDeployStep> rsyncDeployStepFactory;
CustomCommandDeployStepFactory customCommandDeployStepFactory;
GenericDeployStepFactory<KillAppStep> killAppStepFactory;
KillAppStepFactory killAppStepFactory;
GenericDeployStepFactory<MakeInstallStep> makeInstallStepFactory;
const QList<Utils::Id> supportedRunConfigs {