RemoteLinux: Improve device wizard

We add a new wizard page for deploying a public key. This way,
the user has to enter the password only once during initial device
setup, just as it used to be before we switched the SSH backend.

Change-Id: Ic30e830a839033e7e7664c2713d3b74b5472e969
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2018-12-21 14:01:17 +01:00
parent 9332828d0c
commit abb4aea171
7 changed files with 209 additions and 185 deletions

View File

@@ -26,7 +26,6 @@
#include "qnxdevicewizard.h"
#include "qnxconstants.h"
#include "qnxdevice.h"
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
@@ -37,44 +36,33 @@ using namespace ProjectExplorer;
namespace Qnx {
namespace Internal {
class QnxDeviceWizardSetupPage : public RemoteLinux::GenericLinuxDeviceConfigurationWizardSetupPage
{
public:
QnxDeviceWizardSetupPage(QWidget *parent) :
RemoteLinux::GenericLinuxDeviceConfigurationWizardSetupPage(parent)
{}
QString defaultConfigurationName() const override { 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_setupPage = new RemoteLinux::GenericLinuxDeviceConfigurationWizardSetupPage(this);
m_keyDeploymentPage
= new RemoteLinux::GenericLinuxDeviceConfigurationWizardKeyDeploymentPage(this);
m_finalPage = new RemoteLinux::GenericLinuxDeviceConfigurationWizardFinalPage(this);
setPage(SetupPageId, m_setupPage);
setPage(KeyDeploymenPageId, m_keyDeploymentPage);
setPage(FinalPageId, m_finalPage);
m_finalPage->setCommitPage(true);
QSsh::SshConnectionParameters sshParams;
sshParams.timeout = 10;
m_device = QnxDevice::create(tr("QNX Device"), Core::Id(Constants::QNX_QNX_OS_TYPE),
IDevice::Hardware);
m_device->setSshParameters(sshParams);
m_device->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100")));
m_setupPage->setDevice(m_device);
m_keyDeploymentPage->setDevice(m_device);
}
IDevice::Ptr QnxDeviceWizard::device()
{
QSsh::SshConnectionParameters sshParams;
sshParams.url = m_setupPage->url();
sshParams.timeout = 10;
sshParams.authenticationType = m_setupPage->authenticationType();
if (sshParams.authenticationType == QSsh::SshConnectionParameters::AuthenticationTypeSpecificKey)
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;
return m_device;
}
} // namespace Internal