forked from qt-creator/qt-creator
Qnx: Simplify QnxDeviceWizard interface
Also provide a parent. Change-Id: I8ca95d09af8126b9e822f891ef815bfcaa84a9d2 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -41,7 +41,6 @@ public:
|
|||||||
: RemoteLinuxSignalOperation(device)
|
: RemoteLinuxSignalOperation(device)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
QString killProcessByNameCommandLine(const QString &filePath) const override
|
QString killProcessByNameCommandLine(const QString &filePath) const override
|
||||||
{
|
{
|
||||||
return QString::fromLatin1("%1; %2").arg(signalProcessByNameQnxCommandLine(filePath, 15),
|
return QString::fromLatin1("%1; %2").arg(signalProcessByNameQnxCommandLine(filePath, 15),
|
||||||
@@ -138,12 +137,7 @@ QnxDeviceFactory::QnxDeviceFactory() : IDeviceFactory(Constants::QNX_QNX_OS_TYPE
|
|||||||
setCombinedIcon(":/qnx/images/qnxdevicesmall.png",
|
setCombinedIcon(":/qnx/images/qnxdevicesmall.png",
|
||||||
":/qnx/images/qnxdevice.png");
|
":/qnx/images/qnxdevice.png");
|
||||||
setConstructionFunction(&QnxDevice::create);
|
setConstructionFunction(&QnxDevice::create);
|
||||||
setCreator([] {
|
setCreator(&runDeviceWizard);
|
||||||
QnxDeviceWizard wizard;
|
|
||||||
if (wizard.exec() != QDialog::Accepted)
|
|
||||||
return IDevice::Ptr();
|
|
||||||
return wizard.device();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
@@ -22,16 +22,15 @@ public:
|
|||||||
|
|
||||||
int qnxVersion() const;
|
int qnxVersion() const;
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
|
QnxDevice();
|
||||||
|
|
||||||
void fromMap(const QVariantMap &map) final;
|
void fromMap(const QVariantMap &map) final;
|
||||||
QVariantMap toMap() const final;
|
QVariantMap toMap() const final;
|
||||||
|
|
||||||
QString interruptProcessByNameCommandLine(const QString &filePath) const;
|
QString interruptProcessByNameCommandLine(const QString &filePath) const;
|
||||||
QString killProcessByNameCommandLine(const QString &filePath) const;
|
QString killProcessByNameCommandLine(const QString &filePath) const;
|
||||||
|
|
||||||
private:
|
|
||||||
QnxDevice();
|
|
||||||
|
|
||||||
void updateVersionNumber() const;
|
void updateVersionNumber() const;
|
||||||
|
|
||||||
mutable int m_versionNumber = 0;
|
mutable int m_versionNumber = 0;
|
||||||
|
@@ -4,30 +4,36 @@
|
|||||||
#include "qnxdevicewizard.h"
|
#include "qnxdevicewizard.h"
|
||||||
|
|
||||||
#include "qnxconstants.h"
|
#include "qnxconstants.h"
|
||||||
|
#include "qnxdevice.h"
|
||||||
#include "qnxtr.h"
|
#include "qnxtr.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/sshparameters.h>
|
#include <projectexplorer/devicesupport/sshparameters.h>
|
||||||
|
|
||||||
#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
|
#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
|
||||||
|
|
||||||
#include <utils/portlist.h>
|
#include <utils/portlist.h>
|
||||||
|
#include <utils/wizard.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
using namespace RemoteLinux;
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Qnx::Internal {
|
namespace Qnx::Internal {
|
||||||
|
|
||||||
QnxDeviceWizard::QnxDeviceWizard(QWidget *parent) :
|
class QnxDeviceWizard : public Wizard
|
||||||
Utils::Wizard(parent)
|
{
|
||||||
|
public:
|
||||||
|
QnxDeviceWizard() : Wizard(Core::ICore::dialogParent())
|
||||||
{
|
{
|
||||||
setWindowTitle(Tr::tr("New QNX Device Configuration Setup"));
|
setWindowTitle(Tr::tr("New QNX Device Configuration Setup"));
|
||||||
|
|
||||||
m_setupPage = new RemoteLinux::GenericLinuxDeviceConfigurationWizardSetupPage(this);
|
addPage(&m_setupPage);
|
||||||
m_keyDeploymentPage
|
addPage(&m_keyDeploymentPage);
|
||||||
= new RemoteLinux::GenericLinuxDeviceConfigurationWizardKeyDeploymentPage(this);
|
addPage(&m_finalPage);
|
||||||
m_finalPage = new RemoteLinux::GenericLinuxDeviceConfigurationWizardFinalPage(this);
|
m_finalPage.setCommitPage(true);
|
||||||
|
|
||||||
setPage(SetupPageId, m_setupPage);
|
|
||||||
setPage(KeyDeploymenPageId, m_keyDeploymentPage);
|
|
||||||
setPage(FinalPageId, m_finalPage);
|
|
||||||
m_finalPage->setCommitPage(true);
|
|
||||||
SshParameters sshParams;
|
SshParameters sshParams;
|
||||||
sshParams.timeout = 10;
|
sshParams.timeout = 10;
|
||||||
m_device = QnxDevice::create();
|
m_device = QnxDevice::create();
|
||||||
@@ -35,14 +41,29 @@ QnxDeviceWizard::QnxDeviceWizard(QWidget *parent) :
|
|||||||
m_device->setType(Constants::QNX_QNX_OS_TYPE);
|
m_device->setType(Constants::QNX_QNX_OS_TYPE);
|
||||||
m_device->setMachineType(IDevice::Hardware);
|
m_device->setMachineType(IDevice::Hardware);
|
||||||
m_device->setSshParameters(sshParams);
|
m_device->setSshParameters(sshParams);
|
||||||
m_device->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100")));
|
m_device->setFreePorts(PortList::fromString("10000-10100"));
|
||||||
m_setupPage->setDevice(m_device);
|
|
||||||
m_keyDeploymentPage->setDevice(m_device);
|
m_setupPage.setDevice(m_device);
|
||||||
|
m_keyDeploymentPage.setDevice(m_device);
|
||||||
}
|
}
|
||||||
|
|
||||||
IDevice::Ptr QnxDeviceWizard::device()
|
IDevice::Ptr device() const { return m_device; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
GenericLinuxDeviceConfigurationWizardSetupPage m_setupPage;
|
||||||
|
GenericLinuxDeviceConfigurationWizardKeyDeploymentPage m_keyDeploymentPage;
|
||||||
|
GenericLinuxDeviceConfigurationWizardFinalPage m_finalPage;
|
||||||
|
|
||||||
|
LinuxDevice::Ptr m_device;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
IDevice::Ptr runDeviceWizard()
|
||||||
{
|
{
|
||||||
return m_device;
|
QnxDeviceWizard wizard;
|
||||||
|
if (wizard.exec() != QDialog::Accepted)
|
||||||
|
return IDevice::Ptr();
|
||||||
|
return wizard.device();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
@@ -3,36 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "qnxdevice.h"
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
|
|
||||||
#include <utils/wizard.h>
|
|
||||||
|
|
||||||
namespace RemoteLinux {
|
|
||||||
class GenericLinuxDeviceConfigurationWizardSetupPage;
|
|
||||||
class GenericLinuxDeviceConfigurationWizardKeyDeploymentPage;
|
|
||||||
class GenericLinuxDeviceConfigurationWizardFinalPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Qnx::Internal {
|
namespace Qnx::Internal {
|
||||||
|
|
||||||
class QnxDeviceWizard : public Utils::Wizard
|
ProjectExplorer::IDevice::Ptr runDeviceWizard();
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit QnxDeviceWizard(QWidget *parent = nullptr);
|
|
||||||
|
|
||||||
ProjectExplorer::IDevice::Ptr device();
|
|
||||||
|
|
||||||
private:
|
|
||||||
enum PageId {
|
|
||||||
SetupPageId,
|
|
||||||
KeyDeploymenPageId,
|
|
||||||
FinalPageId
|
|
||||||
};
|
|
||||||
|
|
||||||
RemoteLinux::GenericLinuxDeviceConfigurationWizardSetupPage *m_setupPage;
|
|
||||||
RemoteLinux::GenericLinuxDeviceConfigurationWizardKeyDeploymentPage *m_keyDeploymentPage;
|
|
||||||
RemoteLinux::GenericLinuxDeviceConfigurationWizardFinalPage *m_finalPage;
|
|
||||||
QnxDevice::Ptr m_device;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
@@ -64,7 +64,7 @@ class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizardFinalPage final :
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
GenericLinuxDeviceConfigurationWizardFinalPage(QWidget *parent);
|
GenericLinuxDeviceConfigurationWizardFinalPage(QWidget *parent = nullptr);
|
||||||
~GenericLinuxDeviceConfigurationWizardFinalPage() override;
|
~GenericLinuxDeviceConfigurationWizardFinalPage() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Reference in New Issue
Block a user