Skip to content
Snippets Groups Projects
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: default avatarNicolas Arnaud-Cormos <nicolas@kdab.com>
parent 5942b48e
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,11 @@ using namespace Qnx::Internal; ...@@ -45,6 +45,11 @@ using namespace Qnx::Internal;
namespace { namespace {
const char DEVICENAME_FIELD_ID[] = "DeviceName"; 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) BlackBerryDeviceConfigurationWizardSetupPage::BlackBerryDeviceConfigurationWizardSetupPage(QWidget *parent)
...@@ -59,7 +64,7 @@ BlackBerryDeviceConfigurationWizardSetupPage::BlackBerryDeviceConfigurationWizar ...@@ -59,7 +64,7 @@ BlackBerryDeviceConfigurationWizardSetupPage::BlackBerryDeviceConfigurationWizar
connect(m_ui->deviceName, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged())); connect(m_ui->deviceName, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged()));
connect(m_ui->deviceHostIp, 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())); connect(m_ui->debugToken, SIGNAL(changed(QString)), this, SIGNAL(completeChanged()));
registerField(QLatin1String(DEVICENAME_FIELD_ID), m_ui->deviceName); registerField(QLatin1String(DEVICENAME_FIELD_ID), m_ui->deviceName);
...@@ -74,9 +79,9 @@ BlackBerryDeviceConfigurationWizardSetupPage::~BlackBerryDeviceConfigurationWiza ...@@ -74,9 +79,9 @@ BlackBerryDeviceConfigurationWizardSetupPage::~BlackBerryDeviceConfigurationWiza
void BlackBerryDeviceConfigurationWizardSetupPage::initializePage() void BlackBerryDeviceConfigurationWizardSetupPage::initializePage()
{ {
m_ui->deviceName->setText(tr("BlackBerry Device")); m_ui->deviceName->setText(tr("BlackBerry Device"));
m_ui->deviceHostIp->setText(QString());
m_ui->password->setText(QString()); m_ui->password->setText(QString());
m_ui->physicalDevice->setChecked(true); m_ui->physicalDevice->setChecked(true);
m_ui->deviceHostIp->setText(defaultDeviceHostIp(machineType()));
} }
bool BlackBerryDeviceConfigurationWizardSetupPage::isComplete() const bool BlackBerryDeviceConfigurationWizardSetupPage::isComplete() const
...@@ -114,6 +119,11 @@ IDevice::MachineType BlackBerryDeviceConfigurationWizardSetupPage::machineType() ...@@ -114,6 +119,11 @@ IDevice::MachineType BlackBerryDeviceConfigurationWizardSetupPage::machineType()
return m_ui->physicalDevice->isChecked() ? IDevice::Hardware : IDevice::Emulator; return m_ui->physicalDevice->isChecked() ? IDevice::Hardware : IDevice::Emulator;
} }
void BlackBerryDeviceConfigurationWizardSetupPage::handleMachineTypeChanged()
{
m_ui->deviceHostIp->setText(defaultDeviceHostIp(machineType()));
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
......
...@@ -63,6 +63,9 @@ public: ...@@ -63,6 +63,9 @@ public:
QString debugToken() const; QString debugToken() const;
ProjectExplorer::IDevice::MachineType machineType() const; ProjectExplorer::IDevice::MachineType machineType() const;
private slots:
void handleMachineTypeChanged();
private: private:
Ui::BlackBerryDeviceConfigurationWizardSetupPage *m_ui; Ui::BlackBerryDeviceConfigurationWizardSetupPage *m_ui;
}; };
......
...@@ -7,13 +7,16 @@ ...@@ -7,13 +7,16 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>546</width> <width>546</width>
<height>148</height> <height>170</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>WizardPage</string> <string>WizardPage</string>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
...@@ -24,14 +27,14 @@ ...@@ -24,14 +27,14 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="deviceName"/> <widget class="QLineEdit" name="deviceName"/>
</item> </item>
<item row="1" column="0"> <item row="3" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>The device's host name or IP address:</string> <string>The device's host name or IP address:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QLineEdit" name="deviceHostIp"/> <widget class="QLineEdit" name="deviceHostIp"/>
...@@ -51,14 +54,14 @@ ...@@ -51,14 +54,14 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="2" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Device password:</string> <string>Device password:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QLineEdit" name="password"> <widget class="QLineEdit" name="password">
...@@ -82,14 +85,24 @@ ...@@ -82,14 +85,24 @@
</item> </item>
</layout> </layout>
</item> </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"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>Device type:</string> <string>Device type:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<widget class="QRadioButton" name="physicalDevice"> <widget class="QRadioButton" name="physicalDevice">
...@@ -107,16 +120,6 @@ ...@@ -107,16 +120,6 @@
</item> </item>
</layout> </layout>
</item> </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> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment