2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2012-07-27 13:31:13 +02:00
|
|
|
|
2011-06-16 17:03:43 +02:00
|
|
|
#include "genericlinuxdeviceconfigurationwizard.h"
|
|
|
|
|
|
2011-06-21 12:44:52 +02:00
|
|
|
#include "genericlinuxdeviceconfigurationwizardpages.h"
|
2012-07-27 13:31:13 +02:00
|
|
|
#include "linuxdevice.h"
|
2011-07-25 11:55:00 +02:00
|
|
|
#include "remotelinux_constants.h"
|
2022-07-15 12:20:23 +02:00
|
|
|
#include "remotelinuxtr.h"
|
2012-07-27 13:31:13 +02:00
|
|
|
|
2022-04-12 21:01:45 +02:00
|
|
|
#include <projectexplorer/devicesupport/idevice.h>
|
2022-05-13 01:08:44 +02:00
|
|
|
#include <projectexplorer/devicesupport/sshparameters.h>
|
2022-07-15 12:20:23 +02:00
|
|
|
|
2012-02-28 10:34:50 +01:00
|
|
|
#include <utils/portlist.h>
|
2021-07-07 17:33:32 +02:00
|
|
|
#include <utils/fileutils.h>
|
2011-06-16 17:03:43 +02:00
|
|
|
|
2012-03-06 12:31:42 +01:00
|
|
|
using namespace ProjectExplorer;
|
2011-06-16 17:03:43 +02:00
|
|
|
|
|
|
|
|
namespace RemoteLinux {
|
|
|
|
|
namespace Internal {
|
2018-12-21 14:01:17 +01:00
|
|
|
enum PageId { SetupPageId, KeyDeploymentPageId, FinalPageId };
|
2011-06-16 17:03:43 +02:00
|
|
|
|
|
|
|
|
class GenericLinuxDeviceConfigurationWizardPrivate
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
GenericLinuxDeviceConfigurationWizardPrivate(QWidget *parent)
|
2018-12-21 14:01:17 +01:00
|
|
|
: setupPage(parent), keyDeploymentPage(parent), finalPage(parent)
|
2011-06-16 17:03:43 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GenericLinuxDeviceConfigurationWizardSetupPage setupPage;
|
2018-12-21 14:01:17 +01:00
|
|
|
GenericLinuxDeviceConfigurationWizardKeyDeploymentPage keyDeploymentPage;
|
2011-06-16 17:03:43 +02:00
|
|
|
GenericLinuxDeviceConfigurationWizardFinalPage finalPage;
|
2018-12-21 14:01:17 +01:00
|
|
|
LinuxDevice::Ptr device;
|
2011-06-16 17:03:43 +02:00
|
|
|
};
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
|
|
|
|
|
GenericLinuxDeviceConfigurationWizard::GenericLinuxDeviceConfigurationWizard(QWidget *parent)
|
2013-10-09 11:20:26 +02:00
|
|
|
: Utils::Wizard(parent),
|
2011-09-15 09:10:10 +02:00
|
|
|
d(new Internal::GenericLinuxDeviceConfigurationWizardPrivate(this))
|
2011-06-16 17:03:43 +02:00
|
|
|
{
|
2022-07-15 12:20:23 +02:00
|
|
|
setWindowTitle(Tr::tr("New Remote Linux Device Configuration Setup"));
|
2011-09-15 09:10:10 +02:00
|
|
|
setPage(Internal::SetupPageId, &d->setupPage);
|
2018-12-21 14:01:17 +01:00
|
|
|
setPage(Internal::KeyDeploymentPageId, &d->keyDeploymentPage);
|
2011-09-15 09:10:10 +02:00
|
|
|
setPage(Internal::FinalPageId, &d->finalPage);
|
|
|
|
|
d->finalPage.setCommitPage(true);
|
2019-01-15 08:51:13 +01:00
|
|
|
d->device = LinuxDevice::create();
|
2020-06-26 13:59:38 +02:00
|
|
|
d->device->setupId(IDevice::ManuallyAdded, Utils::Id());
|
2019-01-14 16:11:27 +01:00
|
|
|
d->device->setType(Constants::GenericLinuxOsType);
|
2019-01-14 15:27:52 +01:00
|
|
|
d->device->setMachineType(IDevice::Hardware);
|
2018-12-21 14:01:17 +01:00
|
|
|
d->device->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100")));
|
2022-05-12 18:43:44 +02:00
|
|
|
SshParameters sshParams;
|
2018-12-21 14:01:17 +01:00
|
|
|
sshParams.timeout = 10;
|
|
|
|
|
d->device->setSshParameters(sshParams);
|
|
|
|
|
d->setupPage.setDevice(d->device);
|
|
|
|
|
d->keyDeploymentPage.setDevice(d->device);
|
2011-06-16 17:03:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GenericLinuxDeviceConfigurationWizard::~GenericLinuxDeviceConfigurationWizard()
|
|
|
|
|
{
|
2011-09-15 09:10:10 +02:00
|
|
|
delete d;
|
2011-06-16 17:03:43 +02:00
|
|
|
}
|
|
|
|
|
|
2012-03-06 12:31:42 +01:00
|
|
|
IDevice::Ptr GenericLinuxDeviceConfigurationWizard::device()
|
2011-06-16 17:03:43 +02:00
|
|
|
{
|
2018-12-21 14:01:17 +01:00
|
|
|
return d->device;
|
2011-06-16 17:03:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace RemoteLinux
|