Commit 8f4da818 authored by Mehdi Fekari's avatar Mehdi Fekari Committed by Nicolas Arnaud-Cormos
Browse files

Qnx: Set default device host IP for physical device



Change-Id: I54fa8af84df8853c32adde1b94bc6096930e29ba
Reviewed-by: default avatarTobias Nätterlund <tobias.naetterlund@kdab.com>
Reviewed-by: Nicolas Arnaud-Cormos's avatarNicolas Arnaud-Cormos <nicolas@kdab.com>
parent 5942b48e
......@@ -45,6 +45,11 @@ using namespace Qnx::Internal;
namespace {
const char DEVICENAME_FIELD_ID[] = "DeviceName";
QString defaultDeviceHostIp(IDevice::MachineType type)
{
return type == IDevice::Hardware ? QLatin1String("169.254.0.1") : QString();
}
}
BlackBerryDeviceConfigurationWizardSetupPage::BlackBerryDeviceConfigurationWizardSetupPage(QWidget *parent)
......@@ -59,7 +64,7 @@ BlackBerryDeviceConfigurationWizardSetupPage::BlackBerryDeviceConfigurationWizar
connect(m_ui->deviceName, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged()));
connect(m_ui->deviceHostIp, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged()));
connect(m_ui->physicalDevice, SIGNAL(toggled(bool)), this, SIGNAL(completeChanged()));
connect(m_ui->physicalDevice, SIGNAL(toggled(bool)), this, SLOT(handleMachineTypeChanged()));
connect(m_ui->debugToken, SIGNAL(changed(QString)), this, SIGNAL(completeChanged()));
registerField(QLatin1String(DEVICENAME_FIELD_ID), m_ui->deviceName);
......@@ -74,9 +79,9 @@ BlackBerryDeviceConfigurationWizardSetupPage::~BlackBerryDeviceConfigurationWiza
void BlackBerryDeviceConfigurationWizardSetupPage::initializePage()
{
m_ui->deviceName->setText(tr("BlackBerry Device"));
m_ui->deviceHostIp->setText(QString());
m_ui->password->setText(QString());
m_ui->physicalDevice->setChecked(true);
m_ui->deviceHostIp->setText(defaultDeviceHostIp(machineType()));
}
bool BlackBerryDeviceConfigurationWizardSetupPage::isComplete() const
......@@ -114,6 +119,11 @@ IDevice::MachineType BlackBerryDeviceConfigurationWizardSetupPage::machineType()
return m_ui->physicalDevice->isChecked() ? IDevice::Hardware : IDevice::Emulator;
}
void BlackBerryDeviceConfigurationWizardSetupPage::handleMachineTypeChanged()
{
m_ui->deviceHostIp->setText(defaultDeviceHostIp(machineType()));
}
// ----------------------------------------------------------------------------
......
......@@ -63,6 +63,9 @@ public:
QString debugToken() const;
ProjectExplorer::IDevice::MachineType machineType() const;
private slots:
void handleMachineTypeChanged();
private:
Ui::BlackBerryDeviceConfigurationWizardSetupPage *m_ui;
};
......
......@@ -7,13 +7,16 @@
<x>0</x>
<y>0</y>
<width>546</width>
<height>148</height>
<height>170</height>
</rect>
</property>
<property name="windowTitle">
<string>WizardPage</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
......@@ -24,14 +27,14 @@
<item row="0" column="1">
<widget class="QLineEdit" name="deviceName"/>
</item>
<item row="1" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>The device's host name or IP address:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="deviceHostIp"/>
......@@ -51,14 +54,14 @@
</item>
</layout>
</item>
<item row="2" column="0">
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Device password:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="password">
......@@ -82,14 +85,24 @@
</item>
</layout>
</item>
<item row="3" column="0">
<item row="6" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Debug token:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="Utils::PathChooser" name="debugToken" native="true"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Device type:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QRadioButton" name="physicalDevice">
......@@ -107,16 +120,6 @@
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Debug token:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="Utils::PathChooser" name="debugToken" native="true"/>
</item>
</layout>
</widget>
<customwidgets>
......
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