forked from qt-creator/qt-creator
Qnx: Add support for pure QNX configurations
This is a first patch that adds basic support to manage user's QNX configurations. Change-Id: I273939d39e4353dabc2ae3873d7d7be6b3ca9d47 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
This commit is contained in:
committed by
Mehdi Fekari
parent
f1795d9748
commit
317fe1f447
@@ -71,7 +71,6 @@ const QLatin1String NDKPathKey("NDKPath");
|
|||||||
const QLatin1String NDKDisplayNameKey("NDKDisplayName");
|
const QLatin1String NDKDisplayNameKey("NDKDisplayName");
|
||||||
const QLatin1String NDKTargetKey("NDKTarget");
|
const QLatin1String NDKTargetKey("NDKTarget");
|
||||||
const QLatin1String NDKHostKey("NDKHost");
|
const QLatin1String NDKHostKey("NDKHost");
|
||||||
const QLatin1String NDKVersionKey("NDKVersion");
|
|
||||||
const QLatin1String NDKAutoDetectionSourceKey("NDKAutoDetectionSource");
|
const QLatin1String NDKAutoDetectionSourceKey("NDKAutoDetectionSource");
|
||||||
const QLatin1String NDKAutoDetectedKey("NDKAutoDetectedKey");
|
const QLatin1String NDKAutoDetectedKey("NDKAutoDetectedKey");
|
||||||
|
|
||||||
@@ -79,7 +78,7 @@ const QLatin1String NDKAutoDetectedKey("NDKAutoDetectedKey");
|
|||||||
bool BlackBerryApiLevelConfiguration::m_fakeConfig = false;
|
bool BlackBerryApiLevelConfiguration::m_fakeConfig = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BlackBerryApiLevelConfiguration::BlackBerryApiLevelConfiguration(const NdkInstallInformation &ndkInstallInfo)
|
BlackBerryApiLevelConfiguration::BlackBerryApiLevelConfiguration(const ConfigInstallInformation &ndkInstallInfo)
|
||||||
: QnxBaseConfiguration(FileName::fromString(
|
: QnxBaseConfiguration(FileName::fromString(
|
||||||
QnxUtils::envFilePath(ndkInstallInfo.path, ndkInstallInfo.version)))
|
QnxUtils::envFilePath(ndkInstallInfo.path, ndkInstallInfo.version)))
|
||||||
{
|
{
|
||||||
@@ -88,8 +87,8 @@ BlackBerryApiLevelConfiguration::BlackBerryApiLevelConfiguration(const NdkInstal
|
|||||||
// The QNX_TARGET value is using Unix-like separator on all platforms.
|
// The QNX_TARGET value is using Unix-like separator on all platforms.
|
||||||
m_targetName = ndkInstallInfo.target.split(sep).first().split(QLatin1Char('/')).last();
|
m_targetName = ndkInstallInfo.target.split(sep).first().split(QLatin1Char('/')).last();
|
||||||
m_sysRoot = FileName::fromString(ndkInstallInfo.target);
|
m_sysRoot = FileName::fromString(ndkInstallInfo.target);
|
||||||
m_version = BlackBerryVersionNumber(ndkInstallInfo.version);
|
|
||||||
m_autoDetectionSource = Utils::FileName::fromString(ndkInstallInfo.installationXmlFilePath);
|
m_autoDetectionSource = Utils::FileName::fromString(ndkInstallInfo.installationXmlFilePath);
|
||||||
|
setVersion(QnxVersionNumber(ndkInstallInfo.version));
|
||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,9 +103,9 @@ BlackBerryApiLevelConfiguration::BlackBerryApiLevelConfiguration(const FileName
|
|||||||
if (QDir(ndkTarget).exists())
|
if (QDir(ndkTarget).exists())
|
||||||
m_sysRoot = FileName::fromString(ndkTarget);
|
m_sysRoot = FileName::fromString(ndkTarget);
|
||||||
|
|
||||||
m_version = BlackBerryVersionNumber::fromNdkEnvFileName(QFileInfo(envFile().toString()).baseName());
|
setVersion(QnxVersionNumber::fromNdkEnvFileName(QFileInfo(envFile().toString()).baseName()));
|
||||||
if (m_version.isEmpty())
|
if (version().isEmpty())
|
||||||
m_version = BlackBerryVersionNumber::fromTargetName(m_targetName);
|
setVersion(QnxVersionNumber::fromTargetName(m_targetName));
|
||||||
|
|
||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
@@ -119,7 +118,6 @@ BlackBerryApiLevelConfiguration::BlackBerryApiLevelConfiguration(const QVariantM
|
|||||||
// The QNX_TARGET value is using Unix-like separator on all platforms.
|
// The QNX_TARGET value is using Unix-like separator on all platforms.
|
||||||
m_targetName = data.value(NDKTargetKey).toString().split(sep).first().split(QLatin1Char('/')).last();
|
m_targetName = data.value(NDKTargetKey).toString().split(sep).first().split(QLatin1Char('/')).last();
|
||||||
m_sysRoot = FileName::fromString(data.value(NDKTargetKey).toString());
|
m_sysRoot = FileName::fromString(data.value(NDKTargetKey).toString());
|
||||||
m_version = BlackBerryVersionNumber(data.value(NDKVersionKey).toString());
|
|
||||||
if (data.value(QLatin1String(NDKAutoDetectedKey)).toBool())
|
if (data.value(QLatin1String(NDKAutoDetectedKey)).toBool())
|
||||||
m_autoDetectionSource = Utils::FileName::fromString(data.value(NDKAutoDetectionSourceKey).toString());
|
m_autoDetectionSource = Utils::FileName::fromString(data.value(NDKAutoDetectionSourceKey).toString());
|
||||||
|
|
||||||
@@ -153,11 +151,6 @@ QString BlackBerryApiLevelConfiguration::targetName() const
|
|||||||
return m_targetName;
|
return m_targetName;
|
||||||
}
|
}
|
||||||
|
|
||||||
BlackBerryVersionNumber BlackBerryApiLevelConfiguration::version() const
|
|
||||||
{
|
|
||||||
return m_version;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool BlackBerryApiLevelConfiguration::isAutoDetected() const
|
bool BlackBerryApiLevelConfiguration::isAutoDetected() const
|
||||||
{
|
{
|
||||||
return !m_autoDetectionSource.isEmpty();
|
return !m_autoDetectionSource.isEmpty();
|
||||||
@@ -217,7 +210,6 @@ QVariantMap BlackBerryApiLevelConfiguration::toMap() const
|
|||||||
data.insert(QLatin1String(NDKDisplayNameKey), m_displayName);
|
data.insert(QLatin1String(NDKDisplayNameKey), m_displayName);
|
||||||
data.insert(QLatin1String(NDKPathKey), ndkPath());
|
data.insert(QLatin1String(NDKPathKey), ndkPath());
|
||||||
data.insert(QLatin1String(NDKTargetKey), m_sysRoot.toString());
|
data.insert(QLatin1String(NDKTargetKey), m_sysRoot.toString());
|
||||||
data.insert(QLatin1String(NDKVersionKey), m_version.toString());
|
|
||||||
data.insert(QLatin1String(NDKAutoDetectionSourceKey), m_autoDetectionSource.toString());
|
data.insert(QLatin1String(NDKAutoDetectionSourceKey), m_autoDetectionSource.toString());
|
||||||
data.insert(QLatin1String(NDKAutoDetectedKey), isAutoDetected());
|
data.insert(QLatin1String(NDKAutoDetectedKey), isAutoDetected());
|
||||||
return data;
|
return data;
|
||||||
@@ -310,8 +302,8 @@ bool BlackBerryApiLevelConfiguration::activate()
|
|||||||
|
|
||||||
deactivate(); // cleaning-up artifacts autodetected by old QtCreator versions
|
deactivate(); // cleaning-up artifacts autodetected by old QtCreator versions
|
||||||
|
|
||||||
QString armVersionName = tr("BlackBerry %1 Device").arg(m_version.toString());
|
QString armVersionName = tr("BlackBerry %1 Device").arg(version().toString());
|
||||||
QString x86VersionName = tr("BlackBerry %1 Simulator").arg(m_version.toString());
|
QString x86VersionName = tr("BlackBerry %1 Simulator").arg(version().toString());
|
||||||
|
|
||||||
// create versions
|
// create versions
|
||||||
QnxAbstractQtVersion *qt4ArmVersion = 0;
|
QnxAbstractQtVersion *qt4ArmVersion = 0;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#define BLACKBERRYCONFIGURATIONS_H
|
#define BLACKBERRYCONFIGURATIONS_H
|
||||||
|
|
||||||
#include "qnxutils.h"
|
#include "qnxutils.h"
|
||||||
#include "blackberryversionnumber.h"
|
#include "qnxversionnumber.h"
|
||||||
#include "qnxbaseconfiguration.h"
|
#include "qnxbaseconfiguration.h"
|
||||||
#include "qnxconstants.h"
|
#include "qnxconstants.h"
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ class BlackBerryApiLevelConfiguration : public QnxBaseConfiguration
|
|||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::BlackBerryApiLevelConfiguration)
|
Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::BlackBerryApiLevelConfiguration)
|
||||||
public:
|
public:
|
||||||
BlackBerryApiLevelConfiguration(const NdkInstallInformation &ndkInstallInfo);
|
BlackBerryApiLevelConfiguration(const ConfigInstallInformation &ndkInstallInfo);
|
||||||
BlackBerryApiLevelConfiguration(const Utils::FileName &ndkEnvFile);
|
BlackBerryApiLevelConfiguration(const Utils::FileName &ndkEnvFile);
|
||||||
BlackBerryApiLevelConfiguration(const QVariantMap &data);
|
BlackBerryApiLevelConfiguration(const QVariantMap &data);
|
||||||
bool activate();
|
bool activate();
|
||||||
@@ -67,7 +67,6 @@ public:
|
|||||||
QString ndkPath() const;
|
QString ndkPath() const;
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
QString targetName() const;
|
QString targetName() const;
|
||||||
BlackBerryVersionNumber version() const;
|
|
||||||
bool isAutoDetected() const;
|
bool isAutoDetected() const;
|
||||||
Utils::FileName autoDetectionSource() const;
|
Utils::FileName autoDetectionSource() const;
|
||||||
bool isActive() const;
|
bool isActive() const;
|
||||||
@@ -92,7 +91,6 @@ protected:
|
|||||||
private:
|
private:
|
||||||
QString m_displayName;
|
QString m_displayName;
|
||||||
QString m_targetName;
|
QString m_targetName;
|
||||||
BlackBerryVersionNumber m_version;
|
|
||||||
Utils::FileName m_autoDetectionSource;
|
Utils::FileName m_autoDetectionSource;
|
||||||
Utils::FileName m_qmake4BinaryFile;
|
Utils::FileName m_qmake4BinaryFile;
|
||||||
Utils::FileName m_qmake5BinaryFile;
|
Utils::FileName m_qmake5BinaryFile;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ BlackBerryApplicationRunner::BlackBerryApplicationRunner(const BlackBerryApplica
|
|||||||
m_deployCmd = m_environment.searchInPath(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD));
|
m_deployCmd = m_environment.searchInPath(QLatin1String(Constants::QNX_BLACKBERRY_DEPLOY_CMD));
|
||||||
|
|
||||||
QFileInfo fi(target->kit()->autoDetectionSource());
|
QFileInfo fi(target->kit()->autoDetectionSource());
|
||||||
m_bbApiLevelVersion = BlackBerryVersionNumber::fromNdkEnvFileName(fi.baseName());
|
m_bbApiLevelVersion = QnxVersionNumber::fromNdkEnvFileName(fi.baseName());
|
||||||
|
|
||||||
m_device = BlackBerryDeviceConfiguration::device(target->kit());
|
m_device = BlackBerryDeviceConfiguration::device(target->kit());
|
||||||
m_barPackage = runConfiguration->barPackage();
|
m_barPackage = runConfiguration->barPackage();
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#include "blackberrydeviceconfiguration.h"
|
#include "blackberrydeviceconfiguration.h"
|
||||||
#include "blackberryprocessparser.h"
|
#include "blackberryprocessparser.h"
|
||||||
#include "blackberryversionnumber.h"
|
#include "qnxversionnumber.h"
|
||||||
|
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ private:
|
|||||||
QTimer *m_runningStateTimer;
|
QTimer *m_runningStateTimer;
|
||||||
QProcess *m_runningStateProcess;
|
QProcess *m_runningStateProcess;
|
||||||
|
|
||||||
BlackBerryVersionNumber m_bbApiLevelVersion;
|
QnxVersionNumber m_bbApiLevelVersion;
|
||||||
|
|
||||||
int m_qmlDebugServerPort;
|
int m_qmlDebugServerPort;
|
||||||
QProcess *m_checkQmlJsDebugArgumentsProcess;
|
QProcess *m_checkQmlJsDebugArgumentsProcess;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include "blackberrycheckdevicestatusstepconfigwidget.h"
|
#include "blackberrycheckdevicestatusstepconfigwidget.h"
|
||||||
#include "blackberrydeviceinformation.h"
|
#include "blackberrydeviceinformation.h"
|
||||||
#include "blackberryversionnumber.h"
|
#include "qnxversionnumber.h"
|
||||||
#include "qnxconstants.h"
|
#include "qnxconstants.h"
|
||||||
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
@@ -131,7 +131,7 @@ void BlackBerryCheckDeviceStatusStep::checkDeviceInfo(int status)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_runtimeCheckEnabled) {
|
if (m_runtimeCheckEnabled) {
|
||||||
BlackBerryVersionNumber deviceRuntimeVersion(m_deviceInfo->scmBundle());
|
QnxVersionNumber deviceRuntimeVersion(m_deviceInfo->scmBundle());
|
||||||
QFileInfo fi(target()->kit()->autoDetectionSource());
|
QFileInfo fi(target()->kit()->autoDetectionSource());
|
||||||
|
|
||||||
if (deviceRuntimeVersion.isEmpty()) {
|
if (deviceRuntimeVersion.isEmpty()) {
|
||||||
@@ -141,7 +141,7 @@ void BlackBerryCheckDeviceStatusStep::checkDeviceInfo(int status)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BlackBerryVersionNumber apiLevelVersion = BlackBerryVersionNumber::fromNdkEnvFileName(fi.baseName());
|
QnxVersionNumber apiLevelVersion = QnxVersionNumber::fromNdkEnvFileName(fi.baseName());
|
||||||
if (apiLevelVersion.isEmpty()) {
|
if (apiLevelVersion.isEmpty()) {
|
||||||
// Skip the check if device API level version is not determined
|
// Skip the check if device API level version is not determined
|
||||||
m_eventLoop->exit(true);
|
m_eventLoop->exit(true);
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ void BlackBerryConfigurationManager::loadManualConfigurations()
|
|||||||
|
|
||||||
void BlackBerryConfigurationManager::loadAutoDetectedApiLevels()
|
void BlackBerryConfigurationManager::loadAutoDetectedApiLevels()
|
||||||
{
|
{
|
||||||
foreach (const NdkInstallInformation &ndkInfo, QnxUtils::installedNdks()) {
|
foreach (const ConfigInstallInformation &ndkInfo, QnxUtils::installedConfigs()) {
|
||||||
BlackBerryApiLevelConfiguration *config = new BlackBerryApiLevelConfiguration(ndkInfo);
|
BlackBerryApiLevelConfiguration *config = new BlackBerryApiLevelConfiguration(ndkInfo);
|
||||||
if (!addApiLevel(config)) {
|
if (!addApiLevel(config)) {
|
||||||
delete config;
|
delete config;
|
||||||
@@ -502,27 +502,27 @@ BlackBerryConfigurationManager::~BlackBerryConfigurationManager()
|
|||||||
|
|
||||||
QString BlackBerryConfigurationManager::barsignerCskPath() const
|
QString BlackBerryConfigurationManager::barsignerCskPath() const
|
||||||
{
|
{
|
||||||
return QnxUtils::dataDirPath() + QLatin1String("/barsigner.csk");
|
return QnxUtils::bbDataDirPath() + QLatin1String("/barsigner.csk");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BlackBerryConfigurationManager::idTokenPath() const
|
QString BlackBerryConfigurationManager::idTokenPath() const
|
||||||
{
|
{
|
||||||
return QnxUtils::dataDirPath() + QLatin1String("/bbidtoken.csk");
|
return QnxUtils::bbDataDirPath() + QLatin1String("/bbidtoken.csk");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BlackBerryConfigurationManager::barsignerDbPath() const
|
QString BlackBerryConfigurationManager::barsignerDbPath() const
|
||||||
{
|
{
|
||||||
return QnxUtils::dataDirPath() + QLatin1String("/barsigner.db");
|
return QnxUtils::bbDataDirPath() + QLatin1String("/barsigner.db");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BlackBerryConfigurationManager::defaultKeystorePath() const
|
QString BlackBerryConfigurationManager::defaultKeystorePath() const
|
||||||
{
|
{
|
||||||
return QnxUtils::dataDirPath() + QLatin1String("/author.p12");
|
return QnxUtils::bbDataDirPath() + QLatin1String("/author.p12");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BlackBerryConfigurationManager::defaultDebugTokenPath() const
|
QString BlackBerryConfigurationManager::defaultDebugTokenPath() const
|
||||||
{
|
{
|
||||||
return QnxUtils::dataDirPath() + QLatin1String("/debugtoken.bar");
|
return QnxUtils::bbDataDirPath() + QLatin1String("/debugtoken.bar");
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ void BlackBerryInstallWizardNdkPage::initializePage()
|
|||||||
QFont font;
|
QFont font;
|
||||||
font.setItalic(true);
|
font.setItalic(true);
|
||||||
m_manual->setFont(font);
|
m_manual->setFont(font);
|
||||||
foreach (const NdkInstallInformation &ndk, QnxUtils::installedNdks()) {
|
foreach (const ConfigInstallInformation &ndk, QnxUtils::installedConfigs()) {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (int i = 0; i < m_ui->ndkPathListWidget->count(); i++) {
|
for (int i = 0; i < m_ui->ndkPathListWidget->count(); i++) {
|
||||||
QListWidgetItem* item = m_ui->ndkPathListWidget->item(i);
|
QListWidgetItem* item = m_ui->ndkPathListWidget->item(i);
|
||||||
@@ -421,7 +421,7 @@ void BlackBerryInstallWizardProcessPage::initializePage()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (const NdkInstallInformation &ndk, QnxUtils::installedNdks()) {
|
foreach (const ConfigInstallInformation &ndk, QnxUtils::installedConfigs()) {
|
||||||
if (ndk.version == m_data.version) {
|
if (ndk.version == m_data.version) {
|
||||||
m_data.ndkPath = ndk.path;
|
m_data.ndkPath = ndk.path;
|
||||||
m_data.target = ndk.name;
|
m_data.target = ndk.name;
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ void BlackBerryNDKSettingsWidget::handleUninstallationFinished()
|
|||||||
|
|
||||||
const QString targetName = current->text(0);
|
const QString targetName = current->text(0);
|
||||||
// Check if the target is corrrecly uninstalled
|
// Check if the target is corrrecly uninstalled
|
||||||
foreach (const NdkInstallInformation &ndk, QnxUtils::installedNdks()) {
|
foreach (const ConfigInstallInformation &ndk, QnxUtils::installedConfigs()) {
|
||||||
if (ndk.name == targetName)
|
if (ndk.name == targetName)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ const QLatin1String VersionKey("Version");
|
|||||||
|
|
||||||
BlackBerryRuntimeConfiguration::BlackBerryRuntimeConfiguration(
|
BlackBerryRuntimeConfiguration::BlackBerryRuntimeConfiguration(
|
||||||
const QString &path,
|
const QString &path,
|
||||||
const BlackBerryVersionNumber &version)
|
const QnxVersionNumber &version)
|
||||||
: m_path(path)
|
: m_path(path)
|
||||||
{
|
{
|
||||||
if (!version.isEmpty())
|
if (!version.isEmpty())
|
||||||
m_version = version;
|
m_version = version;
|
||||||
else
|
else
|
||||||
m_version = BlackBerryVersionNumber::fromFileName(QFileInfo(path).baseName(),
|
m_version = QnxVersionNumber::fromFileName(QFileInfo(path).baseName(),
|
||||||
QRegExp(QLatin1String("^runtime_(.*)$")));
|
QRegExp(QLatin1String("^runtime_(.*)$")));
|
||||||
|
|
||||||
m_displayName = QCoreApplication::translate("Qnx::Internal::BlackBerryRuntimeConfiguration", "Runtime %1").arg(m_version.toString());
|
m_displayName = QCoreApplication::translate("Qnx::Internal::BlackBerryRuntimeConfiguration", "Runtime %1").arg(m_version.toString());
|
||||||
@@ -62,7 +62,7 @@ BlackBerryRuntimeConfiguration::BlackBerryRuntimeConfiguration(const QVariantMap
|
|||||||
{
|
{
|
||||||
m_path = data.value(QLatin1String(PathKey)).toString();
|
m_path = data.value(QLatin1String(PathKey)).toString();
|
||||||
m_displayName = data.value(QLatin1String(DisplayNameKey)).toString();
|
m_displayName = data.value(QLatin1String(DisplayNameKey)).toString();
|
||||||
m_version = BlackBerryVersionNumber(data.value(QLatin1String(VersionKey)).toString());
|
m_version = QnxVersionNumber(data.value(QLatin1String(VersionKey)).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BlackBerryRuntimeConfiguration::path() const
|
QString BlackBerryRuntimeConfiguration::path() const
|
||||||
@@ -75,7 +75,7 @@ QString BlackBerryRuntimeConfiguration::displayName() const
|
|||||||
return m_displayName;
|
return m_displayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
BlackBerryVersionNumber BlackBerryRuntimeConfiguration::version() const
|
QnxVersionNumber BlackBerryRuntimeConfiguration::version() const
|
||||||
{
|
{
|
||||||
return m_version;
|
return m_version;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#ifndef BLACKBERRYRUNTIMECONFIGURATION_H
|
#ifndef BLACKBERRYRUNTIMECONFIGURATION_H
|
||||||
#define BLACKBERRYRUNTIMECONFIGURATION_H
|
#define BLACKBERRYRUNTIMECONFIGURATION_H
|
||||||
|
|
||||||
#include "blackberryversionnumber.h"
|
#include "qnxversionnumber.h"
|
||||||
|
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
@@ -42,18 +42,18 @@ class BlackBerryRuntimeConfiguration
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BlackBerryRuntimeConfiguration(const QString &path,
|
BlackBerryRuntimeConfiguration(const QString &path,
|
||||||
const BlackBerryVersionNumber &version = BlackBerryVersionNumber());
|
const QnxVersionNumber &version = QnxVersionNumber());
|
||||||
BlackBerryRuntimeConfiguration(const QVariantMap &data);
|
BlackBerryRuntimeConfiguration(const QVariantMap &data);
|
||||||
|
|
||||||
QString path() const;
|
QString path() const;
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
BlackBerryVersionNumber version() const;
|
QnxVersionNumber version() const;
|
||||||
QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_path;
|
QString m_path;
|
||||||
QString m_displayName;
|
QString m_displayName;
|
||||||
BlackBerryVersionNumber m_version;
|
QnxVersionNumber m_version;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ APILevelSetupItem::FoundTypes APILevelSetupItem::resolvedFoundType()
|
|||||||
FoundTypes found;
|
FoundTypes found;
|
||||||
|
|
||||||
// TODO: for now, all Trunk versions are understood as 10.2 compliant
|
// TODO: for now, all Trunk versions are understood as 10.2 compliant
|
||||||
BlackBerryVersionNumber version_10_2(QLatin1String("10.2.0.0"));
|
QnxVersionNumber version_10_2(QLatin1String("10.2.0.0"));
|
||||||
foreach (BlackBerryApiLevelConfiguration *config,
|
foreach (BlackBerryApiLevelConfiguration *config,
|
||||||
BlackBerryConfigurationManager::instance()->apiLevels()) {
|
BlackBerryConfigurationManager::instance()->apiLevels()) {
|
||||||
found |= Any;
|
found |= Any;
|
||||||
|
|||||||
BIN
src/plugins/qnx/images/qnx-target.png
Normal file
BIN
src/plugins/qnx/images/qnx-target.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
@@ -91,7 +91,6 @@ SOURCES += qnxplugin.cpp \
|
|||||||
qnxdeviceprocesslist.cpp \
|
qnxdeviceprocesslist.cpp \
|
||||||
qnxtoolchain.cpp \
|
qnxtoolchain.cpp \
|
||||||
slog2inforunner.cpp \
|
slog2inforunner.cpp \
|
||||||
blackberryversionnumber.cpp \
|
|
||||||
blackberrydebugtokenpinsdialog.cpp \
|
blackberrydebugtokenpinsdialog.cpp \
|
||||||
blackberrycheckdevicestatusstepfactory.cpp \
|
blackberrycheckdevicestatusstepfactory.cpp \
|
||||||
blackberrycheckdevicestatusstepconfigwidget.cpp \
|
blackberrycheckdevicestatusstepconfigwidget.cpp \
|
||||||
@@ -107,7 +106,11 @@ SOURCES += qnxplugin.cpp \
|
|||||||
bardescriptorfilenode.cpp \
|
bardescriptorfilenode.cpp \
|
||||||
bardescriptorfilenodemanager.cpp \
|
bardescriptorfilenodemanager.cpp \
|
||||||
qnxconfiguration.cpp \
|
qnxconfiguration.cpp \
|
||||||
qnxbaseconfiguration.cpp
|
qnxbaseconfiguration.cpp \
|
||||||
|
qnxsettingswidget.cpp \
|
||||||
|
qnxconfigurationmanager.cpp \
|
||||||
|
qnxsettingspage.cpp \
|
||||||
|
qnxversionnumber.cpp
|
||||||
|
|
||||||
HEADERS += qnxplugin.h\
|
HEADERS += qnxplugin.h\
|
||||||
qnxconstants.h \
|
qnxconstants.h \
|
||||||
@@ -199,7 +202,6 @@ HEADERS += qnxplugin.h\
|
|||||||
qnxdeviceprocesslist.h \
|
qnxdeviceprocesslist.h \
|
||||||
qnxtoolchain.h \
|
qnxtoolchain.h \
|
||||||
slog2inforunner.h \
|
slog2inforunner.h \
|
||||||
blackberryversionnumber.h \
|
|
||||||
blackberrydebugtokenpinsdialog.h \
|
blackberrydebugtokenpinsdialog.h \
|
||||||
blackberrycheckdevicestatusstep.h \
|
blackberrycheckdevicestatusstep.h \
|
||||||
blackberrycheckdevicestatusstepfactory.h \
|
blackberrycheckdevicestatusstepfactory.h \
|
||||||
@@ -215,7 +217,11 @@ HEADERS += qnxplugin.h\
|
|||||||
bardescriptorfilenode.h \
|
bardescriptorfilenode.h \
|
||||||
bardescriptorfilenodemanager.h \
|
bardescriptorfilenodemanager.h \
|
||||||
qnxconfiguration.h \
|
qnxconfiguration.h \
|
||||||
qnxbaseconfiguration.h
|
qnxbaseconfiguration.h \
|
||||||
|
qnxsettingswidget.h \
|
||||||
|
qnxconfigurationmanager.h \
|
||||||
|
qnxsettingspage.h \
|
||||||
|
qnxversionnumber.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
blackberrydeviceconfigurationwizardsetuppage.ui \
|
blackberrydeviceconfigurationwizardsetuppage.ui \
|
||||||
@@ -245,7 +251,8 @@ FORMS += \
|
|||||||
blackberryinstallwizardoptionpage.ui \
|
blackberryinstallwizardoptionpage.ui \
|
||||||
blackberrydebugtokenpinsdialog.ui \
|
blackberrydebugtokenpinsdialog.ui \
|
||||||
blackberrycheckdevicestatusstepconfigwidget.ui \
|
blackberrycheckdevicestatusstepconfigwidget.ui \
|
||||||
blackberrydeployqtlibrariesdialog.ui
|
blackberrydeployqtlibrariesdialog.ui \
|
||||||
|
qnxsettingswidget.ui
|
||||||
|
|
||||||
include(../../private_headers.pri)
|
include(../../private_headers.pri)
|
||||||
include(./cascadesimport/cascadesimport.pri)
|
include(./cascadesimport/cascadesimport.pri)
|
||||||
|
|||||||
@@ -197,8 +197,6 @@ QtcPlugin {
|
|||||||
"blackberrysshkeysgenerator.h",
|
"blackberrysshkeysgenerator.h",
|
||||||
"blackberrysigningutils.cpp",
|
"blackberrysigningutils.cpp",
|
||||||
"blackberrysigningutils.h",
|
"blackberrysigningutils.h",
|
||||||
"blackberryversionnumber.cpp",
|
|
||||||
"blackberryversionnumber.h",
|
|
||||||
"pathchooserdelegate.cpp",
|
"pathchooserdelegate.cpp",
|
||||||
"pathchooserdelegate.h",
|
"pathchooserdelegate.h",
|
||||||
"qnxtoolchain.cpp",
|
"qnxtoolchain.cpp",
|
||||||
@@ -244,6 +242,15 @@ QtcPlugin {
|
|||||||
"qnxdeviceprocesssignaloperation.h",
|
"qnxdeviceprocesssignaloperation.h",
|
||||||
"qnxdevicetester.cpp",
|
"qnxdevicetester.cpp",
|
||||||
"qnxdevicetester.h",
|
"qnxdevicetester.h",
|
||||||
|
"qnxsettingswidget.cpp",
|
||||||
|
"qnxsettingswidget.h",
|
||||||
|
"qnxsettingswidget.ui",
|
||||||
|
"qnxconfigurationmanager.cpp",
|
||||||
|
"qnxconfigurationmanager.h",
|
||||||
|
"qnxsettingspage.cpp",
|
||||||
|
"qnxsettingspage.h",
|
||||||
|
"qnxversionnumber.cpp",
|
||||||
|
"qnxversionnumber.h",
|
||||||
"qnxplugin.cpp",
|
"qnxplugin.cpp",
|
||||||
"qnxplugin.h",
|
"qnxplugin.h",
|
||||||
"qnxqtversion.cpp",
|
"qnxqtversion.cpp",
|
||||||
|
|||||||
@@ -6,5 +6,7 @@
|
|||||||
<file>images/info.png</file>
|
<file>images/info.png</file>
|
||||||
<file>images/warning.png</file>
|
<file>images/warning.png</file>
|
||||||
<file>images/error.png</file>
|
<file>images/error.png</file>
|
||||||
|
<file>images/qnx-target.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
<qresource prefix="/"/>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -47,9 +47,11 @@ namespace Qnx {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
const QLatin1String QNXEnvFileKey("EnvFile");
|
const QLatin1String QNXEnvFileKey("EnvFile");
|
||||||
|
const QLatin1String QNXVersionKey("QNXVersion");
|
||||||
// For backward compatibility
|
// For backward compatibility
|
||||||
const QLatin1String NDKEnvFileKey("NDKEnvFile");
|
const QLatin1String NDKEnvFileKey("NDKEnvFile");
|
||||||
|
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
@@ -68,6 +70,7 @@ QnxBaseConfiguration::QnxBaseConfiguration(const QVariantMap &data)
|
|||||||
if (envFilePath.isEmpty())
|
if (envFilePath.isEmpty())
|
||||||
envFilePath = data.value(NDKEnvFileKey).toString();
|
envFilePath = data.value(NDKEnvFileKey).toString();
|
||||||
|
|
||||||
|
m_version = QnxVersionNumber(data.value(QNXVersionKey).toString());
|
||||||
ctor(FileName::fromString(envFilePath));
|
ctor(FileName::fromString(envFilePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,10 +113,16 @@ QList<EnvironmentItem> QnxBaseConfiguration::qnxEnv() const
|
|||||||
return m_qnxEnv;
|
return m_qnxEnv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QnxVersionNumber QnxBaseConfiguration::version() const
|
||||||
|
{
|
||||||
|
return m_version;
|
||||||
|
}
|
||||||
|
|
||||||
QVariantMap QnxBaseConfiguration::toMap() const
|
QVariantMap QnxBaseConfiguration::toMap() const
|
||||||
{
|
{
|
||||||
QVariantMap data;
|
QVariantMap data;
|
||||||
data.insert(QLatin1String(QNXEnvFileKey), m_envFile.toString());
|
data.insert(QLatin1String(QNXEnvFileKey), m_envFile.toString());
|
||||||
|
data.insert(QLatin1String(QNXVersionKey), m_version.toString());
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,5 +210,10 @@ QStringList QnxBaseConfiguration::validationErrors() const
|
|||||||
return errorStrings;
|
return errorStrings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QnxBaseConfiguration::setVersion(const QnxVersionNumber &version)
|
||||||
|
{
|
||||||
|
m_version = version;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "qnxconstants.h"
|
#include "qnxconstants.h"
|
||||||
#include "qnxutils.h"
|
#include "qnxutils.h"
|
||||||
|
#include "qnxversionnumber.h"
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
@@ -64,6 +65,7 @@ public:
|
|||||||
Utils::FileName armDebuggerPath() const;
|
Utils::FileName armDebuggerPath() const;
|
||||||
Utils::FileName x86DebuggerPath() const;
|
Utils::FileName x86DebuggerPath() const;
|
||||||
QList<Utils::EnvironmentItem> qnxEnv() const;
|
QList<Utils::EnvironmentItem> qnxEnv() const;
|
||||||
|
QnxVersionNumber version() const;
|
||||||
QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
|
|
||||||
virtual bool isValid() const;
|
virtual bool isValid() const;
|
||||||
@@ -80,6 +82,7 @@ protected:
|
|||||||
const QString &ndkPath);
|
const QString &ndkPath);
|
||||||
|
|
||||||
virtual QStringList validationErrors() const;
|
virtual QStringList validationErrors() const;
|
||||||
|
void setVersion(const QnxVersionNumber& version);
|
||||||
private:
|
private:
|
||||||
Utils::FileName m_envFile;
|
Utils::FileName m_envFile;
|
||||||
Utils::FileName m_qnxTarget;
|
Utils::FileName m_qnxTarget;
|
||||||
@@ -88,8 +91,10 @@ private:
|
|||||||
Utils::FileName m_armlev7Debugger;
|
Utils::FileName m_armlev7Debugger;
|
||||||
Utils::FileName m_x86Debugger;
|
Utils::FileName m_x86Debugger;
|
||||||
QList<Utils::EnvironmentItem> m_qnxEnv;
|
QList<Utils::EnvironmentItem> m_qnxEnv;
|
||||||
|
QnxVersionNumber m_version;
|
||||||
|
|
||||||
void ctor(const Utils::FileName &envFile);
|
void ctor(const Utils::FileName &envFile);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,23 +29,52 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qnxconfiguration.h"
|
#include "qnxconfiguration.h"
|
||||||
|
#include "qnxqtversion.h"
|
||||||
#include "qnxutils.h"
|
#include "qnxutils.h"
|
||||||
|
|
||||||
#include "qnxtoolchain.h"
|
#include "qnxtoolchain.h"
|
||||||
|
|
||||||
#include "debugger/debuggeritem.h"
|
#include "debugger/debuggeritem.h"
|
||||||
|
|
||||||
#include <projectexplorer/toolchainmanager.h>
|
#include <projectexplorer/toolchainmanager.h>
|
||||||
|
#include <projectexplorer/kit.h>
|
||||||
|
#include <projectexplorer/kitmanager.h>
|
||||||
|
|
||||||
|
#include <qtsupport/baseqtversion.h>
|
||||||
|
#include <qtsupport/qtversionmanager.h>
|
||||||
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
|
#include <qmakeprojectmanager/qmakekitinformation.h>
|
||||||
|
|
||||||
|
#include <debugger/debuggeritemmanager.h>
|
||||||
|
#include <debugger/debuggerkitinformation.h>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
|
using namespace ProjectExplorer;
|
||||||
|
using namespace QtSupport;
|
||||||
|
using namespace Utils;
|
||||||
|
using namespace Debugger;
|
||||||
|
|
||||||
namespace Qnx {
|
namespace Qnx {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
QnxConfiguration::QnxConfiguration(const Utils::FileName &sdpEnvFile)
|
QnxConfiguration::QnxConfiguration(const Utils::FileName &sdpEnvFile)
|
||||||
: QnxBaseConfiguration(sdpEnvFile)
|
: QnxBaseConfiguration(sdpEnvFile)
|
||||||
{
|
{
|
||||||
|
readInformation();
|
||||||
|
}
|
||||||
|
|
||||||
|
QnxConfiguration::QnxConfiguration(const QVariantMap &data)
|
||||||
|
: QnxBaseConfiguration(data)
|
||||||
|
{
|
||||||
|
readInformation();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QnxConfiguration::displayName() const
|
||||||
|
{
|
||||||
|
return m_configName;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QnxConfiguration::activate()
|
bool QnxConfiguration::activate()
|
||||||
@@ -64,19 +93,23 @@ bool QnxConfiguration::activate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create and register toolchain
|
// Create and register toolchain
|
||||||
createToolChain(QnxArchitecture::ArmLeV7,
|
QnxToolChain *armTc = createToolChain(ArmLeV7,
|
||||||
tr("QCC for QNX armlev7"),
|
tr("QCC for %1 (armlev7)").arg(displayName()),
|
||||||
sdpPath().toString());
|
sdpPath().toString());
|
||||||
createToolChain(QnxArchitecture::X86,
|
QnxToolChain *x86Tc = createToolChain(X86,
|
||||||
tr("QCC for QNX x86"),
|
tr("QCC for %1 (x86)").arg(displayName()),
|
||||||
sdpPath().toString());
|
sdpPath().toString());
|
||||||
|
|
||||||
// Create and register debuggers
|
// Create and register debuggers
|
||||||
createDebuggerItem(QnxArchitecture::ArmLeV7,
|
QVariant armDebuggerId = createDebuggerItem(ArmLeV7,
|
||||||
tr("Debugger for QNX armlev7"));
|
tr("Debugger for %1 (armlev7)").arg(displayName()));
|
||||||
|
|
||||||
createDebuggerItem(QnxArchitecture::X86,
|
QVariant x86DebuggerId = createDebuggerItem(X86,
|
||||||
tr("Debugger for QNX x86"));
|
tr("Debugger for %1 (x86)").arg(displayName()));
|
||||||
|
|
||||||
|
// Create and register kits
|
||||||
|
createKit(ArmLeV7, armTc, armDebuggerId, tr("Kit for %1 (Device)").arg(displayName()));
|
||||||
|
createKit(X86, x86Tc, x86DebuggerId, tr("Kit for %1 (Simulator)").arg(displayName()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -86,19 +119,34 @@ void QnxConfiguration::deactivate()
|
|||||||
if (!isActive())
|
if (!isActive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
QList<ProjectExplorer::ToolChain *> toolChainsToRemove;
|
||||||
|
QList<Debugger::DebuggerItem> debuggersToRemove;
|
||||||
foreach (ProjectExplorer::ToolChain *tc,
|
foreach (ProjectExplorer::ToolChain *tc,
|
||||||
ProjectExplorer::ToolChainManager::toolChains()) {
|
ProjectExplorer::ToolChainManager::toolChains()) {
|
||||||
if (tc->compilerCommand() == qccCompilerPath())
|
if (tc->compilerCommand() == qccCompilerPath())
|
||||||
ProjectExplorer::ToolChainManager::deregisterToolChain(tc);
|
toolChainsToRemove.append(tc);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Debugger::DebuggerItem debuggerItem,
|
foreach (Debugger::DebuggerItem debuggerItem,
|
||||||
Debugger::DebuggerItemManager::debuggers()) {
|
Debugger::DebuggerItemManager::debuggers()) {
|
||||||
if (debuggerItem.command() == armDebuggerPath() ||
|
if (debuggerItem.command() == armDebuggerPath() ||
|
||||||
debuggerItem.command() == x86DebuggerPath())
|
debuggerItem.command() == x86DebuggerPath())
|
||||||
Debugger::DebuggerItemManager::
|
debuggersToRemove.append(debuggerItem);
|
||||||
deregisterDebugger(debuggerItem.id());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (Kit *kit, KitManager::kits()) {
|
||||||
|
if (kit->isAutoDetected()
|
||||||
|
&& DeviceTypeKitInformation::deviceTypeId(kit) == Constants::QNX_BB_OS_TYPE
|
||||||
|
&& toolChainsToRemove.contains(ToolChainKitInformation::toolChain(kit)))
|
||||||
|
KitManager::deregisterKit(kit);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (ProjectExplorer::ToolChain *tc, toolChainsToRemove)
|
||||||
|
ProjectExplorer::ToolChainManager::deregisterToolChain(tc);
|
||||||
|
|
||||||
|
foreach (Debugger::DebuggerItem debuggerItem, debuggersToRemove)
|
||||||
|
Debugger::DebuggerItemManager::
|
||||||
|
deregisterDebugger(debuggerItem.id());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QnxConfiguration::isActive() const
|
bool QnxConfiguration::isActive() const
|
||||||
@@ -125,10 +173,92 @@ bool QnxConfiguration::isActive() const
|
|||||||
return hasToolChain && hasDebugger;
|
return hasToolChain && hasDebugger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QnxConfiguration::canCreateKits() const
|
||||||
|
{
|
||||||
|
return isValid() && (qnxQtVersion(ArmLeV7) || qnxQtVersion(X86));
|
||||||
|
}
|
||||||
|
|
||||||
Utils::FileName QnxConfiguration::sdpPath() const
|
Utils::FileName QnxConfiguration::sdpPath() const
|
||||||
{
|
{
|
||||||
return envFile().parentDir();
|
return envFile().parentDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QnxQtVersion* QnxConfiguration::qnxQtVersion(QnxArchitecture arch) const
|
||||||
|
{
|
||||||
|
QnxQtVersion *qnxQt;
|
||||||
|
foreach (BaseQtVersion *version,
|
||||||
|
QtVersionManager::instance()->versions()) {
|
||||||
|
if (version->type() == QLatin1String(Constants::QNX_QNX_QT)) {
|
||||||
|
qnxQt = dynamic_cast<QnxQtVersion*>(version);
|
||||||
|
if (qnxQt && qnxQt->architecture() == arch) {
|
||||||
|
return qnxQt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProjectExplorer::Kit *QnxConfiguration::createKit(QnxArchitecture arch,
|
||||||
|
QnxToolChain *toolChain,
|
||||||
|
const QVariant &debuggerItemId,
|
||||||
|
const QString &displayName)
|
||||||
|
{
|
||||||
|
QnxQtVersion *qnxQt = qnxQtVersion(arch);
|
||||||
|
// Do not create incomplete kits if no qt qnx version found
|
||||||
|
if (!qnxQt)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
Kit *kit = new ProjectExplorer::Kit;
|
||||||
|
|
||||||
|
QtKitInformation::setQtVersion(kit, qnxQt);
|
||||||
|
ToolChainKitInformation::setToolChain(kit, toolChain);
|
||||||
|
|
||||||
|
if (debuggerItemId.isValid())
|
||||||
|
DebuggerKitInformation::setDebugger(kit, debuggerItemId);
|
||||||
|
|
||||||
|
if (arch == X86) {
|
||||||
|
QmakeProjectManager::QmakeKitInformation::setMkspec(
|
||||||
|
kit, FileName::fromLatin1("qnx-x86-qcc"));
|
||||||
|
} else {
|
||||||
|
QmakeProjectManager::QmakeKitInformation::setMkspec(
|
||||||
|
kit, FileName::fromLatin1("qnx-armv7le-qcc"));
|
||||||
|
}
|
||||||
|
|
||||||
|
DeviceTypeKitInformation::setDeviceTypeId(kit, Constants::QNX_BB_OS_TYPE);
|
||||||
|
// TODO: Add sysroot?
|
||||||
|
|
||||||
|
kit->setDisplayName(displayName);
|
||||||
|
kit->setIconPath(FileName::fromString(QLatin1String(Constants::QNX_BB_CATEGORY_ICON)));
|
||||||
|
|
||||||
|
kit->setAutoDetected(true);
|
||||||
|
kit->setAutoDetectionSource(envFile().toString());
|
||||||
|
kit->setMutable(DeviceKitInformation::id(), true);
|
||||||
|
|
||||||
|
kit->setSticky(ToolChainKitInformation::id(), true);
|
||||||
|
kit->setSticky(DeviceTypeKitInformation::id(), true);
|
||||||
|
kit->setSticky(SysRootKitInformation::id(), true);
|
||||||
|
kit->setSticky(DebuggerKitInformation::id(), true);
|
||||||
|
kit->setSticky(QmakeProjectManager::QmakeKitInformation::id(), true);
|
||||||
|
|
||||||
|
// add kit with device and qt version not sticky
|
||||||
|
KitManager::registerKit(kit);
|
||||||
|
return kit;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QnxConfiguration::readInformation()
|
||||||
|
{
|
||||||
|
QString qConfigPath = sdpPath().toString() + QLatin1String("/.qnx/qconfig");
|
||||||
|
QList <ConfigInstallInformation> installInfoList = QnxUtils::installedConfigs(qConfigPath);
|
||||||
|
if (installInfoList.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// TODO: For now (6.6) it should be one installation file. The code need to handle cases
|
||||||
|
// where the SDP support many target/host installations (i.e many installation files).
|
||||||
|
const ConfigInstallInformation installInfo = installInfoList.first();
|
||||||
|
m_configName = installInfo.name;
|
||||||
|
setVersion(QnxVersionNumber(installInfo.version));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,18 +32,38 @@
|
|||||||
#define QNXCONFIGURATION_H
|
#define QNXCONFIGURATION_H
|
||||||
|
|
||||||
#include "qnxbaseconfiguration.h"
|
#include "qnxbaseconfiguration.h"
|
||||||
|
#include "qnxversionnumber.h"
|
||||||
|
|
||||||
|
namespace ProjectExplorer { class Kit; }
|
||||||
|
|
||||||
namespace Qnx {
|
namespace Qnx {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
class QnxQtVersion;
|
||||||
class QnxConfiguration : public QnxBaseConfiguration
|
class QnxConfiguration : public QnxBaseConfiguration
|
||||||
{
|
{
|
||||||
|
Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::QnxConfiguration)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QnxConfiguration(const Utils::FileName &sdpEnvFile);
|
QnxConfiguration(const Utils::FileName &sdpEnvFile);
|
||||||
|
QnxConfiguration(const QVariantMap &data);
|
||||||
|
QString displayName() const;
|
||||||
bool activate();
|
bool activate();
|
||||||
void deactivate();
|
void deactivate();
|
||||||
bool isActive() const;
|
bool isActive() const;
|
||||||
|
bool canCreateKits() const;
|
||||||
Utils::FileName sdpPath() const;
|
Utils::FileName sdpPath() const;
|
||||||
|
QnxQtVersion* qnxQtVersion(QnxArchitecture arch) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString m_configName;
|
||||||
|
QnxQtVersion *m_qtVersion;
|
||||||
|
|
||||||
|
ProjectExplorer::Kit *createKit(QnxArchitecture arch,
|
||||||
|
QnxToolChain *toolChain,
|
||||||
|
const QVariant &debuggerItemId,
|
||||||
|
const QString &displayName);
|
||||||
|
|
||||||
|
void readInformation();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
153
src/plugins/qnx/qnxconfigurationmanager.cpp
Normal file
153
src/plugins/qnx/qnxconfigurationmanager.cpp
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
|
||||||
|
**
|
||||||
|
** Contact: BlackBerry (qt@blackberry.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 "qnxconfigurationmanager.h"
|
||||||
|
#include "qnxconfiguration.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
#include <utils/persistentsettings.h>
|
||||||
|
|
||||||
|
namespace Qnx {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
|
||||||
|
const QLatin1String QNXConfigDataKey("QNXConfiguration.");
|
||||||
|
const QLatin1String QNXConfigCountKey("QNXConfiguration.Count");
|
||||||
|
const QLatin1String QNXConfigsFileVersionKey("Version");
|
||||||
|
|
||||||
|
static Utils::FileName qnxConfigSettingsFileName()
|
||||||
|
{
|
||||||
|
return Utils::FileName::fromString(Core::ICore::userResourcePath() + QLatin1String("/qnx/")
|
||||||
|
+ QLatin1String(Constants::QNX_CONFIGS_FILENAME));
|
||||||
|
}
|
||||||
|
|
||||||
|
QnxConfigurationManager *QnxConfigurationManager::m_instance = 0;
|
||||||
|
|
||||||
|
QnxConfigurationManager::QnxConfigurationManager(QObject *parent)
|
||||||
|
: QObject(parent)
|
||||||
|
{
|
||||||
|
m_instance = this;
|
||||||
|
m_writer = new Utils::PersistentSettingsWriter(qnxConfigSettingsFileName(),
|
||||||
|
QLatin1String("QnxConfigurations"));
|
||||||
|
restoreConfigurations();
|
||||||
|
connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()),
|
||||||
|
this, SLOT(saveConfigs()));
|
||||||
|
}
|
||||||
|
|
||||||
|
QnxConfigurationManager *QnxConfigurationManager::instance()
|
||||||
|
{
|
||||||
|
return m_instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
QnxConfigurationManager::~QnxConfigurationManager()
|
||||||
|
{
|
||||||
|
m_instance = 0;
|
||||||
|
qDeleteAll(m_configurations);
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QnxConfiguration *> QnxConfigurationManager::configurations() const
|
||||||
|
{
|
||||||
|
return m_configurations;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QnxConfigurationManager::removeConfiguration(QnxConfiguration *config)
|
||||||
|
{
|
||||||
|
if (m_configurations.removeAll(config)) {
|
||||||
|
delete config;
|
||||||
|
emit configurationsListUpdated();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QnxConfigurationManager::addConfiguration(QnxConfiguration *config)
|
||||||
|
{
|
||||||
|
if (!config || !config->isValid())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
foreach (QnxConfiguration *c, m_configurations) {
|
||||||
|
if (c->envFile() == config->envFile())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_configurations.append(config);
|
||||||
|
emit configurationsListUpdated();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
QnxConfiguration *QnxConfigurationManager::configurationFromEnvFile(const Utils::FileName &envFile) const
|
||||||
|
{
|
||||||
|
foreach (QnxConfiguration *c, m_configurations) {
|
||||||
|
if (c->envFile() == envFile)
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QnxConfigurationManager::saveConfigs()
|
||||||
|
{
|
||||||
|
QTC_ASSERT(m_writer, return);
|
||||||
|
QVariantMap data;
|
||||||
|
data.insert(QLatin1String(QNXConfigsFileVersionKey), 1);
|
||||||
|
int count = 0;
|
||||||
|
foreach (QnxConfiguration *config, m_configurations) {
|
||||||
|
QVariantMap tmp = config->toMap();
|
||||||
|
if (tmp.isEmpty())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
data.insert(QNXConfigDataKey + QString::number(count), tmp);
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
data.insert(QLatin1String(QNXConfigCountKey), count);
|
||||||
|
m_writer->save(data, Core::ICore::mainWindow());
|
||||||
|
}
|
||||||
|
|
||||||
|
void QnxConfigurationManager::restoreConfigurations()
|
||||||
|
{
|
||||||
|
Utils::PersistentSettingsReader reader;
|
||||||
|
if (!reader.load(qnxConfigSettingsFileName()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
QVariantMap data = reader.restoreValues();
|
||||||
|
int count = data.value(QNXConfigCountKey, 0).toInt();
|
||||||
|
for (int i = 0; i < count; ++i) {
|
||||||
|
const QString key = QNXConfigDataKey + QString::number(i);
|
||||||
|
if (!data.contains(key))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
const QVariantMap dMap = data.value(key).toMap();
|
||||||
|
QnxConfiguration *configuration = new QnxConfiguration(dMap);
|
||||||
|
addConfiguration(configuration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
73
src/plugins/qnx/qnxconfigurationmanager.h
Normal file
73
src/plugins/qnx/qnxconfigurationmanager.h
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
|
||||||
|
**
|
||||||
|
** Contact: BlackBerry (qt@blackberry.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.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QNXCONFIGURATIONMANAGER_H
|
||||||
|
#define QNXCONFIGURATIONMANAGER_H
|
||||||
|
|
||||||
|
#include <utils/fileutils.h>
|
||||||
|
|
||||||
|
namespace Utils { class PersistentSettingsWriter; }
|
||||||
|
namespace Qnx {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
class QnxConfiguration;
|
||||||
|
class QnxPlugin;
|
||||||
|
|
||||||
|
class QnxConfigurationManager: public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
static QnxConfigurationManager *instance();
|
||||||
|
~QnxConfigurationManager();
|
||||||
|
QList<QnxConfiguration*> configurations() const;
|
||||||
|
void removeConfiguration(QnxConfiguration *config);
|
||||||
|
bool addConfiguration(QnxConfiguration *config);
|
||||||
|
QnxConfiguration* configurationFromEnvFile(const Utils::FileName &envFile) const;
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
void saveConfigs();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void configurationsListUpdated();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QnxConfigurationManager(QObject *parent = 0);
|
||||||
|
static QnxConfigurationManager *m_instance;
|
||||||
|
QList<QnxConfiguration*> m_configurations;
|
||||||
|
Utils::PersistentSettingsWriter *m_writer;
|
||||||
|
void restoreConfigurations();
|
||||||
|
|
||||||
|
friend class QnxPlugin;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // QNXCONFIGURATIONMANAGER_H
|
||||||
@@ -94,10 +94,14 @@ const char QNX_TOOLCHAIN_ID[] = "Qnx.QccToolChain";
|
|||||||
|
|
||||||
// BlackBerry settings constants
|
// BlackBerry settings constants
|
||||||
const char QNX_BB_CATEGORY[] = "XF.BlackBerry";
|
const char QNX_BB_CATEGORY[] = "XF.BlackBerry";
|
||||||
|
const char QNX_CATEGORY[] = "XF.Qnx";
|
||||||
const char QNX_BB_CATEGORY_TR[] = QT_TRANSLATE_NOOP("BlackBerry", "BlackBerry");
|
const char QNX_BB_CATEGORY_TR[] = QT_TRANSLATE_NOOP("BlackBerry", "BlackBerry");
|
||||||
|
const char QNX_CATEGORY_TR[] = QT_TRANSLATE_NOOP("QNX", "QNX");
|
||||||
const char QNX_BB_CATEGORY_ICON[] = ":/qnx/images/target.png";
|
const char QNX_BB_CATEGORY_ICON[] = ":/qnx/images/target.png";
|
||||||
|
const char QNX_CATEGORY_ICON[] = ":/qnx/images/qnx-target.png";
|
||||||
const char QNX_BB_SETUP_ID[] = "ZA.BlackBerry Setup";
|
const char QNX_BB_SETUP_ID[] = "ZA.BlackBerry Setup";
|
||||||
const char QNX_BB_NDK_SETTINGS_ID[] = "ZZ.BlackBerry NDK Configuration";
|
const char QNX_BB_NDK_SETTINGS_ID[] = "ZZ.BlackBerry NDK Configuration";
|
||||||
|
const char QNX_SETTINGS_ID[] = "ZZ.Qnx Configuration";
|
||||||
const char QNX_BB_SIGNING_ID[] = "ZZ.BlackBerry Signing Infrastructure Configuration";
|
const char QNX_BB_SIGNING_ID[] = "ZZ.BlackBerry Signing Infrastructure Configuration";
|
||||||
|
|
||||||
const char QNX_BAR_DESCRIPTOR_MIME_TYPE[] = "application/vnd.rim.qnx.bar_descriptor";
|
const char QNX_BAR_DESCRIPTOR_MIME_TYPE[] = "application/vnd.rim.qnx.bar_descriptor";
|
||||||
@@ -115,6 +119,7 @@ const char QNX_BLACKBERRY_DEPLOY_CMD[] = "blackberry-deploy";
|
|||||||
const char QNX_BLACKBERRY_CASCADESIMPORTER_VERSION[] = "0.0.1";
|
const char QNX_BLACKBERRY_CASCADESIMPORTER_VERSION[] = "0.0.1";
|
||||||
|
|
||||||
const char QNX_BLACKBERRY_CONFIGS_FILENAME[] = "bbndkconfigurations.xml";
|
const char QNX_BLACKBERRY_CONFIGS_FILENAME[] = "bbndkconfigurations.xml";
|
||||||
|
const char QNX_CONFIGS_FILENAME[] = "qnxconfigurations.xml";
|
||||||
|
|
||||||
const char QNX_DEBUGGING_GROUP[] = "Debugger.Group.Qnx";
|
const char QNX_DEBUGGING_GROUP[] = "Debugger.Group.Qnx";
|
||||||
|
|
||||||
|
|||||||
@@ -48,12 +48,14 @@
|
|||||||
#include "qnxqtversionfactory.h"
|
#include "qnxqtversionfactory.h"
|
||||||
#include "blackberrysetuppage.h"
|
#include "blackberrysetuppage.h"
|
||||||
#include "blackberryndksettingspage.h"
|
#include "blackberryndksettingspage.h"
|
||||||
|
#include "qnxsettingspage.h"
|
||||||
#include "bardescriptoreditorfactory.h"
|
#include "bardescriptoreditorfactory.h"
|
||||||
#include "bardescriptormagicmatcher.h"
|
#include "bardescriptormagicmatcher.h"
|
||||||
#include "blackberrykeyspage.h"
|
#include "blackberrykeyspage.h"
|
||||||
#include "blackberrycheckdevicestatusstepfactory.h"
|
#include "blackberrycheckdevicestatusstepfactory.h"
|
||||||
#include "blackberrydeviceconnectionmanager.h"
|
#include "blackberrydeviceconnectionmanager.h"
|
||||||
#include "blackberryconfigurationmanager.h"
|
#include "blackberryconfigurationmanager.h"
|
||||||
|
#include "qnxconfigurationmanager.h"
|
||||||
#include "blackberryapilevelconfiguration.h"
|
#include "blackberryapilevelconfiguration.h"
|
||||||
#include "cascadesimport/cascadesimportwizard.h"
|
#include "cascadesimport/cascadesimportwizard.h"
|
||||||
#include "qnxtoolchain.h"
|
#include "qnxtoolchain.h"
|
||||||
@@ -112,12 +114,14 @@ bool QnxPlugin::initialize(const QStringList &arguments, QString *errorString)
|
|||||||
BlackBerryDeviceConnectionManager::instance()->initialize();
|
BlackBerryDeviceConnectionManager::instance()->initialize();
|
||||||
|
|
||||||
// Handles QNX
|
// Handles QNX
|
||||||
|
addAutoReleasedObject(new QnxConfigurationManager);
|
||||||
addAutoReleasedObject(new QnxQtVersionFactory);
|
addAutoReleasedObject(new QnxQtVersionFactory);
|
||||||
addAutoReleasedObject(new QnxDeviceConfigurationFactory);
|
addAutoReleasedObject(new QnxDeviceConfigurationFactory);
|
||||||
addAutoReleasedObject(new QnxRunControlFactory);
|
addAutoReleasedObject(new QnxRunControlFactory);
|
||||||
addAutoReleasedObject(new QnxDeployStepFactory);
|
addAutoReleasedObject(new QnxDeployStepFactory);
|
||||||
addAutoReleasedObject(new QnxDeployConfigurationFactory);
|
addAutoReleasedObject(new QnxDeployConfigurationFactory);
|
||||||
addAutoReleasedObject(new QnxRunConfigurationFactory);
|
addAutoReleasedObject(new QnxRunConfigurationFactory);
|
||||||
|
addAutoReleasedObject(new QnxSettingsPage);
|
||||||
|
|
||||||
// Handle Qcc Compiler
|
// Handle Qcc Compiler
|
||||||
addAutoReleasedObject(new QnxToolChainFactory);
|
addAutoReleasedObject(new QnxToolChainFactory);
|
||||||
|
|||||||
76
src/plugins/qnx/qnxsettingspage.cpp
Normal file
76
src/plugins/qnx/qnxsettingspage.cpp
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
|
||||||
|
**
|
||||||
|
** Contact: BlackBerry (qt@blackberry.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 "qnxsettingspage.h"
|
||||||
|
#include "qnxconfiguration.h"
|
||||||
|
#include "qnxconfigurationmanager.h"
|
||||||
|
#include "qnxconstants.h"
|
||||||
|
|
||||||
|
#include <qnxsettingswidget.h>
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
namespace Qnx {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
QnxSettingsPage::QnxSettingsPage(QObject* parent) :
|
||||||
|
Core::IOptionsPage(parent)
|
||||||
|
{
|
||||||
|
setId(Core::Id(Constants::QNX_SETTINGS_ID));
|
||||||
|
setDisplayName(tr("QNX"));
|
||||||
|
setCategory(Constants::QNX_CATEGORY);
|
||||||
|
setDisplayCategory(QCoreApplication::translate("QNX",
|
||||||
|
Constants::QNX_CATEGORY_TR));
|
||||||
|
setCategoryIcon(QLatin1String(Constants::QNX_CATEGORY_ICON));
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget* QnxSettingsPage::widget()
|
||||||
|
{
|
||||||
|
if (!m_widget)
|
||||||
|
m_widget = new QnxSettingsWidget;
|
||||||
|
return m_widget;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QnxSettingsPage::apply()
|
||||||
|
{
|
||||||
|
m_widget->applyChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QnxSettingsPage::finish()
|
||||||
|
{
|
||||||
|
delete m_widget;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
59
src/plugins/qnx/qnxsettingspage.h
Normal file
59
src/plugins/qnx/qnxsettingspage.h
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
|
||||||
|
**
|
||||||
|
** Contact: BlackBerry (qt@blackberry.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.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QNXSETTINGSPAGE_H
|
||||||
|
#define QNXSETTINGSPAGE_H
|
||||||
|
|
||||||
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
|
namespace Qnx {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
class QnxSettingsWidget;
|
||||||
|
|
||||||
|
class QnxSettingsPage : public Core::IOptionsPage
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit QnxSettingsPage(QObject *parent = 0);
|
||||||
|
QWidget *widget();
|
||||||
|
void apply();
|
||||||
|
void finish();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPointer<QnxSettingsWidget> m_widget;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace Qnx
|
||||||
|
|
||||||
|
#endif // QNXSETTINGSPAGE_H
|
||||||
221
src/plugins/qnx/qnxsettingswidget.cpp
Normal file
221
src/plugins/qnx/qnxsettingswidget.cpp
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
|
||||||
|
**
|
||||||
|
** Contact: BlackBerry (qt@blackberry.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 "qnxsettingswidget.h"
|
||||||
|
#include "ui_qnxsettingswidget.h"
|
||||||
|
#include "qnxconfiguration.h"
|
||||||
|
#include "qnxconfigurationmanager.h"
|
||||||
|
|
||||||
|
#include <qtsupport/qtversionmanager.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
#include <qdebug.h>
|
||||||
|
|
||||||
|
namespace Qnx {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
QnxSettingsWidget::QnxSettingsWidget(QWidget *parent) :
|
||||||
|
QWidget(parent),
|
||||||
|
m_ui(new Ui_QnxSettingsWidget),
|
||||||
|
m_qnxConfigManager(QnxConfigurationManager::instance())
|
||||||
|
{
|
||||||
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
populateConfigsCombo();
|
||||||
|
connect(m_ui->addButton, SIGNAL(clicked()),
|
||||||
|
this, SLOT(addConfiguration()));
|
||||||
|
connect(m_ui->removeButton, SIGNAL(clicked()),
|
||||||
|
this, SLOT(removeConfiguration()));
|
||||||
|
connect(m_ui->configsCombo, SIGNAL(currentIndexChanged(QString)),
|
||||||
|
this, SLOT(updateInformation()));
|
||||||
|
connect(m_ui->generateKitsCheckBox, SIGNAL(toggled(bool)),
|
||||||
|
this, SLOT(generateKits(bool)));
|
||||||
|
connect(m_qnxConfigManager, SIGNAL(configurationsListUpdated()),
|
||||||
|
this, SLOT(populateConfigsCombo()));
|
||||||
|
connect(QtSupport::QtVersionManager::instance(),
|
||||||
|
SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
|
||||||
|
this, SLOT(updateInformation()));
|
||||||
|
}
|
||||||
|
|
||||||
|
QnxSettingsWidget::~QnxSettingsWidget()
|
||||||
|
{
|
||||||
|
delete m_ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QnxSettingsWidget::ConfigState> QnxSettingsWidget::changedConfigs()
|
||||||
|
{
|
||||||
|
return m_changedConfigs;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QnxSettingsWidget::addConfiguration()
|
||||||
|
{
|
||||||
|
QString filter;
|
||||||
|
if (Utils::HostOsInfo::isWindowsHost())
|
||||||
|
filter = QLatin1String("*.bat file");
|
||||||
|
else
|
||||||
|
filter = QLatin1String("*.sh file");
|
||||||
|
|
||||||
|
const QString envFile = QFileDialog::getOpenFileName(this, tr("Select QNX Environment File"),
|
||||||
|
QString(), filter);
|
||||||
|
if (envFile.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
QnxConfiguration *config = new QnxConfiguration(Utils::FileName::fromString(envFile));
|
||||||
|
if (m_qnxConfigManager->configurations().contains(config)
|
||||||
|
|| !config->isValid()) {
|
||||||
|
QMessageBox::warning(Core::ICore::mainWindow(), tr("Warning"),
|
||||||
|
tr("Configuration already exists or is invalid."));
|
||||||
|
delete config;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setConfigState(config, State::Added);
|
||||||
|
m_ui->configsCombo->addItem(config->displayName(),
|
||||||
|
QVariant::fromValue(static_cast<void*>(config)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void QnxSettingsWidget::removeConfiguration()
|
||||||
|
{
|
||||||
|
const int currentIndex = m_ui->configsCombo->currentIndex();
|
||||||
|
QnxConfiguration *config = static_cast<QnxConfiguration*>(
|
||||||
|
m_ui->configsCombo->itemData(currentIndex).value<void*>());
|
||||||
|
|
||||||
|
if (!config)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QMessageBox::StandardButton button =
|
||||||
|
QMessageBox::question(Core::ICore::mainWindow(),
|
||||||
|
tr("Remove QNX Configuration"),
|
||||||
|
tr("Are you sure you want to remove:\n %1?").arg(config->displayName()),
|
||||||
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
|
|
||||||
|
if (button == QMessageBox::Yes) {
|
||||||
|
setConfigState(config, State::Removed);
|
||||||
|
m_ui->configsCombo->removeItem(currentIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QnxSettingsWidget::generateKits(bool checked)
|
||||||
|
{
|
||||||
|
const int currentIndex = m_ui->configsCombo->currentIndex();
|
||||||
|
QnxConfiguration *config = static_cast<QnxConfiguration*>(
|
||||||
|
m_ui->configsCombo->itemData(currentIndex).value<void*>());
|
||||||
|
if (!config)
|
||||||
|
return;
|
||||||
|
|
||||||
|
setConfigState(config, checked ? State::Activated : State::Deactivated);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QnxSettingsWidget::updateInformation()
|
||||||
|
{
|
||||||
|
const int currentIndex = m_ui->configsCombo->currentIndex();
|
||||||
|
|
||||||
|
QnxConfiguration *config = static_cast<QnxConfiguration*>(
|
||||||
|
m_ui->configsCombo->itemData(currentIndex).value<void*>());
|
||||||
|
|
||||||
|
// update the checkbox
|
||||||
|
m_ui->generateKitsCheckBox->setEnabled(config ? config->canCreateKits() : false);
|
||||||
|
m_ui->generateKitsCheckBox->setChecked(config ? config->isActive() : false);
|
||||||
|
|
||||||
|
// update information
|
||||||
|
m_ui->configName->setText(config? config->displayName() : QString());
|
||||||
|
m_ui->configVersion->setText(config ? config->version().toString() : QString());
|
||||||
|
m_ui->configHost->setText(config ? config->qnxHost().toString() : QString());
|
||||||
|
m_ui->configTarget->setText(config ? config->qnxTarget().toString() : QString());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void QnxSettingsWidget::populateConfigsCombo()
|
||||||
|
{
|
||||||
|
m_ui->configsCombo->clear();
|
||||||
|
foreach (QnxConfiguration *config,
|
||||||
|
m_qnxConfigManager->configurations()) {
|
||||||
|
m_ui->configsCombo->addItem(config->displayName(),
|
||||||
|
QVariant::fromValue(static_cast<void*>(config)));
|
||||||
|
}
|
||||||
|
|
||||||
|
updateInformation();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QnxSettingsWidget::setConfigState(QnxConfiguration *config,
|
||||||
|
QnxSettingsWidget::State state)
|
||||||
|
{
|
||||||
|
QnxSettingsWidget::State stateToRemove;
|
||||||
|
switch (state) {
|
||||||
|
case QnxSettingsWidget::Added :
|
||||||
|
stateToRemove = QnxSettingsWidget::Removed;
|
||||||
|
break;
|
||||||
|
case QnxSettingsWidget::Removed:
|
||||||
|
stateToRemove = QnxSettingsWidget::Added;
|
||||||
|
break;
|
||||||
|
case QnxSettingsWidget::Activated:
|
||||||
|
stateToRemove = QnxSettingsWidget::Deactivated;
|
||||||
|
break;
|
||||||
|
case QnxSettingsWidget::Deactivated:
|
||||||
|
stateToRemove = QnxSettingsWidget::Activated;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (const ConfigState &configState, m_changedConfigs) {
|
||||||
|
if (configState.config == config
|
||||||
|
&& configState.state == stateToRemove)
|
||||||
|
m_changedConfigs.removeAll(configState);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_changedConfigs.append(ConfigState(config, state));
|
||||||
|
}
|
||||||
|
|
||||||
|
void QnxSettingsWidget::applyChanges()
|
||||||
|
{
|
||||||
|
foreach (const ConfigState &configState, m_changedConfigs) {
|
||||||
|
switch (configState.state) {
|
||||||
|
case State::Activated :
|
||||||
|
configState.config->activate();
|
||||||
|
break;
|
||||||
|
case State::Deactivated:
|
||||||
|
configState.config->deactivate();
|
||||||
|
break;
|
||||||
|
case State::Added:
|
||||||
|
m_qnxConfigManager->addConfiguration(configState.config);
|
||||||
|
break;
|
||||||
|
case State::Removed:
|
||||||
|
configState.config->deactivate();
|
||||||
|
m_qnxConfigManager->removeConfiguration(configState.config);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_changedConfigs.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
98
src/plugins/qnx/qnxsettingswidget.h
Normal file
98
src/plugins/qnx/qnxsettingswidget.h
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
|
||||||
|
**
|
||||||
|
** Contact: BlackBerry (qt@blackberry.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.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QNXSETTINGSWIDGET_H
|
||||||
|
#define QNXSETTINGSWIDGET_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
namespace Qnx {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
class Ui_QnxSettingsWidget;
|
||||||
|
class QnxConfiguration;
|
||||||
|
class QnxConfigurationManager;
|
||||||
|
|
||||||
|
class QnxSettingsWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
enum State {
|
||||||
|
Activated,
|
||||||
|
Deactivated,
|
||||||
|
Added,
|
||||||
|
Removed
|
||||||
|
};
|
||||||
|
|
||||||
|
class ConfigState {
|
||||||
|
public:
|
||||||
|
ConfigState(QnxConfiguration *config, State state)
|
||||||
|
{
|
||||||
|
this->config = config;
|
||||||
|
this->state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator ==(const ConfigState& cs)
|
||||||
|
{
|
||||||
|
return config == cs.config && state == cs.state;
|
||||||
|
}
|
||||||
|
|
||||||
|
QnxConfiguration *config;
|
||||||
|
State state;
|
||||||
|
};
|
||||||
|
|
||||||
|
explicit QnxSettingsWidget(QWidget *parent = 0);
|
||||||
|
~QnxSettingsWidget();
|
||||||
|
QList<ConfigState> changedConfigs();
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
void addConfiguration();
|
||||||
|
void removeConfiguration();
|
||||||
|
void generateKits(bool checked);
|
||||||
|
void updateInformation();
|
||||||
|
void populateConfigsCombo();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui_QnxSettingsWidget *m_ui;
|
||||||
|
QnxConfigurationManager *m_qnxConfigManager;
|
||||||
|
QList<ConfigState> m_changedConfigs;
|
||||||
|
|
||||||
|
void setConfigState(QnxConfiguration *config, State state);
|
||||||
|
|
||||||
|
void applyChanges();
|
||||||
|
friend class QnxSettingsPage;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // QNXSETTINGSWIDGET_H
|
||||||
195
src/plugins/qnx/qnxsettingswidget.ui
Normal file
195
src/plugins/qnx/qnxsettingswidget.ui
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>Qnx::Internal::QnxSettingsWidget</class>
|
||||||
|
<widget class="QWidget" name="Qnx::Internal::QnxSettingsWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>783</width>
|
||||||
|
<height>398</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="configsCombo"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="generateKitsCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Generate kits</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Configuration Information:</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Name:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Version:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="text">
|
||||||
|
<string>Host:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_8">
|
||||||
|
<property name="text">
|
||||||
|
<string>Target:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="configName">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="configVersion">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="configHost">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="configTarget">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
<zorder>configName</zorder>
|
||||||
|
<zorder>verticalLayoutWidget</zorder>
|
||||||
|
<zorder>verticalLayoutWidget_2</zorder>
|
||||||
|
<zorder>horizontalSpacer</zorder>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetMaximumSize</enum>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="addButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Add</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="removeButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Remove</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -186,7 +186,7 @@ Utils::FileName QnxUtils::executableWithExtension(const Utils::FileName &fileNam
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QnxUtils::dataDirPath()
|
QString QnxUtils::bbDataDirPath()
|
||||||
{
|
{
|
||||||
const QString homeDir = QDir::homePath();
|
const QString homeDir = QDir::homePath();
|
||||||
|
|
||||||
@@ -208,17 +208,17 @@ QString QnxUtils::dataDirPath()
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QnxUtils::qConfigPath()
|
QString QnxUtils::bbqConfigPath()
|
||||||
{
|
{
|
||||||
if (Utils::HostOsInfo::isMacHost() || Utils::HostOsInfo::isWindowsHost())
|
if (Utils::HostOsInfo::isMacHost() || Utils::HostOsInfo::isWindowsHost())
|
||||||
return dataDirPath() + QLatin1String("/BlackBerry Native SDK/qconfig");
|
return bbDataDirPath() + QLatin1String("/BlackBerry Native SDK/qconfig");
|
||||||
else
|
else
|
||||||
return dataDirPath() + QLatin1String("/bbndk/qconfig");
|
return bbDataDirPath() + QLatin1String("/bbndk/qconfig");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QnxUtils::defaultTargetVersion(const QString &ndkPath)
|
QString QnxUtils::defaultTargetVersion(const QString &ndkPath)
|
||||||
{
|
{
|
||||||
foreach (const NdkInstallInformation &ndkInfo, installedNdks()) {
|
foreach (const ConfigInstallInformation &ndkInfo, installedConfigs()) {
|
||||||
if (!ndkInfo.path.compare(ndkPath, Utils::HostOsInfo::fileNameCaseSensitivity()))
|
if (!ndkInfo.path.compare(ndkPath, Utils::HostOsInfo::fileNameCaseSensitivity()))
|
||||||
return ndkInfo.version;
|
return ndkInfo.version;
|
||||||
}
|
}
|
||||||
@@ -226,10 +226,13 @@ QString QnxUtils::defaultTargetVersion(const QString &ndkPath)
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<NdkInstallInformation> QnxUtils::installedNdks()
|
QList<ConfigInstallInformation> QnxUtils::installedConfigs(const QString &configPath)
|
||||||
{
|
{
|
||||||
QList<NdkInstallInformation> ndkList;
|
QList<ConfigInstallInformation> ndkList;
|
||||||
QString ndkConfigPath = qConfigPath();
|
QString ndkConfigPath = configPath;
|
||||||
|
if (ndkConfigPath.isEmpty())
|
||||||
|
ndkConfigPath = bbqConfigPath();
|
||||||
|
|
||||||
if (!QDir(ndkConfigPath).exists())
|
if (!QDir(ndkConfigPath).exists())
|
||||||
return ndkList;
|
return ndkList;
|
||||||
|
|
||||||
@@ -252,7 +255,7 @@ QList<NdkInstallInformation> QnxUtils::installedNdks()
|
|||||||
// The file contains only one installation node
|
// The file contains only one installation node
|
||||||
if (!childElt.isNull()) {
|
if (!childElt.isNull()) {
|
||||||
// The file contains only one base node
|
// The file contains only one base node
|
||||||
NdkInstallInformation ndkInfo;
|
ConfigInstallInformation ndkInfo;
|
||||||
ndkInfo.path = childElt.firstChildElement(QLatin1String("base")).text();
|
ndkInfo.path = childElt.firstChildElement(QLatin1String("base")).text();
|
||||||
ndkInfo.name = childElt.firstChildElement(QLatin1String("name")).text();
|
ndkInfo.name = childElt.firstChildElement(QLatin1String("name")).text();
|
||||||
ndkInfo.host = childElt.firstChildElement(QLatin1String("host")).text();
|
ndkInfo.host = childElt.firstChildElement(QLatin1String("host")).text();
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace Internal {
|
|||||||
|
|
||||||
class QnxAbstractQtVersion;
|
class QnxAbstractQtVersion;
|
||||||
|
|
||||||
class NdkInstallInformation
|
class ConfigInstallInformation
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QString path;
|
QString path;
|
||||||
@@ -70,10 +70,10 @@ public:
|
|||||||
static bool isValidNdkPath(const QString & ndkPath);
|
static bool isValidNdkPath(const QString & ndkPath);
|
||||||
static QString envFilePath(const QString & ndkPath, const QString& targetVersion = QString());
|
static QString envFilePath(const QString & ndkPath, const QString& targetVersion = QString());
|
||||||
static Utils::FileName executableWithExtension(const Utils::FileName &fileName);
|
static Utils::FileName executableWithExtension(const Utils::FileName &fileName);
|
||||||
static QString dataDirPath();
|
static QString bbDataDirPath();
|
||||||
static QString qConfigPath();
|
static QString bbqConfigPath();
|
||||||
static QString defaultTargetVersion(const QString& ndkPath);
|
static QString defaultTargetVersion(const QString& ndkPath);
|
||||||
static QList<NdkInstallInformation> installedNdks();
|
static QList<ConfigInstallInformation> installedConfigs(const QString &configPath = QString());
|
||||||
static QString sdkInstallerPath(const QString& ndkPath);
|
static QString sdkInstallerPath(const QString& ndkPath);
|
||||||
static QString qdeInstallProcess(const QString& ndkPath, const QString &target,
|
static QString qdeInstallProcess(const QString& ndkPath, const QString &target,
|
||||||
const QString &option, const QString &version = QString());
|
const QString &option, const QString &version = QString());
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "blackberryversionnumber.h"
|
#include "qnxversionnumber.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
@@ -38,26 +38,26 @@ namespace Internal {
|
|||||||
|
|
||||||
static const char NONDIGIT_SEGMENT_REGEXP[] = "(?<=\\d)(?=\\D)|(?<=\\D)(?=\\d)";
|
static const char NONDIGIT_SEGMENT_REGEXP[] = "(?<=\\d)(?=\\D)|(?<=\\D)(?=\\d)";
|
||||||
|
|
||||||
BlackBerryVersionNumber::BlackBerryVersionNumber(const QStringList &listNumber)
|
QnxVersionNumber::QnxVersionNumber(const QStringList &listNumber)
|
||||||
: m_segments(listNumber)
|
: m_segments(listNumber)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BlackBerryVersionNumber::BlackBerryVersionNumber(const QString &version)
|
QnxVersionNumber::QnxVersionNumber(const QString &version)
|
||||||
{
|
{
|
||||||
m_segments = version.split(QLatin1Char('.'));
|
m_segments = version.split(QLatin1Char('.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
BlackBerryVersionNumber::BlackBerryVersionNumber()
|
QnxVersionNumber::QnxVersionNumber()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BlackBerryVersionNumber::toString() const
|
QString QnxVersionNumber::toString() const
|
||||||
{
|
{
|
||||||
return m_segments.join(QLatin1String("."));
|
return m_segments.join(QLatin1String("."));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlackBerryVersionNumber::operator >(const BlackBerryVersionNumber &b) const
|
bool QnxVersionNumber::operator >(const QnxVersionNumber &b) const
|
||||||
{
|
{
|
||||||
int minSize = size() > b.size() ? b.size() : size();
|
int minSize = size() > b.size() ? b.size() : size();
|
||||||
for (int i = 0; i < minSize; i++) {
|
for (int i = 0; i < minSize; i++) {
|
||||||
@@ -84,7 +84,7 @@ bool BlackBerryVersionNumber::operator >(const BlackBerryVersionNumber &b) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BlackBerryVersionNumber::segment(int index) const
|
QString QnxVersionNumber::segment(int index) const
|
||||||
{
|
{
|
||||||
if (index < m_segments.length())
|
if (index < m_segments.length())
|
||||||
return m_segments.at(index);
|
return m_segments.at(index);
|
||||||
@@ -92,31 +92,31 @@ QString BlackBerryVersionNumber::segment(int index) const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
BlackBerryVersionNumber BlackBerryVersionNumber::fromNdkEnvFileName(const QString &ndkEnvFileName)
|
QnxVersionNumber QnxVersionNumber::fromNdkEnvFileName(const QString &ndkEnvFileName)
|
||||||
{
|
{
|
||||||
return fromFileName(ndkEnvFileName, QRegExp(QLatin1String("^bbndk-env_(.*)$")));
|
return fromFileName(ndkEnvFileName, QRegExp(QLatin1String("^bbndk-env_(.*)$")));
|
||||||
}
|
}
|
||||||
|
|
||||||
BlackBerryVersionNumber BlackBerryVersionNumber::fromTargetName(const QString &targetName)
|
QnxVersionNumber QnxVersionNumber::fromTargetName(const QString &targetName)
|
||||||
{
|
{
|
||||||
return fromFileName(targetName, QRegExp(QLatin1String("^target_(.*)$")));
|
return fromFileName(targetName, QRegExp(QLatin1String("^target_(.*)$")));
|
||||||
}
|
}
|
||||||
|
|
||||||
BlackBerryVersionNumber BlackBerryVersionNumber::fromFileName(const QString &fileName, const QRegExp ®Exp)
|
QnxVersionNumber QnxVersionNumber::fromFileName(const QString &fileName, const QRegExp ®Exp)
|
||||||
{
|
{
|
||||||
QStringList segments;
|
QStringList segments;
|
||||||
if (regExp.exactMatch(fileName) && regExp.captureCount() == 1)
|
if (regExp.exactMatch(fileName) && regExp.captureCount() == 1)
|
||||||
segments << regExp.cap(1).split(QLatin1Char('_'));
|
segments << regExp.cap(1).split(QLatin1Char('_'));
|
||||||
|
|
||||||
return BlackBerryVersionNumber(segments);
|
return QnxVersionNumber(segments);
|
||||||
}
|
}
|
||||||
|
|
||||||
int BlackBerryVersionNumber::size() const
|
int QnxVersionNumber::size() const
|
||||||
{
|
{
|
||||||
return m_segments.length();
|
return m_segments.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlackBerryVersionNumber::isEmpty() const
|
bool QnxVersionNumber::isEmpty() const
|
||||||
{
|
{
|
||||||
return m_segments.isEmpty();
|
return m_segments.isEmpty();
|
||||||
}
|
}
|
||||||
@@ -29,30 +29,30 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef BLACKBERRY_VERSION_NUMBER_H
|
#ifndef QNX_VERSION_NUMBER_H
|
||||||
#define BLACKBERRY_VERSION_NUMBER_H
|
#define QNX_VERSION_NUMBER_H
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
namespace Qnx {
|
namespace Qnx {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class BlackBerryVersionNumber
|
class QnxVersionNumber
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BlackBerryVersionNumber(const QStringList &segments);
|
QnxVersionNumber(const QStringList &segments);
|
||||||
BlackBerryVersionNumber(const QString &version);
|
QnxVersionNumber(const QString &version);
|
||||||
BlackBerryVersionNumber();
|
QnxVersionNumber();
|
||||||
|
|
||||||
int size() const;
|
int size() const;
|
||||||
bool isEmpty() const;
|
bool isEmpty() const;
|
||||||
QString segment(int index) const;
|
QString segment(int index) const;
|
||||||
QString toString() const;
|
QString toString() const;
|
||||||
|
|
||||||
static BlackBerryVersionNumber fromNdkEnvFileName(const QString &ndkEnvFileName);
|
static QnxVersionNumber fromNdkEnvFileName(const QString &ndkEnvFileName);
|
||||||
static BlackBerryVersionNumber fromTargetName(const QString &targetName);
|
static QnxVersionNumber fromTargetName(const QString &targetName);
|
||||||
static BlackBerryVersionNumber fromFileName(const QString &fileName, const QRegExp ®Exp);
|
static QnxVersionNumber fromFileName(const QString &fileName, const QRegExp ®Exp);
|
||||||
|
|
||||||
bool operator >(const BlackBerryVersionNumber &b) const;
|
bool operator >(const QnxVersionNumber &b) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QStringList m_segments;
|
QStringList m_segments;
|
||||||
@@ -61,4 +61,4 @@ private:
|
|||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qnx
|
} // namespace Qnx
|
||||||
|
|
||||||
#endif // VERSIONNUMBER_H
|
#endif // QNX_VERSION_NUMBER_H
|
||||||
Reference in New Issue
Block a user