Qnx: Add device runtime check to build steps

Extend the previous "debug token check" build step to
a more generic "device status step" build step that can check
both debug token and device runtime.

Task-number: QTCREATORBUG-9709

Change-Id: I50fd3eb88b692678af6f0204455165e2cdcf41b2
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
This commit is contained in:
El Mehdi Fekari
2014-01-23 14:38:23 +01:00
committed by Mehdi Fekari
parent a8ea31bf09
commit 81a3ac3a10
13 changed files with 420 additions and 219 deletions

View File

@@ -1,156 +0,0 @@
/**************************************************************************
**
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
**
** Contact: BlackBerry (qt@blackberry.com)
** Contact: KDAB (info@kdab.com)
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "blackberrycheckdebugtokenstep.h"
#include "blackberrycheckdebugtokenstepconfigwidget.h"
#include "blackberrydeviceinformation.h"
#include "qnxconstants.h"
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <projectexplorer/task.h>
#include <ssh/sshconnection.h>
#include <qeventloop.h>
using namespace Qnx;
using namespace Qnx::Internal;
BlackBerryCheckDebugTokenStep::BlackBerryCheckDebugTokenStep(ProjectExplorer::BuildStepList *bsl) :
ProjectExplorer::BuildStep(bsl, Core::Id(Constants::QNX_CHECK_DEBUG_TOKEN_BS_ID))
, m_deviceInfo(0)
, m_eventLoop(0)
{
setDisplayName(tr("Check Debug Token"));
}
BlackBerryCheckDebugTokenStep::BlackBerryCheckDebugTokenStep(ProjectExplorer::BuildStepList *bsl, BlackBerryCheckDebugTokenStep *bs) :
ProjectExplorer::BuildStep(bsl, bs)
, m_deviceInfo(0)
, m_eventLoop(0)
{
setDisplayName(tr("Check Debug Token"));
}
void BlackBerryCheckDebugTokenStep::checkDeviceInfo(int status)
{
// Skip debug token check for internal non secure devices and simulators
if (m_deviceInfo->isProductionDevice() && !m_deviceInfo->isSimulator()) {
if (status != BlackBerryDeviceInformation::Success) {
switch (status) {
case BlackBerryDeviceInformation::AuthenticationFailed:
raiseError(tr("Authentication failed."));
break;
case BlackBerryDeviceInformation::NoRouteToHost:
raiseError(tr("Cannot connect to device."));
break;
case BlackBerryDeviceInformation::DevelopmentModeDisabled:
raiseError(tr("Device is not in the development mode."));
break;
case BlackBerryDeviceInformation::InferiorProcessTimedOut:
raiseError(tr("Timeout querying device information."));
break;
case BlackBerryDeviceInformation::FailedToStartInferiorProcess:
raiseError(tr("Failed to query device information."));
break;
case BlackBerryDeviceInformation::InferiorProcessCrashed:
raiseError(tr("Process to query device information has crashed."));
break;
default:
raiseError(tr("Cannot query device information."));
break;
}
m_eventLoop->exit(false);
return;
}
if (!m_deviceInfo->debugTokenValid()) {
raiseError(m_deviceInfo->debugTokenValidationError());
m_eventLoop->exit(false);
return;
}
}
m_eventLoop->exit(true);
}
void BlackBerryCheckDebugTokenStep::emitOutputInfo()
{
emit addOutput(tr("Checking debug token..."), BuildStep::MessageOutput);
}
bool BlackBerryCheckDebugTokenStep::init()
{
m_device = BlackBerryDeviceConfiguration::device(target()->kit());
if (!m_device)
return false;
if (m_device->sshParameters().host.isEmpty()) {
raiseError(tr("No hostname specified for the device"));
return false;
}
return true;
}
void BlackBerryCheckDebugTokenStep::run(QFutureInterface<bool> &fi)
{
m_eventLoop = new QEventLoop;
m_deviceInfo = new BlackBerryDeviceInformation;
connect(m_deviceInfo, SIGNAL(started()), this, SLOT(emitOutputInfo()));
connect(m_deviceInfo, SIGNAL(finished(int)), this, SLOT(checkDeviceInfo(int)), Qt::DirectConnection);
m_deviceInfo->setDeviceTarget(m_device->sshParameters().host, m_device->sshParameters().password);
bool returnValue = m_eventLoop->exec();
delete m_eventLoop;
m_eventLoop = 0;
delete m_deviceInfo;
m_deviceInfo = 0;
return fi.reportResult(returnValue);
}
ProjectExplorer::BuildStepConfigWidget *BlackBerryCheckDebugTokenStep::createConfigWidget()
{
return new BlackBerryCheckDebugTokenConfigWidget();
}
void BlackBerryCheckDebugTokenStep::raiseError(const QString &errorMessage)
{
emit addOutput(errorMessage, BuildStep::ErrorMessageOutput);
emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT));
}

View File

@@ -0,0 +1,274 @@
/**************************************************************************
**
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
**
** Contact: BlackBerry (qt@blackberry.com)
** Contact: KDAB (info@kdab.com)
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "blackberrycheckdevicestatusstep.h"
#include "blackberrycheckdevicestatusstepconfigwidget.h"
#include "blackberrydeviceinformation.h"
#include "blackberryversionnumber.h"
#include "qnxconstants.h"
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <projectexplorer/kit.h>
#include <projectexplorer/task.h>
#include <ssh/sshconnection.h>
#include <coreplugin/icore.h>
#include <qfileinfo.h>
#include <qmessagebox.h>
#include <qeventloop.h>
using namespace Qnx;
using namespace Qnx::Internal;
namespace {
const char RUNTIME_CHECK_ENABLED[] =
"Qnx.Internal.BlackBerryCheckDeviceStatusStep.RuntimeCheckEnabled";
const char DEBUG_TOKEN_CHECK_ENABLED[] =
"Qnx.Internal.BlackBerryCheckDeviceStatusStep.DebugTokenCheckEnabled";
}
BlackBerryCheckDeviceStatusStep::BlackBerryCheckDeviceStatusStep(ProjectExplorer::BuildStepList *bsl) :
ProjectExplorer::BuildStep(bsl, Core::Id(Constants::QNX_CHECK_DEVICE_STATUS_BS_ID))
, m_deviceInfo(0)
, m_eventLoop(0)
, m_runtimeCheckEnabled(true)
, m_debugTokenCheckEnabled(true)
{
setDisplayName(tr("Check Device Status"));
}
BlackBerryCheckDeviceStatusStep::BlackBerryCheckDeviceStatusStep(ProjectExplorer::BuildStepList *bsl,
BlackBerryCheckDeviceStatusStep *bs) :
ProjectExplorer::BuildStep(bsl, bs)
, m_deviceInfo(0)
, m_eventLoop(0)
, m_runtimeCheckEnabled(true)
, m_debugTokenCheckEnabled(true)
{
setDisplayName(tr("Check Device Status"));
}
void BlackBerryCheckDeviceStatusStep::checkDeviceInfo(int status)
{
if (!m_runtimeCheckEnabled && m_debugTokenCheckEnabled) {
// Skip debug token check for internal non secure devices and simulators
if (!m_deviceInfo->isProductionDevice() || m_deviceInfo->isSimulator()) {
m_eventLoop->exit(true);
return;
}
}
if (status != BlackBerryDeviceInformation::Success) {
switch (status) {
case BlackBerryDeviceInformation::AuthenticationFailed:
raiseError(tr("Authentication failed."));
break;
case BlackBerryDeviceInformation::NoRouteToHost:
raiseError(tr("Cannot connect to device."));
break;
case BlackBerryDeviceInformation::DevelopmentModeDisabled:
raiseError(tr("Device is not in the development mode."));
break;
case BlackBerryDeviceInformation::InferiorProcessTimedOut:
raiseError(tr("Timeout querying device information."));
break;
case BlackBerryDeviceInformation::FailedToStartInferiorProcess:
raiseError(tr("Failed to query device information."));
break;
case BlackBerryDeviceInformation::InferiorProcessCrashed:
raiseError(tr("Process to query device information has crashed."));
break;
default:
raiseError(tr("Cannot query device information."));
break;
}
m_eventLoop->exit(false);
return;
}
if (m_debugTokenCheckEnabled && !m_deviceInfo->debugTokenValid()) {
raiseError(m_deviceInfo->debugTokenValidationError());
m_eventLoop->exit(false);
return;
}
if (m_runtimeCheckEnabled) {
BlackBerryVersionNumber deviceRuntimeVersion(m_deviceInfo->scmBundle());
QFileInfo fi(target()->kit()->autoDetectionSource());
if (deviceRuntimeVersion.isEmpty()) {
// Skip the check if device runtime is not determined
m_eventLoop->exit(true);
raiseWarning(tr("Cannot determine device runtime version."));
return;
}
BlackBerryVersionNumber apiLevelVersion = BlackBerryVersionNumber::fromNdkEnvFileName(fi.baseName());
if (apiLevelVersion.isEmpty()) {
// Skip the check if device API level version is not determined
m_eventLoop->exit(true);
raiseWarning(tr("Cannot determine API level version."));
return;
}
bool ok = true;
if (deviceRuntimeVersion.toString() != apiLevelVersion.toString()) {
raiseError(tr("The device runtime version (%1) does not match API level version (%2)")
.arg(deviceRuntimeVersion.toString(), apiLevelVersion.toString()));
QMetaObject::invokeMethod(this, "handleVersionMismatch", Qt::BlockingQueuedConnection,
Q_RETURN_ARG(bool, ok),
Q_ARG(QString, deviceRuntimeVersion.toString()),
Q_ARG(QString, apiLevelVersion.toString()));
}
m_eventLoop->exit(ok);
return;
}
m_eventLoop->exit(true);
}
void BlackBerryCheckDeviceStatusStep::emitOutputInfo()
{
emit addOutput(tr("Checking device status..."), BuildStep::MessageOutput);
}
void BlackBerryCheckDeviceStatusStep::enableDebugTokenCheck(bool enable)
{
m_debugTokenCheckEnabled = enable;
}
void BlackBerryCheckDeviceStatusStep::enableRuntimeCheck(bool enable)
{
m_runtimeCheckEnabled = enable;
}
bool BlackBerryCheckDeviceStatusStep::handleVersionMismatch(const QString &runtimeVersion, const QString &apiLevelVersion)
{
// TODO: Check if a matching API level exists in the user configurations,
// otherwise let the user download the matching device runtime.
const QMessageBox::StandardButton answer = QMessageBox::question(Core::ICore::mainWindow(), tr("Confirmation"),
tr("The device runtime version(%1) does not match the API level version(%2).\n"
"Do you want to continue anyway?").arg(runtimeVersion, apiLevelVersion),
QMessageBox::Yes | QMessageBox::No);
return answer == QMessageBox::Yes;
}
bool BlackBerryCheckDeviceStatusStep::init()
{
m_device = BlackBerryDeviceConfiguration::device(target()->kit());
if (!m_device)
return false;
if (m_device->sshParameters().host.isEmpty()) {
raiseError(tr("No hostname specified for the device"));
return false;
}
return true;
}
void BlackBerryCheckDeviceStatusStep::run(QFutureInterface<bool> &fi)
{
if (!m_runtimeCheckEnabled && !m_debugTokenCheckEnabled)
return fi.reportResult(true);
m_eventLoop = new QEventLoop;
m_deviceInfo = new BlackBerryDeviceInformation;
connect(m_deviceInfo, SIGNAL(started()), this, SLOT(emitOutputInfo()));
connect(m_deviceInfo, SIGNAL(finished(int)), this, SLOT(checkDeviceInfo(int)), Qt::DirectConnection);
m_deviceInfo->setDeviceTarget(m_device->sshParameters().host, m_device->sshParameters().password);
bool returnValue = m_eventLoop->exec();
delete m_eventLoop;
m_eventLoop = 0;
delete m_deviceInfo;
m_deviceInfo = 0;
return fi.reportResult(returnValue);
}
ProjectExplorer::BuildStepConfigWidget *BlackBerryCheckDeviceStatusStep::createConfigWidget()
{
return new BlackBerryCheckDeviceStatusStepConfigWidget(this);
}
void BlackBerryCheckDeviceStatusStep::raiseError(const QString &errorMessage)
{
emit addOutput(errorMessage, BuildStep::ErrorMessageOutput);
emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT));
}
void BlackBerryCheckDeviceStatusStep::raiseWarning(const QString &warningMessage)
{
emit addOutput(warningMessage, BuildStep::ErrorOutput);
emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Warning, warningMessage, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT));
}
bool BlackBerryCheckDeviceStatusStep::fromMap(const QVariantMap &map)
{
m_runtimeCheckEnabled = map.value(QLatin1String(RUNTIME_CHECK_ENABLED), false).toBool();
m_debugTokenCheckEnabled = map.value(QLatin1String(DEBUG_TOKEN_CHECK_ENABLED), false).toBool();
return BuildStep::fromMap(map);
}
QVariantMap BlackBerryCheckDeviceStatusStep::toMap() const
{
QVariantMap map = BuildStep::toMap();
map.insert(QLatin1String(RUNTIME_CHECK_ENABLED), m_runtimeCheckEnabled);
map.insert(QLatin1String(DEBUG_TOKEN_CHECK_ENABLED), m_debugTokenCheckEnabled);
return map;
}
bool BlackBerryCheckDeviceStatusStep::debugTokenCheckEnabled() const
{
return m_debugTokenCheckEnabled;
}
bool BlackBerryCheckDeviceStatusStep::runtimeCheckEnabled() const
{
return m_runtimeCheckEnabled;
}

View File

@@ -29,8 +29,8 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEP_H #ifndef QNX_INTERNAL_BLACKBERRYCHECKDEVICESTATUSSTEP_H
#define QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEP_H #define QNX_INTERNAL_BLACKBERRYCHECKDEVICESTATUSSTEP_H
#include "blackberrydeviceconfiguration.h" #include "blackberrydeviceconfiguration.h"
@@ -44,34 +44,50 @@ namespace Qnx {
namespace Internal { namespace Internal {
class BlackBerryDeviceInformation; class BlackBerryDeviceInformation;
class BlackBerryCheckDebugTokenStep : public ProjectExplorer::BuildStep class BlackBerryCheckDeviceStatusStep : public ProjectExplorer::BuildStep
{ {
Q_OBJECT Q_OBJECT
friend class BlackBerryCheckDebugTokenStepFactory; friend class BlackBerryCheckDeviceStatusStepFactory;
public: public:
explicit BlackBerryCheckDebugTokenStep(ProjectExplorer::BuildStepList *bsl); explicit BlackBerryCheckDeviceStatusStep(ProjectExplorer::BuildStepList *bsl);
bool init(); bool init();
void run(QFutureInterface<bool> &fi); void run(QFutureInterface<bool> &fi);
ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
void raiseError(const QString& error); void raiseError(const QString &error);
void raiseWarning(const QString &warning);
bool fromMap(const QVariantMap &map);
QVariantMap toMap() const;
bool debugTokenCheckEnabled () const;
bool runtimeCheckEnabled() const;
protected: protected:
BlackBerryCheckDebugTokenStep(ProjectExplorer::BuildStepList *bsl, BlackBerryCheckDebugTokenStep *bs); BlackBerryCheckDeviceStatusStep(ProjectExplorer::BuildStepList *bsl,
BlackBerryCheckDeviceStatusStep *bs);
protected slots: protected slots:
void checkDeviceInfo(int status); void checkDeviceInfo(int status);
void emitOutputInfo(); void emitOutputInfo();
void enableDebugTokenCheck(bool enable);
void enableRuntimeCheck(bool enable);
bool handleVersionMismatch(const QString &runtimeVersion, const QString &apiLevelVersion);
private: private:
BlackBerryDeviceInformation *m_deviceInfo; BlackBerryDeviceInformation *m_deviceInfo;
BlackBerryDeviceConfiguration::ConstPtr m_device; BlackBerryDeviceConfiguration::ConstPtr m_device;
QEventLoop *m_eventLoop; QEventLoop *m_eventLoop;
bool m_runtimeCheckEnabled;
bool m_debugTokenCheckEnabled;
}; };
} // namespace Internal } // namespace Internal
} // namespace Qnx } // namespace Qnx
#endif // QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEP_H #endif // QNX_INTERNAL_BLACKBERRYCHECKDEVICESTATUSSTEP_H

View File

@@ -29,27 +29,45 @@
** **
****************************************************************************/ ****************************************************************************/
#include "blackberrycheckdebugtokenstepconfigwidget.h" #include "blackberrycheckdevicestatusstepconfigwidget.h"
#include "ui_blackberrycheckdevicestatusstepconfigwidget.h"
#include "blackberrycheckdevicestatusstep.h"
using namespace Qnx; using namespace Qnx;
using namespace Qnx::Internal; using namespace Qnx::Internal;
BlackBerryCheckDebugTokenConfigWidget::BlackBerryCheckDebugTokenConfigWidget() : BlackBerryCheckDeviceStatusStepConfigWidget::BlackBerryCheckDeviceStatusStepConfigWidget(
ProjectExplorer::BuildStepConfigWidget() BlackBerryCheckDeviceStatusStep *checkDeviceStatuStep)
: ProjectExplorer::BuildStepConfigWidget()
, m_checkDeviceStatusStep(checkDeviceStatuStep)
, m_ui(new Ui::BlackBerryCheckDeviceStatusStepConfigWidget)
{ {
m_ui->setupUi(this);
m_ui->checkRuntime->setChecked(m_checkDeviceStatusStep->runtimeCheckEnabled());
m_ui->checkDebugToken->setChecked(m_checkDeviceStatusStep->debugTokenCheckEnabled());
connect(m_ui->checkRuntime, SIGNAL(clicked(bool)),
m_checkDeviceStatusStep, SLOT(enableRuntimeCheck(bool)));
connect(m_ui->checkDebugToken, SIGNAL(clicked(bool)),
m_checkDeviceStatusStep, SLOT(enableDebugTokenCheck(bool)));
} }
QString BlackBerryCheckDebugTokenConfigWidget::displayName() const BlackBerryCheckDeviceStatusStepConfigWidget::~BlackBerryCheckDeviceStatusStepConfigWidget()
{ {
return tr("<b>Check debug token</b>"); delete m_ui;
} }
QString BlackBerryCheckDebugTokenConfigWidget::summaryText() const QString BlackBerryCheckDeviceStatusStepConfigWidget::displayName() const
{
return tr("<b>Check device status</b>");
}
QString BlackBerryCheckDeviceStatusStepConfigWidget::summaryText() const
{ {
return displayName(); return displayName();
} }
bool BlackBerryCheckDebugTokenConfigWidget::showWidget() const bool BlackBerryCheckDeviceStatusStepConfigWidget::showWidget() const
{ {
return false; return true;
} }

