2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 BlackBerry Limited. All rights reserved.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2012-06-29 07:23:13 +02:00
|
|
|
|
2016-05-19 08:56:05 +02:00
|
|
|
#include "qnxdevicewizard.h"
|
2012-06-29 07:23:13 +02:00
|
|
|
|
|
|
|
|
#include "qnxconstants.h"
|
2023-03-14 16:15:13 +01:00
|
|
|
#include "qnxdevice.h"
|
2022-07-11 14:22:42 +02:00
|
|
|
#include "qnxtr.h"
|
2012-06-29 07:23:13 +02:00
|
|
|
|
2023-03-14 16:15:13 +01:00
|
|
|
#include <coreplugin/icore.h>
|
|
|
|
|
|
2022-05-13 01:08:44 +02:00
|
|
|
#include <projectexplorer/devicesupport/sshparameters.h>
|
2023-03-14 16:15:13 +01:00
|
|
|
|
2012-06-29 07:23:13 +02:00
|
|
|
#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
|
2023-03-14 16:15:13 +01:00
|
|
|
|
2012-06-29 07:23:13 +02:00
|
|
|
#include <utils/portlist.h>
|
2023-03-14 16:15:13 +01:00
|
|
|
#include <utils/wizard.h>
|
2012-06-29 07:23:13 +02:00
|
|
|
|
2012-07-25 17:41:01 +02:00
|
|
|
using namespace ProjectExplorer;
|
2023-03-14 16:15:13 +01:00
|
|
|
using namespace RemoteLinux;
|
|
|
|
|
using namespace Utils;
|
2012-06-29 07:23:13 +02:00
|
|
|
|
2022-07-21 09:19:41 +02:00
|
|
|
namespace Qnx::Internal {
|
2016-05-19 08:56:05 +02:00
|
|
|
|
2023-03-14 16:15:13 +01:00
|
|
|
class QnxDeviceWizard : public Wizard
|
2012-06-29 07:23:13 +02:00
|
|
|
{
|
2023-03-14 16:15:13 +01:00
|
|
|
public:
|
|
|
|
|
QnxDeviceWizard() : Wizard(Core::ICore::dialogParent())
|
|
|
|
|
{
|
|
|
|
|
setWindowTitle(Tr::tr("New QNX Device Configuration Setup"));
|
|
|
|
|
|
|
|
|
|
addPage(&m_setupPage);
|
|
|
|
|
addPage(&m_keyDeploymentPage);
|
|
|
|
|
addPage(&m_finalPage);
|
|
|
|
|
m_finalPage.setCommitPage(true);
|
|
|
|
|
|
|
|
|
|
SshParameters sshParams;
|
|
|
|
|
sshParams.timeout = 10;
|
|
|
|
|
m_device = QnxDevice::create();
|
|
|
|
|
m_device->setupId(IDevice::ManuallyAdded);
|
|
|
|
|
m_device->setType(Constants::QNX_QNX_OS_TYPE);
|
|
|
|
|
m_device->setMachineType(IDevice::Hardware);
|
|
|
|
|
m_device->setSshParameters(sshParams);
|
|
|
|
|
m_device->setFreePorts(PortList::fromString("10000-10100"));
|
|
|
|
|
|
|
|
|
|
m_setupPage.setDevice(m_device);
|
|
|
|
|
m_keyDeploymentPage.setDevice(m_device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IDevice::Ptr device() const { return m_device; }
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
GenericLinuxDeviceConfigurationWizardSetupPage m_setupPage;
|
|
|
|
|
GenericLinuxDeviceConfigurationWizardKeyDeploymentPage m_keyDeploymentPage;
|
|
|
|
|
GenericLinuxDeviceConfigurationWizardFinalPage m_finalPage;
|
|
|
|
|
|
|
|
|
|
LinuxDevice::Ptr m_device;
|
|
|
|
|
};
|
|
|
|
|
|
2012-06-29 07:23:13 +02:00
|
|
|
|
2023-03-14 16:15:13 +01:00
|
|
|
IDevice::Ptr runDeviceWizard()
|
2012-06-29 07:23:13 +02:00
|
|
|
{
|
2023-03-14 16:15:13 +01:00
|
|
|
QnxDeviceWizard wizard;
|
|
|
|
|
if (wizard.exec() != QDialog::Accepted)
|
|
|
|
|
return IDevice::Ptr();
|
|
|
|
|
return wizard.device();
|
2012-06-29 07:23:13 +02:00
|
|
|
}
|
2016-05-19 08:56:05 +02:00
|
|
|
|
2022-07-21 09:19:41 +02:00
|
|
|
} // Qnx::Internal
|