Commit 269d5193 authored by David Kaspar's avatar David Kaspar

Qnx: Add BlackBerry Device wizard queries device to prefill wizard fields

BlackBerry Device wizard is having the following pages:
* Setup page - simplified to contains the device listing,
device host name and device password fields only
* Query page - queries device for information
* SshKey page - no changes there
* Config page - contains config-name and debug token fields

Change-Id: I30e05b984960df2184353209bff1f07c9440e6b1
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
Reviewed-by: default avatarDavid Kaspar <dkaspar@blackberry.com>
parent 4ed17ade
......@@ -99,6 +99,11 @@ QString BlackBerryDebugTokenRequestDialog::debugToken() const
return m_ui->debugTokenPath->path();
}
void BlackBerryDebugTokenRequestDialog::setDevicePin(const QString &devicePin)
{
m_ui->devicePin->setText(devicePin);
}
void BlackBerryDebugTokenRequestDialog::setTargetDetails(const QString &deviceIp, const QString &password)
{
m_ui->devicePin->setPlaceholderText(tr("Requesting Device PIN..."));
......
......@@ -55,6 +55,7 @@ public:
~BlackBerryDebugTokenRequestDialog();
QString debugToken() const;
void setDevicePin(const QString &devicePin);
void setTargetDetails(const QString &deviceIp, const QString &password);
private slots:
......
......@@ -45,11 +45,15 @@ BlackBerryDeviceConfigurationWizard::BlackBerryDeviceConfigurationWizard(QWidget
setWindowTitle(tr("New BlackBerry Device Configuration Setup"));
m_setupPage = new BlackBerryDeviceConfigurationWizardSetupPage(this);
m_queryPage = new BlackBerryDeviceConfigurationWizardQueryPage(m_holder, this);
m_sshKeyPage = new BlackBerryDeviceConfigurationWizardSshKeyPage(this);
m_configPage = new BlackBerryDeviceConfigurationWizardConfigPage(m_holder, this);
m_finalPage = new BlackBerryDeviceConfigurationWizardFinalPage(this);
setPage(SetupPageId, m_setupPage);
setPage(QueryPageId, m_queryPage);
setPage(SshKeyPageId, m_sshKeyPage);
setPage(ConfigPageId, m_configPage);
setPage(FinalPageId, m_finalPage);
m_finalPage->setCommitPage(true);
}
......@@ -66,10 +70,13 @@ ProjectExplorer::IDevice::Ptr BlackBerryDeviceConfigurationWizard::device()
sshParams.timeout = 10;
sshParams.port = 22;
BlackBerryDeviceConfiguration::Ptr configuration = BlackBerryDeviceConfiguration::create(m_setupPage->deviceName(),
Core::Id(Constants::QNX_BB_OS_TYPE),
m_setupPage->machineType());
BlackBerryDeviceConfiguration::Ptr configuration = BlackBerryDeviceConfiguration::create(
m_configPage->configurationName(),
Core::Id(Constants::QNX_BB_OS_TYPE),
m_holder.isSimulator
? ProjectExplorer::IDevice::Emulator
: ProjectExplorer::IDevice::Hardware);
configuration->setSshParameters(sshParams);
configuration->setDebugToken(m_setupPage->debugToken());
configuration->setDebugToken(m_configPage->debugToken());
return configuration;
}
......@@ -32,6 +32,8 @@
#ifndef QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARD_H
#define QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARD_H
#include "blackberrydeviceconfigurationwizardpages.h"
#include <QWizard>
#include <projectexplorer/devicesupport/idevice.h>
......@@ -39,10 +41,6 @@
namespace Qnx {
namespace Internal {
class BlackBerryDeviceConfigurationWizardSetupPage;
class BlackBerryDeviceConfigurationWizardSshKeyPage;
class BlackBerryDeviceConfigurationWizardFinalPage;
class BlackBerryDeviceConfigurationWizard : public QWizard
{
Q_OBJECT
......@@ -54,13 +52,19 @@ public:
private:
enum PageId {
SetupPageId,
QueryPageId,
SshKeyPageId,
ConfigPageId,
FinalPageId
};
BlackBerryDeviceConfigurationWizardSetupPage *m_setupPage;
BlackBerryDeviceConfigurationWizardQueryPage *m_queryPage;
BlackBerryDeviceConfigurationWizardSshKeyPage *m_sshKeyPage;
BlackBerryDeviceConfigurationWizardConfigPage *m_configPage;
BlackBerryDeviceConfigurationWizardFinalPage *m_finalPage;
BlackBerryDeviceConfigurationWizardHolder m_holder;
};
} // namespace Internal
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Qnx::Internal::BlackBerryDeviceConfigurationWizardConfigPage</class>
<widget class="QWizardPage" name="Qnx::Internal::BlackBerryDeviceConfigurationWizardConfigPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>477</width>
<height>348</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Debug Token</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Location:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="generateButton">
<property name="text">
<string>Generate</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Utils::PathChooser" name="debugTokenField" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Debug Token is needed for BlackBerry applications deployment to a device.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="0">
<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>
<item row="2" column="0" colspan="3">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="1">
<widget class="QLabel" name="deviceTypeField">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Type:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="deviceHostNameField">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Host name/IP:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Configuration name:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="configurationNameField"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::PathChooser</class>
<extends>QWidget</extends>
<header location="global">utils/pathchooser.h</header>
<container>1</container>
<slots>
<signal>editingFinished()</signal>
<signal>browsingFinished()</signal>
</slots>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>generateButton</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
......@@ -47,9 +47,27 @@ namespace Qnx {
namespace Internal {
namespace Ui {
class BlackBerryDeviceConfigurationWizardSetupPage;
class BlackBerryDeviceConfigurationWizardQueryPage;
class BlackBerryDeviceConfigurationWizardSshKeyPage;
class BlackBerryDeviceConfigurationWizardConfigPage;
}
class BlackBerrySshKeysGenerator;
class BlackBerryDeviceInformation;
struct BlackBerryDeviceConfigurationWizardHolder {
QString devicePin;
QString deviceName;
QString scmBundle;
QString debugTokenAuthor;
bool isSimulator;
bool debugTokenValid;
bool deviceInfoRetrieved;
BlackBerryDeviceConfigurationWizardHolder()
: isSimulator(false)
, debugTokenValid(false)
, deviceInfoRetrieved(false) {}
};
class BlackBerryDeviceConfigurationWizardSetupPage : public QWizardPage
{
......@@ -65,13 +83,9 @@ public:
void initializePage();
bool isComplete() const;
QString deviceName() const;
QString hostName() const;
QString password() const;
QString debugToken() const;
ProjectExplorer::IDevice::MachineType machineType() const;
private slots:
void requestDebugToken();
void onDeviceSelectionChanged();
void onDeviceDetected(const QString &deviceName, const QString &hostName, bool isSimulator);
void onDeviceListDetectorFinished();
......@@ -85,6 +99,25 @@ private:
BlackBerryDeviceListDetector *m_deviceListDetector;
};
class BlackBerryDeviceConfigurationWizardQueryPage : public QWizardPage
{
Q_OBJECT
public:
explicit BlackBerryDeviceConfigurationWizardQueryPage(BlackBerryDeviceConfigurationWizardHolder &holder, QWidget *parent = 0);
~BlackBerryDeviceConfigurationWizardQueryPage();
void initializePage();
bool isComplete() const;
private slots:
void processQueryFinished(int status);
private:
Ui::BlackBerryDeviceConfigurationWizardQueryPage *m_ui;
BlackBerryDeviceConfigurationWizardHolder &m_holder;
BlackBerryDeviceInformation *m_deviceInformation;
};
class BlackBerryDeviceConfigurationWizardSshKeyPage : public QWizardPage
{
Q_OBJECT
......@@ -112,6 +145,26 @@ private:
Ui::BlackBerryDeviceConfigurationWizardSshKeyPage *m_ui;
};
class BlackBerryDeviceConfigurationWizardConfigPage : public QWizardPage
{
Q_OBJECT
public:
explicit BlackBerryDeviceConfigurationWizardConfigPage(BlackBerryDeviceConfigurationWizardHolder &holder, QWidget *parent = 0);
~BlackBerryDeviceConfigurationWizardConfigPage();
void initializePage();
bool isComplete() const;
QString configurationName() const;
QString debugToken() const;
private slots:
void generateDebugToken();
private:
Ui::BlackBerryDeviceConfigurationWizardConfigPage *m_ui;
BlackBerryDeviceConfigurationWizardHolder &m_holder;
};
class BlackBerryDeviceConfigurationWizardFinalPage : public QWizardPage
{
Q_OBJECT
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Qnx::Internal::BlackBerryDeviceConfigurationWizardQueryPage</class>
<widget class="QWizardPage" name="Qnx::Internal::BlackBerryDeviceConfigurationWizardQueryPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>381</width>
<height>142</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="statusLabel">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="maximum">
<number>0</number>
</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>58</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>612</width>
<height>303</height>
<width>484</width>
<height>182</height>
</rect>
</property>
<property name="windowTitle">
......@@ -19,139 +19,34 @@
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Configuration name:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="deviceName"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Device type:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="physicalDevice">
<property name="text">
<string>Physical device</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="simulator">
<property name="text">
<string>Simulator</string>
</property>
</widget>
</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>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Device host name or IP address:</string>
<widget class="QLineEdit" name="password">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="deviceHostIp"/>
</item>
<item row="3" column="0">
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Device password:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="password">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
<item row="0" column="1">
<widget class="QLineEdit" name="deviceHostIp"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Debug token:</string>
<string>Device host name or IP address:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="Utils::PathChooser" name="debugToken" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="requestButton">
<property name="text">
<string>Request</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::PathChooser</class>
<extends>QWidget</extends>
<header location="global">utils/pathchooser.h</header>
<container>1</container>
<slots>
<signal>editingFinished()</signal>
<signal>browsingFinished()</signal>
</slots>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>physicalDevice</sender>
<signal>toggled(bool)</signal>
<receiver>debugToken</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>271</x>
<y>98</y>
</hint>
<hint type="destinationlabel">
<x>226</x>
<y>124</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>
......@@ -6,14 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>413</width>
<height>92</height>
<width>409</width>
<height>185</height>
</rect>
</property>
<property name="windowTitle">
<string>WizardPage</string>
</property>
<layout class="QFormLayout" name="formLayout">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
......@@ -21,6 +21,13 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="publicKey">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
......@@ -35,6 +42,29 @@
</item>
</layout>
</item>
<item row="2" column="1">
<widget class="QProgressBar" name="progressBar">
<property name="maximum">
<number>0</number>
</property>
<property name="value">
<number>-1</number>
</property>
</widget>
</item>
<item row="3" column="1">
<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>