View File

@@ -29,27 +29,37 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEPCONFIGWIDGET_H #ifndef QNX_INTERNAL_BLACKBERRYCHECKDEVICESTATUSSTEPCONFIGWIDGET_H
#define QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEPCONFIGWIDGET_H #define QNX_INTERNAL_BLACKBERRYCHECKDEVICESTATUSSTEPCONFIGWIDGET_H
#include <projectexplorer/buildstep.h> #include <projectexplorer/buildstep.h>
namespace Qnx { namespace Qnx {
namespace Internal { namespace Internal {
class BlackBerryCheckDebugTokenConfigWidget : public ProjectExplorer::BuildStepConfigWidget namespace Ui {
class BlackBerryCheckDeviceStatusStepConfigWidget;
}
class BlackBerryCheckDeviceStatusStep;
class BlackBerryCheckDeviceStatusStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit BlackBerryCheckDebugTokenConfigWidget(); explicit BlackBerryCheckDeviceStatusStepConfigWidget(
BlackBerryCheckDeviceStatusStep *checkDeviceStatuStep);
~BlackBerryCheckDeviceStatusStepConfigWidget();
QString displayName() const; QString displayName() const;
QString summaryText() const; QString summaryText() const;
bool showWidget() const; bool showWidget() const;
private:
BlackBerryCheckDeviceStatusStep *m_checkDeviceStatusStep;
Ui::BlackBerryCheckDeviceStatusStepConfigWidget *m_ui;
}; };
} // namespace Internal } // namespace Internal
} // namespace Qnx } // namespace Qnx
#endif // QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPCONFIGWIDGET_H #endif // QNX_INTERNAL_BLACKBERRYCHECKDEVICESTATUSSTEPCONFIGWIDGET_H

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Qnx::Internal::BlackBerryCheckDeviceStatusStepConfigWidget</class>
<widget class="QWidget" name="Qnx::Internal::BlackBerryCheckDeviceStatusStepConfigWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>126</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkRuntime">
<property name="text">
<string>Check Device Runtime</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkDebugToken">
<property name="text">
<string>Check Debug Token</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -29,9 +29,9 @@
** **
****************************************************************************/ ****************************************************************************/
#include "blackberrycheckdebugtokenstepfactory.h" #include "blackberrycheckdevicestatusstepfactory.h"
#include "blackberrycheckdebugtokenstep.h" #include "blackberrycheckdevicestatusstep.h"
#include "blackberrydeviceconfigurationfactory.h" #include "blackberrydeviceconfigurationfactory.h"
#include "qnxconstants.h" #include "qnxconstants.h"
@@ -43,12 +43,13 @@
using namespace Qnx; using namespace Qnx;
using namespace Qnx::Internal; using namespace Qnx::Internal;
BlackBerryCheckDebugTokenStepFactory::BlackBerryCheckDebugTokenStepFactory(QObject *parent) : BlackBerryCheckDeviceStatusStepFactory::BlackBerryCheckDeviceStatusStepFactory(QObject *parent) :
ProjectExplorer::IBuildStepFactory(parent) ProjectExplorer::IBuildStepFactory(parent)
{ {
} }
QList<Core::Id> BlackBerryCheckDebugTokenStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const QList<Core::Id> BlackBerryCheckDeviceStatusStepFactory::availableCreationIds(
ProjectExplorer::BuildStepList *parent) const
{ {
if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY) if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
return QList<Core::Id>(); return QList<Core::Id>();
@@ -57,52 +58,53 @@ QList<Core::Id> BlackBerryCheckDebugTokenStepFactory::availableCreationIds(Proje
if (deviceType != BlackBerryDeviceConfigurationFactory::deviceType()) if (deviceType != BlackBerryDeviceConfigurationFactory::deviceType())
return QList<Core::Id>(); return QList<Core::Id>();
return QList<Core::Id>() << Core::Id(Constants::QNX_CHECK_DEBUG_TOKEN_BS_ID); return QList<Core::Id>() << Core::Id(Constants::QNX_CHECK_DEVICE_STATUS_BS_ID);
} }
QString BlackBerryCheckDebugTokenStepFactory::displayNameForId(const Core::Id id) const QString BlackBerryCheckDeviceStatusStepFactory::displayNameForId(const Core::Id id) const
{ {
if (id == Constants::QNX_CHECK_DEBUG_TOKEN_BS_ID) if (id == Constants::QNX_CHECK_DEVICE_STATUS_BS_ID)
return tr("Check Debug Token"); return tr("Check Device Status");
return QString(); return QString();
} }
bool BlackBerryCheckDebugTokenStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const bool BlackBerryCheckDeviceStatusStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
{ {
return availableCreationIds(parent).contains(id); return availableCreationIds(parent).contains(id);
} }
ProjectExplorer::BuildStep *BlackBerryCheckDebugTokenStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id) ProjectExplorer::BuildStep *BlackBerryCheckDeviceStatusStepFactory::create(ProjectExplorer::BuildStepList *parent,
const Core::Id id)
{ {
if (!canCreate(parent, id)) if (!canCreate(parent, id))
return 0; return 0;
return new BlackBerryCheckDebugTokenStep(parent); return new BlackBerryCheckDeviceStatusStep(parent);
} }
bool BlackBerryCheckDebugTokenStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const bool BlackBerryCheckDeviceStatusStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const
{ {
return canCreate(parent, ProjectExplorer::idFromMap(map)); return canCreate(parent, ProjectExplorer::idFromMap(map));
} }
ProjectExplorer::BuildStep *BlackBerryCheckDebugTokenStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) ProjectExplorer::BuildStep *BlackBerryCheckDeviceStatusStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map)
{ {
if (!canRestore(parent, map)) if (!canRestore(parent, map))
return 0; return 0;
BlackBerryCheckDebugTokenStep *bs = new BlackBerryCheckDebugTokenStep(parent); BlackBerryCheckDeviceStatusStep *bs = new BlackBerryCheckDeviceStatusStep(parent);
if (bs->fromMap(map)) if (bs->fromMap(map))
return bs; return bs;
delete bs; delete bs;
return 0; return 0;
} }
bool BlackBerryCheckDebugTokenStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const bool BlackBerryCheckDeviceStatusStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const
{ {
return canCreate(parent, product->id()); return canCreate(parent, product->id());
} }
ProjectExplorer::BuildStep *BlackBerryCheckDebugTokenStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) ProjectExplorer::BuildStep *BlackBerryCheckDeviceStatusStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product)
{ {
if (!canClone(parent, product)) if (!canClone(parent, product))
return 0; return 0;
return new BlackBerryCheckDebugTokenStep(parent, static_cast<BlackBerryCheckDebugTokenStep *>(product)); return new BlackBerryCheckDeviceStatusStep(parent, static_cast<BlackBerryCheckDeviceStatusStep *>(product));
} }

View File

@@ -29,19 +29,19 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEPFACTORY_H #ifndef QNX_INTERNAL_BLACKBERRYCHECKDEVICESTATUSSTEPFACTORY_H
#define QNX_INTERNAL_BLACKBERRYCHECKDEBUGTOKENSTEPFACTORY_H #define QNX_INTERNAL_BLACKBERRYCHECKDEVICESTATUSSTEPFACTORY_H
#include <projectexplorer/buildstep.h> #include <projectexplorer/buildstep.h>
namespace Qnx { namespace Qnx {
namespace Internal { namespace Internal {
class BlackBerryCheckDebugTokenStepFactory : public ProjectExplorer::IBuildStepFactory class BlackBerryCheckDeviceStatusStepFactory : public ProjectExplorer::IBuildStepFactory
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit BlackBerryCheckDebugTokenStepFactory(QObject *parent = 0); explicit BlackBerryCheckDeviceStatusStepFactory(QObject *parent = 0);
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const; QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
QString displayNameForId(const Core::Id id) const; QString displayNameForId(const Core::Id id) const;
@@ -61,4 +61,4 @@ public:
} // namespace Internal } // namespace Internal
} // namespace Qnx } // namespace Qnx
#endif // QNX_INTERNAL_BLACKBERRYCHECKDEVMODESTEPFACTORY_H #endif // QNX_INTERNAL_BLACKBERRYCHECKDEVICESTATUSSTEPFACTORY_H

View File

@@ -32,7 +32,7 @@
#include "blackberrydeployconfigurationfactory.h" #include "blackberrydeployconfigurationfactory.h"
#include "qnxconstants.h" #include "qnxconstants.h"
#include "blackberrycheckdebugtokenstep.h" #include "blackberrycheckdevicestatusstep.h"
#include "blackberrydeployconfiguration.h" #include "blackberrydeployconfiguration.h"
#include "blackberrycreatepackagestep.h" #include "blackberrycreatepackagestep.h"
#include "blackberrydeploystep.h" #include "blackberrydeploystep.h"
@@ -93,7 +93,7 @@ ProjectExplorer::DeployConfiguration *BlackBerryDeployConfigurationFactory::crea
return 0; return 0;
BlackBerryDeployConfiguration *dc = new BlackBerryDeployConfiguration(parent); BlackBerryDeployConfiguration *dc = new BlackBerryDeployConfiguration(parent);
dc->stepList()->insertStep(0, new BlackBerryCheckDebugTokenStep(dc->stepList())); dc->stepList()->insertStep(0, new BlackBerryCheckDeviceStatusStep(dc->stepList()));
dc->stepList()->insertStep(1, new BlackBerryCreatePackageStep(dc->stepList())); dc->stepList()->insertStep(1, new BlackBerryCreatePackageStep(dc->stepList()));
dc->stepList()->insertStep(2, new BlackBerryDeployStep(dc->stepList())); dc->stepList()->insertStep(2, new BlackBerryDeployStep(dc->stepList()));
return dc; return dc;

View File

@@ -68,9 +68,6 @@ SOURCES += qnxplugin.cpp \
blackberrydebugtokenuploader.cpp \ blackberrydebugtokenuploader.cpp \
blackberrydebugtokenreader.cpp \ blackberrydebugtokenreader.cpp \
blackberryndkprocess.cpp \ blackberryndkprocess.cpp \
blackberrycheckdebugtokenstep.cpp \
blackberrycheckdebugtokenstepconfigwidget.cpp \
blackberrycheckdebugtokenstepfactory.cpp \
blackberrydeviceconnection.cpp \ blackberrydeviceconnection.cpp \
blackberrydeviceconnectionmanager.cpp \ blackberrydeviceconnectionmanager.cpp \
blackberrydeviceinformation.cpp \ blackberrydeviceinformation.cpp \
@@ -99,7 +96,10 @@ SOURCES += qnxplugin.cpp \
qnxtoolchain.cpp \ qnxtoolchain.cpp \
slog2inforunner.cpp \ slog2inforunner.cpp \
blackberryversionnumber.cpp \ blackberryversionnumber.cpp \
blackberrydebugtokenpinsdialog.cpp blackberrydebugtokenpinsdialog.cpp \
blackberrycheckdevicestatusstepfactory.cpp \
blackberrycheckdevicestatusstepconfigwidget.cpp \
blackberrycheckdevicestatusstep.cpp
HEADERS += qnxplugin.h\ HEADERS += qnxplugin.h\
qnxconstants.h \ qnxconstants.h \
@@ -167,9 +167,6 @@ HEADERS += qnxplugin.h\
blackberrydebugtokenuploader.h \ blackberrydebugtokenuploader.h \
blackberrydebugtokenreader.h \ blackberrydebugtokenreader.h \
blackberryndkprocess.h \ blackberryndkprocess.h \
blackberrycheckdebugtokenstep.h \
blackberrycheckdebugtokenstepconfigwidget.h \
blackberrycheckdebugtokenstepfactory.h \
blackberrydeviceconnection.h \ blackberrydeviceconnection.h \
blackberrydeviceconnectionmanager.h \ blackberrydeviceconnectionmanager.h \
blackberrydeviceinformation.h \ blackberrydeviceinformation.h \
@@ -198,7 +195,10 @@ HEADERS += qnxplugin.h\
qnxtoolchain.h \ qnxtoolchain.h \
slog2inforunner.h \ slog2inforunner.h \
blackberryversionnumber.h \ blackberryversionnumber.h \
blackberrydebugtokenpinsdialog.h blackberrydebugtokenpinsdialog.h \
blackberrycheckdevicestatusstep.h \
blackberrycheckdevicestatusstepfactory.h \
blackberrycheckdevicestatusstepconfigwidget.h
FORMS += \ FORMS += \
@@ -231,7 +231,8 @@ FORMS += \
blackberryinstallwizardndkpage.ui \ blackberryinstallwizardndkpage.ui \
blackberryinstallwizardprocesspage.ui \ blackberryinstallwizardprocesspage.ui \
blackberryinstallwizardoptionpage.ui \ blackberryinstallwizardoptionpage.ui \
blackberrydebugtokenpinsdialog.ui blackberrydebugtokenpinsdialog.ui \
blackberrycheckdevicestatusstepconfigwidget.ui
include(../../private_headers.pri) include(../../private_headers.pri)
include(./cascadesimport/cascadesimport.pri) include(./cascadesimport/cascadesimport.pri)

View File

@@ -57,12 +57,13 @@ QtcPlugin {
"blackberryabstractdeploystep.h", "blackberryabstractdeploystep.h",
"blackberryapplicationrunner.cpp", "blackberryapplicationrunner.cpp",
"blackberryapplicationrunner.h", "blackberryapplicationrunner.h",
"blackberrycheckdebugtokenstep.cpp", "blackberrycheckdevicestatusstep.cpp",
"blackberrycheckdebugtokenstep.h", "blackberrycheckdevicestatusstep.h",
"blackberrycheckdebugtokenstepconfigwidget.cpp", "blackberrycheckdevicestatusstepconfigwidget.cpp",
"blackberrycheckdebugtokenstepconfigwidget.h", "blackberrycheckdevicestatusstepconfigwidget.h",
"blackberrycheckdebugtokenstepfactory.cpp", "blackberrycheckdevicestatusstepconfigwidget.ui",
"blackberrycheckdebugtokenstepfactory.h", "blackberrycheckdevicestatusstepfactory.cpp",
"blackberrycheckdevicestatusstepfactory.h",
"blackberryconfigurationmanager.cpp", "blackberryconfigurationmanager.cpp",
"blackberryconfigurationmanager.h", "blackberryconfigurationmanager.h",
"blackberrycreatepackagestep.cpp", "blackberrycreatepackagestep.cpp",

View File

@@ -69,7 +69,7 @@ const char QNX_QNX_RUNCONFIGURATION_PREFIX[] = "Qt4ProjectManager.QNX.QNXRunConf
const char QNX_CREATE_PACKAGE_BS_ID[] = "Qt4ProjectManager.QnxCreatePackageBuildStep"; const char QNX_CREATE_PACKAGE_BS_ID[] = "Qt4ProjectManager.QnxCreatePackageBuildStep";
const char QNX_DEPLOY_PACKAGE_BS_ID[] = "Qt4ProjectManager.QnxDeployPackageBuildStep"; const char QNX_DEPLOY_PACKAGE_BS_ID[] = "Qt4ProjectManager.QnxDeployPackageBuildStep";
const char QNX_CHECK_DEBUG_TOKEN_BS_ID[] = "Qt4ProjectManager.QnxCheckDebugTokenBuildStep"; const char QNX_CHECK_DEVICE_STATUS_BS_ID[] = "Qt4ProjectManager.QnxCheckDeviceStatusBuildStep";
const char QNX_PROFILEPATH_KEY[] = "Qt4ProjectManager.QnxRunConfiguration.ProFilePath"; const char QNX_PROFILEPATH_KEY[] = "Qt4ProjectManager.QnxRunConfiguration.ProFilePath";

View File

@@ -49,7 +49,7 @@
#include "bardescriptoreditorfactory.h" #include "bardescriptoreditorfactory.h"
#include "bardescriptormagicmatcher.h" #include "bardescriptormagicmatcher.h"
#include "blackberrykeyspage.h" #include "blackberrykeyspage.h"
#include "blackberrycheckdebugtokenstepfactory.h" #include "blackberrycheckdevicestatusstepfactory.h"
#include "blackberrydeviceconnectionmanager.h" #include "blackberrydeviceconnectionmanager.h"
#include "blackberryconfigurationmanager.h" #include "blackberryconfigurationmanager.h"
#include "blackberryconfiguration.h" #include "blackberryconfiguration.h"
@@ -91,7 +91,7 @@ bool QNXPlugin::initialize(const QStringList &arguments, QString *errorString)
addAutoReleasedObject(new BlackBerryRunControlFactory); addAutoReleasedObject(new BlackBerryRunControlFactory);
addAutoReleasedObject(new BlackBerryNDKSettingsPage); addAutoReleasedObject(new BlackBerryNDKSettingsPage);
addAutoReleasedObject(new BlackBerryKeysPage); addAutoReleasedObject(new BlackBerryKeysPage);
addAutoReleasedObject(new BlackBerryCheckDebugTokenStepFactory); addAutoReleasedObject(new BlackBerryCheckDeviceStatusStepFactory);
addAutoReleasedObject(new CascadesImportWizard); addAutoReleasedObject(new CascadesImportWizard);
BlackBerryDeviceConnectionManager::instance()->initialize(); BlackBerryDeviceConnectionManager::instance()->initialize();