Commit d1f2727e authored by El Mehdi Fekari's avatar El Mehdi Fekari Committed by Mehdi Fekari

Qnx: Add 'Deploy Qt libraries' action to QNX Device options page

Change-Id: I2fac9c5cb74aa46b8422de6ae3a6ab90b4152200
Reviewed-by: default avatarSergio Ahumada <sahumada@blackberry.com>
parent c5be32fa
......@@ -32,7 +32,7 @@
#include "blackberrycreatepackagestepconfigwidget.h"
#include "ui_blackberrycreatepackagestepconfigwidget.h"
#include "blackberrycreatepackagestep.h"
#include "blackberrydeployqtlibrariesdialog.h"
#include "qnxdeployqtlibrariesdialog.h"
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/target.h>
......@@ -165,7 +165,8 @@ void BlackBerryCreatePackageStepConfigWidget::updateDeployWidgetsState()
void BlackBerryCreatePackageStepConfigWidget::deployLibraries()
{
ProjectExplorer::Kit *kit = m_step->target()->kit();
BlackBerryDeployQtLibrariesDialog dlg(ProjectExplorer::DeviceKitInformation::device(kit),
this);
QnxDeployQtLibrariesDialog dlg(ProjectExplorer::DeviceKitInformation::device(kit),
QnxDeployQtLibrariesDialog::BB10,
this);
dlg.execAndDeploy(QtSupport::QtKitInformation::qtVersionId(kit), m_ui->qtLibraryPath->text());
}
......@@ -33,7 +33,7 @@
#include "qnxconstants.h"
#include "qnxdeviceprocesssignaloperation.h"
#include "blackberrydeployqtlibrariesdialog.h"
#include "qnxdeployqtlibrariesdialog.h"
#include "blackberrydeviceconfigurationwidget.h"
#include "blackberrydeviceconnectionmanager.h"
#include "qnxdeviceprocesslist.h"
......@@ -160,7 +160,7 @@ void BlackBerryDeviceConfiguration::executeAction(Core::Id actionId, QWidget *pa
&& connectionManager->isConnected(id())) {
connectionManager->disconnectDevice(device);
} else if (actionId == Core::Id(DeployQtLibrariesActionId)) {
BlackBerryDeployQtLibrariesDialog dialog(device, parent);
QnxDeployQtLibrariesDialog dialog(device, QnxDeployQtLibrariesDialog::BB10, parent);
dialog.exec();
}
}
......
......@@ -97,7 +97,6 @@ SOURCES += qnxplugin.cpp \
blackberrycheckdevicestatusstep.cpp \
qnxattachdebugsupport.cpp \
qnxattachdebugdialog.cpp \
blackberrydeployqtlibrariesdialog.cpp \
blackberrysetuppage.cpp \
blackberrysetupwidget.cpp \
blackberryruntimeconfiguration.cpp \
......@@ -110,7 +109,8 @@ SOURCES += qnxplugin.cpp \
qnxsettingswidget.cpp \
qnxconfigurationmanager.cpp \
qnxsettingspage.cpp \
qnxversionnumber.cpp
qnxversionnumber.cpp \
qnxdeployqtlibrariesdialog.cpp
HEADERS += qnxplugin.h\
qnxconstants.h \
......@@ -208,7 +208,6 @@ HEADERS += qnxplugin.h\
blackberrycheckdevicestatusstepconfigwidget.h \
qnxattachdebugsupport.h \
qnxattachdebugdialog.h \
blackberrydeployqtlibrariesdialog.h \
blackberrysetuppage.h \
blackberrysetupwidget.h \
blackberryruntimeconfiguration.h \
......@@ -221,7 +220,8 @@ HEADERS += qnxplugin.h\
qnxsettingswidget.h \
qnxconfigurationmanager.h \
qnxsettingspage.h \
qnxversionnumber.h
qnxversionnumber.h \
qnxdeployqtlibrariesdialog.h
FORMS += \
blackberrydeviceconfigurationwizardsetuppage.ui \
......@@ -251,8 +251,8 @@ FORMS += \
blackberryinstallwizardoptionpage.ui \
blackberrydebugtokenpinsdialog.ui \
blackberrycheckdevicestatusstepconfigwidget.ui \
blackberrydeployqtlibrariesdialog.ui \
qnxsettingswidget.ui
qnxsettingswidget.ui \
qnxdeployqtlibrariesdialog.ui
include(../../private_headers.pri)
include(./cascadesimport/cascadesimport.pri)
......
......@@ -90,9 +90,9 @@ QtcPlugin {
"blackberrydeployconfigurationwidget.ui",
"blackberrydeployinformation.cpp",
"blackberrydeployinformation.h",
"blackberrydeployqtlibrariesdialog.cpp",
"blackberrydeployqtlibrariesdialog.h",
"blackberrydeployqtlibrariesdialog.ui",
"qnxdeployqtlibrariesdialog.cpp",
"qnxdeployqtlibrariesdialog.h",
"qnxdeployqtlibrariesdialog.ui",
"blackberrydeploystep.cpp",
"blackberrydeploystep.h",
"blackberrydeploystepconfigwidget.cpp",
......
......@@ -29,10 +29,11 @@
**
****************************************************************************/
#include "blackberrydeployqtlibrariesdialog.h"
#include "ui_blackberrydeployqtlibrariesdialog.h"
#include "qnxdeployqtlibrariesdialog.h"
#include "ui_qnxdeployqtlibrariesdialog.h"
#include "blackberryqtversion.h"
#include "qnxqtversion.h"
#include <projectexplorer/deployablefile.h>
#include <qtsupport/qtversionmanager.h>
......@@ -46,25 +47,37 @@
using namespace Qnx;
using namespace Qnx::Internal;
BlackBerryDeployQtLibrariesDialog::BlackBerryDeployQtLibrariesDialog(
const ProjectExplorer::IDevice::ConstPtr &device, QWidget *parent)
QnxDeployQtLibrariesDialog::QnxDeployQtLibrariesDialog(
const ProjectExplorer::IDevice::ConstPtr &device, Target target, QWidget *parent)
: QDialog(parent)
, m_ui(new Ui::BlackBerryDeployQtLibrariesDialog)
, m_ui(new Ui::QnxDeployQtLibrariesDialog)
, m_device(device)
, m_progressCount(0)
, m_state(Inactive)
, m_target(target)
{
m_ui->setupUi(this);
QList<QtSupport::BaseQtVersion*> qtVersions = QtSupport::QtVersionManager::validVersions();
foreach (QtSupport::BaseQtVersion *qtVersion, qtVersions) {
BlackBerryQtVersion *blackBerryQt = dynamic_cast<BlackBerryQtVersion *>(qtVersion);
if (!blackBerryQt)
QnxAbstractQtVersion *qnxQt;
if (m_target == BB10)
qnxQt = dynamic_cast<BlackBerryQtVersion *>(qtVersion);
else
qnxQt = dynamic_cast<QnxQtVersion *>(qtVersion);
if (!qnxQt)
continue;
m_ui->qtLibraryCombo->addItem(blackBerryQt->displayName(), blackBerryQt->uniqueId());
m_ui->qtLibraryCombo->addItem(qnxQt->displayName(), qnxQt->uniqueId());
}
m_ui->basePathLabel->setText(m_target == BB10 ?
QLatin1String(Constants::QNX_BLACKBERRY_DEFAULT_DEPLOY_QT_BASEPATH) :
QString());
m_ui->remoteDirectory->setText(m_target == BB10 ? QLatin1String("qt") : QLatin1String("/qt"));
m_uploadService = new RemoteLinux::GenericDirectUploadService(this);
m_uploadService->setDevice(m_device);
......@@ -91,12 +104,12 @@ BlackBerryDeployQtLibrariesDialog::BlackBerryDeployQtLibrariesDialog(
connect(m_ui->closeButton, SIGNAL(clicked()), this, SLOT(close()));
}
BlackBerryDeployQtLibrariesDialog::~BlackBerryDeployQtLibrariesDialog()
QnxDeployQtLibrariesDialog::~QnxDeployQtLibrariesDialog()
{
delete m_ui;
}
int BlackBerryDeployQtLibrariesDialog::execAndDeploy(int qtVersionId, const QString &remoteDirectory)
int QnxDeployQtLibrariesDialog::execAndDeploy(int qtVersionId, const QString &remoteDirectory)
{
m_ui->remoteDirectory->setText(remoteDirectory);
m_ui->qtLibraryCombo->setCurrentIndex(m_ui->qtLibraryCombo->findData(qtVersionId));
......@@ -105,7 +118,7 @@ int BlackBerryDeployQtLibrariesDialog::execAndDeploy(int qtVersionId, const QStr
return exec();
}
void BlackBerryDeployQtLibrariesDialog::closeEvent(QCloseEvent *event)
void QnxDeployQtLibrariesDialog::closeEvent(QCloseEvent *event)
{
// A disabled Deploy button indicates the upload is still running
if (!m_ui->deployButton->isEnabled()) {
......@@ -120,7 +133,7 @@ void BlackBerryDeployQtLibrariesDialog::closeEvent(QCloseEvent *event)
}
}
void BlackBerryDeployQtLibrariesDialog::deployLibraries()
void QnxDeployQtLibrariesDialog::deployLibraries()
{
QTC_ASSERT(m_state == Inactive, return);
......@@ -142,7 +155,7 @@ void BlackBerryDeployQtLibrariesDialog::deployLibraries()
checkRemoteDirectoryExistance();
}
void BlackBerryDeployQtLibrariesDialog::startUpload()
void QnxDeployQtLibrariesDialog::startUpload()
{
QTC_CHECK(m_state == CheckingRemoteDirectory || m_state == RemovingRemoteDirectory);
......@@ -156,7 +169,7 @@ void BlackBerryDeployQtLibrariesDialog::startUpload()
m_uploadService->start();
}
void BlackBerryDeployQtLibrariesDialog::updateProgress(const QString &progressMessage)
void QnxDeployQtLibrariesDialog::updateProgress(const QString &progressMessage)
{
QTC_CHECK(m_state == Uploading);
......@@ -168,7 +181,7 @@ void BlackBerryDeployQtLibrariesDialog::updateProgress(const QString &progressMe
m_ui->deployProgress->setValue(m_progressCount);
}
void BlackBerryDeployQtLibrariesDialog::handleUploadFinished()
void QnxDeployQtLibrariesDialog::handleUploadFinished()
{
m_ui->remoteDirectory->setEnabled(true);
m_ui->deployButton->setEnabled(true);
......@@ -177,7 +190,7 @@ void BlackBerryDeployQtLibrariesDialog::handleUploadFinished()
m_state = Inactive;
}
void BlackBerryDeployQtLibrariesDialog::handleRemoteProcessError()
void QnxDeployQtLibrariesDialog::handleRemoteProcessError()
{
QTC_CHECK(m_state == CheckingRemoteDirectory || m_state == RemovingRemoteDirectory);
......@@ -187,7 +200,7 @@ void BlackBerryDeployQtLibrariesDialog::handleRemoteProcessError()
handleUploadFinished();
}
void BlackBerryDeployQtLibrariesDialog::handleRemoteProcessCompleted()
void QnxDeployQtLibrariesDialog::handleRemoteProcessCompleted()
{
QTC_CHECK(m_state == CheckingRemoteDirectory || m_state == RemovingRemoteDirectory);
......@@ -215,14 +228,19 @@ void BlackBerryDeployQtLibrariesDialog::handleRemoteProcessCompleted()
}
}
QList<ProjectExplorer::DeployableFile> BlackBerryDeployQtLibrariesDialog::gatherFiles()
QList<ProjectExplorer::DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles()
{
QList<ProjectExplorer::DeployableFile> result;
const int qtVersionId =
m_ui->qtLibraryCombo->itemData(m_ui->qtLibraryCombo->currentIndex()).toInt();
BlackBerryQtVersion *qtVersion =
dynamic_cast<BlackBerryQtVersion *>(QtSupport::QtVersionManager::version(qtVersionId));
QnxAbstractQtVersion *qtVersion;
if (m_target == BB10)
qtVersion = dynamic_cast<BlackBerryQtVersion *>(QtSupport::QtVersionManager::version(qtVersionId));
else
qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtVersionManager::version(qtVersionId));
QTC_ASSERT(qtVersion, return result);
......@@ -234,7 +252,7 @@ QList<ProjectExplorer::DeployableFile> BlackBerryDeployQtLibrariesDialog::gather
return result;
}
QList<ProjectExplorer::DeployableFile> BlackBerryDeployQtLibrariesDialog::gatherFiles(
QList<ProjectExplorer::DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles(
const QString &dirPath, const QString &baseDirPath)
{
QList<ProjectExplorer::DeployableFile> result;
......@@ -267,12 +285,16 @@ QList<ProjectExplorer::DeployableFile> BlackBerryDeployQtLibrariesDialog::gather
return result;
}
QString BlackBerryDeployQtLibrariesDialog::fullRemoteDirectory() const
QString QnxDeployQtLibrariesDialog::fullRemoteDirectory() const
{
return QLatin1String(Constants::QNX_BLACKBERRY_DEFAULT_DEPLOY_QT_BASEPATH) + m_ui->remoteDirectory->text();
QString basePath;
if (m_target == BB10)
basePath = QLatin1String(Constants::QNX_BLACKBERRY_DEFAULT_DEPLOY_QT_BASEPATH);
return basePath + m_ui->remoteDirectory->text();
}
void BlackBerryDeployQtLibrariesDialog::checkRemoteDirectoryExistance()
void QnxDeployQtLibrariesDialog::checkRemoteDirectoryExistance()
{
QTC_CHECK(m_state == Inactive);
......@@ -285,7 +307,7 @@ void BlackBerryDeployQtLibrariesDialog::checkRemoteDirectoryExistance()
m_processRunner->run(cmd, m_device->sshParameters());
}
void BlackBerryDeployQtLibrariesDialog::removeRemoteDirectory()
void QnxDeployQtLibrariesDialog::removeRemoteDirectory()
{
QTC_CHECK(m_state == CheckingRemoteDirectory);
......
......@@ -29,8 +29,8 @@
**
****************************************************************************/
#ifndef QNX_INTERNAL_BLACKBERRYDEPLOYQTLIBRARIESDIALOG_H
#define QNX_INTERNAL_BLACKBERRYDEPLOYQTLIBRARIESDIALOG_H
#ifndef QNX_INTERNAL_QNXDEPLOYQTLIBRARIESDIALOG_H
#define QNX_INTERNAL_QNXDEPLOYQTLIBRARIESDIALOG_H
#include <QDialog>
......@@ -49,10 +49,10 @@ namespace Qnx {
namespace Internal {
namespace Ui {
class BlackBerryDeployQtLibrariesDialog;
class QnxDeployQtLibrariesDialog;
}
class BlackBerryDeployQtLibrariesDialog : public QDialog
class QnxDeployQtLibrariesDialog : public QDialog
{
Q_OBJECT
......@@ -64,9 +64,15 @@ public:
Uploading
};
explicit BlackBerryDeployQtLibrariesDialog(const ProjectExplorer::IDevice::ConstPtr &device,
enum Target {
BB10,
QNX
};
explicit QnxDeployQtLibrariesDialog(const ProjectExplorer::IDevice::ConstPtr &device,
Target target = QNX,
QWidget *parent = 0);
~BlackBerryDeployQtLibrariesDialog();
~QnxDeployQtLibrariesDialog();
int execAndDeploy(int qtVersionId, const QString &remoteDirectory);
......@@ -91,7 +97,7 @@ private:
void removeRemoteDirectory();
void startUpload();
Ui::BlackBerryDeployQtLibrariesDialog *m_ui;
Ui::QnxDeployQtLibrariesDialog *m_ui;
QSsh::SshRemoteProcessRunner *m_processRunner;
RemoteLinux::GenericDirectUploadService *m_uploadService;
......@@ -101,9 +107,10 @@ private:
int m_progressCount;
State m_state;
Target m_target;
};
} // namespace Internal
} // namespace Qnx
#endif // QNX_INTERNAL_BLACKBERRYDEPLOYQTLIBRARIESDIALOG_H
#endif // QNX_INTERNAL_QNXDEPLOYQTLIBRARIESDIALOG_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Qnx::Internal::BlackBerryDeployQtLibrariesDialog</class>
<widget class="QDialog" name="Qnx::Internal::BlackBerryDeployQtLibrariesDialog">
<class>Qnx::Internal::QnxDeployQtLibrariesDialog</class>
<widget class="QDialog" name="Qnx::Internal::QnxDeployQtLibrariesDialog">
<property name="geometry">
<rect>
<x>0</x>
......@@ -56,16 +56,16 @@
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="basePathLabel">
<property name="text">
<string>/accounts/devuser/</string>
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="remoteDirectory">
<property name="text">
<string>qt</string>
<string/>
</property>
</widget>
</item>
......
......@@ -33,6 +33,7 @@
#include "qnxdevicetester.h"
#include "qnxdeviceprocesslist.h"
#include "qnxdeviceprocesssignaloperation.h"
#include "qnxdeployqtlibrariesdialog.h"
#include <projectexplorer/devicesupport/sshdeviceprocess.h>
#include <ssh/sshconnection.h>
......@@ -48,6 +49,7 @@ using namespace Qnx::Internal;
namespace {
const char QnxVersionKey[] = "QnxVersion";
const char DeployQtLibrariesActionId [] = "Qnx.Qnx.DeployQtLibrariesAction";
}
class QnxPortsGatheringMethod : public ProjectExplorer::PortsGatheringMethod
......@@ -193,6 +195,33 @@ ProjectExplorer::DeviceTester *QnxDeviceConfiguration::createDeviceTester() cons
return new QnxDeviceTester;
}
QList<Core::Id> QnxDeviceConfiguration::actionIds() const
{
QList<Core::Id> actions = RemoteLinux::LinuxDevice::actionIds();
actions << Core::Id(DeployQtLibrariesActionId);
return actions;
}
QString QnxDeviceConfiguration::displayNameForActionId(Core::Id actionId) const
{
if (actionId == Core::Id(DeployQtLibrariesActionId))
return tr("Deploy Qt libraries...");
return RemoteLinux::LinuxDevice::displayNameForActionId(actionId);
}
void QnxDeviceConfiguration::executeAction(Core::Id actionId, QWidget *parent)
{
const QnxDeviceConfiguration::ConstPtr device =
sharedFromThis().staticCast<const QnxDeviceConfiguration>();
if (actionId == Core::Id(DeployQtLibrariesActionId)) {
QnxDeployQtLibrariesDialog dialog(device, QnxDeployQtLibrariesDialog::QNX, parent);
dialog.exec();
} else {
RemoteLinux::LinuxDevice::executeAction(actionId, parent);
}
}
ProjectExplorer::DeviceProcessSignalOperation::Ptr QnxDeviceConfiguration::signalOperation() const
{
return ProjectExplorer::DeviceProcessSignalOperation::Ptr(
......
......@@ -56,6 +56,10 @@ public:
ProjectExplorer::DeviceTester *createDeviceTester() const;
QList<Core::Id> actionIds() const;
QString displayNameForActionId(Core::Id actionId) const;
void executeAction(Core::Id actionId, QWidget *parent);
QString displayType() const;
int qnxVersion() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment