diff options
author | hjk <[email protected]> | 2016-05-19 08:56:05 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2016-05-23 07:42:34 +0000 |
commit | e05fbf153d98a34ddda63b12402c15642994acdc (patch) | |
tree | 3cbfca3fade3c70265bc228cc258288ea99aad16 /src/plugins/qnx/qnxdevicewizard.cpp | |
parent | a5720ca8af7e2a0f38ffe657767d1b751f7725dc (diff) |
Qnx: Rename qnxdeviceconfiguration* to qnxdevice*
All other targets call their devices "Device",
not "DeviceConfiguration".
Also, add a few namespaces and inline the trivial
QnxDeviceConfigurationWizardSetupPage files.
Change-Id: I26168d1b676f6a646b11b61d4cdb7d0f30e18242
Reviewed-by: Anton Kreuzkamp <[email protected]>
Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/qnx/qnxdevicewizard.cpp')
-rw-r--r-- | src/plugins/qnx/qnxdevicewizard.cpp | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/src/plugins/qnx/qnxdevicewizard.cpp b/src/plugins/qnx/qnxdevicewizard.cpp new file mode 100644 index 00000000000..cbfc8720493 --- /dev/null +++ b/src/plugins/qnx/qnxdevicewizard.cpp @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2016 BlackBerry Limited. All rights reserved. +** Contact: KDAB ([email protected]) +** +** This file is part of Qt Creator. +** +** 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 +** 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. +** +** 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. +** +****************************************************************************/ + +#include "qnxdevicewizard.h" + +#include "qnxconstants.h" +#include "qnxdevice.h" + +#include <projectexplorer/devicesupport/deviceusedportsgatherer.h> +#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h> +#include <utils/portlist.h> + +using namespace ProjectExplorer; + +namespace Qnx { +namespace Internal { + +class QnxDeviceWizardSetupPage : public RemoteLinux::GenericLinuxDeviceConfigurationWizardSetupPage +{ +public: + QnxDeviceWizardSetupPage(QWidget *parent) : + RemoteLinux::GenericLinuxDeviceConfigurationWizardSetupPage(parent) + {} + + QString defaultConfigurationName() const { return QnxDeviceWizard::tr("QNX Device"); } +}; + +QnxDeviceWizard::QnxDeviceWizard(QWidget *parent) : + Utils::Wizard(parent) +{ + setWindowTitle(tr("New QNX Device Configuration Setup")); + + m_setupPage = new QnxDeviceWizardSetupPage(this); + m_finalPage = new RemoteLinux::GenericLinuxDeviceConfigurationWizardFinalPage(this); + + setPage(SetupPageId, m_setupPage); + setPage(FinalPageId, m_finalPage); + m_finalPage->setCommitPage(true); +} + +IDevice::Ptr QnxDeviceWizard::device() +{ + QSsh::SshConnectionParameters sshParams; + sshParams.options = QSsh::SshIgnoreDefaultProxy; + sshParams.host = m_setupPage->hostName(); + sshParams.userName = m_setupPage->userName(); + sshParams.port = 22; + sshParams.timeout = 10; + sshParams.authenticationType = m_setupPage->authenticationType(); + if (sshParams.authenticationType == QSsh::SshConnectionParameters::AuthenticationTypeTryAllPasswordBasedMethods + || sshParams.authenticationType == QSsh::SshConnectionParameters::AuthenticationTypePassword) + sshParams.password = m_setupPage->password(); + else + sshParams.privateKeyFile = m_setupPage->privateKeyFilePath(); + + QnxDevice::Ptr device = QnxDevice::create(m_setupPage->configurationName(), + Core::Id(Constants::QNX_QNX_OS_TYPE), IDevice::Hardware); + device->setSshParameters(sshParams); + device->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100"))); + + return device; +} + +} // namespace Internal +} // namespace Qnx |