2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-06-16 17:03:43 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-06-16 17:03:43 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-06-16 17:03:43 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2011-06-16 17:03:43 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-06-16 17:03:43 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
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"
|
2012-07-27 13:31:13 +02:00
|
|
|
|
2012-02-28 10:34:50 +01:00
|
|
|
#include <utils/portlist.h>
|
2011-06-16 17:03:43 +02:00
|
|
|
|
2012-03-06 12:31:42 +01:00
|
|
|
using namespace ProjectExplorer;
|
2012-05-18 10:49:35 +02:00
|
|
|
using namespace QSsh;
|
2011-06-16 17:03:43 +02:00
|
|
|
|
|
|
|
|
namespace RemoteLinux {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
namespace {
|
|
|
|
|
enum PageId { SetupPageId, FinalPageId };
|
|
|
|
|
} // anonymous namespace
|
|
|
|
|
|
|
|
|
|
class GenericLinuxDeviceConfigurationWizardPrivate
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
GenericLinuxDeviceConfigurationWizardPrivate(QWidget *parent)
|
|
|
|
|
: setupPage(parent), finalPage(parent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GenericLinuxDeviceConfigurationWizardSetupPage setupPage;
|
|
|
|
|
GenericLinuxDeviceConfigurationWizardFinalPage finalPage;
|
|
|
|
|
};
|
|
|
|
|
} // 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
|
|
|
{
|
|
|
|
|
setWindowTitle(tr("New Generic Linux Device Configuration Setup"));
|
2011-09-15 09:10:10 +02:00
|
|
|
setPage(Internal::SetupPageId, &d->setupPage);
|
|
|
|
|
setPage(Internal::FinalPageId, &d->finalPage);
|
|
|
|
|
d->finalPage.setCommitPage(true);
|
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
|
|
|
{
|
2015-02-03 23:51:02 +02:00
|
|
|
SshConnectionParameters sshParams;
|
2012-10-11 15:34:33 +02:00
|
|
|
sshParams.options &= ~SshConnectionOptions(SshEnableStrictConformanceChecks); // For older SSH servers.
|
2011-09-15 09:10:10 +02:00
|
|
|
sshParams.host = d->setupPage.hostName();
|
|
|
|
|
sshParams.userName = d->setupPage.userName();
|
2011-06-21 16:52:48 +02:00
|
|
|
sshParams.port = 22;
|
|
|
|
|
sshParams.timeout = 10;
|
2011-09-15 09:10:10 +02:00
|
|
|
sshParams.authenticationType = d->setupPage.authenticationType();
|
2013-06-18 18:12:34 +02:00
|
|
|
if (sshParams.authenticationType != SshConnectionParameters::AuthenticationTypePublicKey)
|
2011-09-15 09:10:10 +02:00
|
|
|
sshParams.password = d->setupPage.password();
|
2011-06-21 16:52:48 +02:00
|
|
|
else
|
2011-09-15 09:10:10 +02:00
|
|
|
sshParams.privateKeyFile = d->setupPage.privateKeyFilePath();
|
2012-07-27 13:31:13 +02:00
|
|
|
IDevice::Ptr device = LinuxDevice::create(d->setupPage.configurationName(),
|
2012-07-25 17:41:01 +02:00
|
|
|
Core::Id(Constants::GenericLinuxOsType), IDevice::Hardware);
|
2012-07-27 13:31:13 +02:00
|
|
|
device->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100")));
|
|
|
|
|
device->setSshParameters(sshParams);
|
|
|
|
|
return device;
|
2011-06-16 17:03:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace RemoteLinux
|