#include "abstractremotelinuxdeploystep.h"
#include "abstractremotelinuxdeployservice.h"
-#include "maemodeploystepwidget.h"
#include "remotelinuxdeployconfiguration.h"
+#include "remotelinuxdeploystepwidget.h"
#include <projectexplorer/projectexplorerconstants.h>
+#include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
using namespace ProjectExplorer;
} // namespace Internal
AbstractRemoteLinuxDeployStep::AbstractRemoteLinuxDeployStep(BuildStepList *bsl, const QString &id)
- : BuildStep(bsl, id), m_d(new Internal::AbstractRemoteLinuxDeployStepPrivate)
+ : BuildStep(bsl, id), d(new Internal::AbstractRemoteLinuxDeployStepPrivate)
{
}
AbstractRemoteLinuxDeployStep::AbstractRemoteLinuxDeployStep(BuildStepList *bsl,
AbstractRemoteLinuxDeployStep *other)
- : BuildStep(bsl, other), m_d(new Internal::AbstractRemoteLinuxDeployStepPrivate)
+ : BuildStep(bsl, other), d(new Internal::AbstractRemoteLinuxDeployStepPrivate)
{
}
bool AbstractRemoteLinuxDeployStep::init()
{
- return isDeploymentPossible();
+ QString error;
+ const bool canDeploy = isDeploymentPossible(&error);
+ if (!canDeploy)
+ emit addOutput(tr("Deployment failed: %1").arg(error), ErrorMessageOutput);
+ return canDeploy;
}
bool AbstractRemoteLinuxDeployStep::isDeploymentPossible(QString *whyNot) const
{
deployService()->setDeviceConfiguration(deployConfiguration()->deviceConfiguration());
- deployService()->setBuildConfiguration(qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration *>(buildConfiguration()));
+ deployService()->setBuildConfiguration(qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration *>(target()->activeBuildConfiguration()));
return deployService()->isDeploymentPossible(whyNot);
}
void AbstractRemoteLinuxDeployStep::run(QFutureInterface<bool> &fi)
{
connect(deployService(), SIGNAL(errorMessage(QString)), SLOT(handleErrorMessage(QString)));
- connect(deployService(), SIGNAL(progressMessage(QString)), SLOT(handleProgressMessage(QString)));
+ connect(deployService(), SIGNAL(progressMessage(QString)),
+ SLOT(handleProgressMessage(QString)));
+ connect(deployService(), SIGNAL(warningMessage(QString)), SLOT(handleWarningMessage(QString)));
connect(deployService(), SIGNAL(stdOutData(QString)), SLOT(handleStdOutData(QString)));
connect(deployService(), SIGNAL(stdErrData(QString)), SLOT(handleStdErrData(QString)));
connect(deployService(), SIGNAL(finished()), SLOT(handleFinished()));
- m_d->hasError = false;
- m_d->future = fi;
+ d->hasError = false;
+ d->future = fi;
deployService()->start();
}
void AbstractRemoteLinuxDeployStep::cancel()
{
- if (m_d->hasError)
+ if (d->hasError)
return;
emit addOutput(tr("User requests deployment to stop; cleaning up."), MessageOutput);
- m_d->hasError = true;
+ d->hasError = true;
deployService()->stop();
}
BuildStepConfigWidget *AbstractRemoteLinuxDeployStep::createConfigWidget()
{
- return new Internal::MaemoDeployStepBaseWidget(this);
+ return new RemoteLinuxDeployStepWidget(this);
}
RemoteLinuxDeployConfiguration *AbstractRemoteLinuxDeployStep::deployConfiguration() const
void AbstractRemoteLinuxDeployStep::handleErrorMessage(const QString &message)
{
+ emit addOutput(message, ErrorMessageOutput);
emit addTask(Task(Task::Error, message, QString(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
- m_d->hasError = true;
+ d->hasError = true;
+}
+
+void AbstractRemoteLinuxDeployStep::handleWarningMessage(const QString &message)
+{
+ emit addOutput(message, ErrorMessageOutput);
+ emit addTask(Task(Task::Warning, message, QString(), -1,
+ ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
}
void AbstractRemoteLinuxDeployStep::handleFinished()
{
- if (m_d->hasError)
- emit addOutput(tr("Deployment failed."), ErrorMessageOutput);
+ if (d->hasError)
+ emit addOutput(tr("Deploy step failed."), ErrorMessageOutput);
else
- emit addOutput(tr("Deployment finished."), MessageOutput);
+ emit addOutput(tr("Deploy step finished."), MessageOutput);
disconnect(deployService(), 0, this, 0);
- m_d->future.reportResult(!m_d->hasError);
+ d->future.reportResult(!d->hasError);
emit finished();
}