forked from qt-creator/qt-creator
RemoteLinux: Make generic wizard similar to QnxDeviceWizard
Change-Id: Ia8feb1b5d18d7a1cebd14f37775a6097b1dc380c Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -8,6 +8,8 @@
|
|||||||
#include "remotelinux_constants.h"
|
#include "remotelinux_constants.h"
|
||||||
#include "remotelinuxtr.h"
|
#include "remotelinuxtr.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/idevice.h>
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
#include <projectexplorer/devicesupport/sshparameters.h>
|
#include <projectexplorer/devicesupport/sshparameters.h>
|
||||||
|
|
||||||
@@ -17,33 +19,30 @@ using namespace ProjectExplorer;
|
|||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
enum PageId { SetupPageId, KeyDeploymentPageId, FinalPageId };
|
|
||||||
|
|
||||||
class GenericLinuxDeviceConfigurationWizardPrivate
|
class GenericLinuxDeviceConfigurationWizardPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GenericLinuxDeviceConfigurationWizardPrivate(QWidget *parent)
|
|
||||||
: setupPage(parent), keyDeploymentPage(parent), finalPage(parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
GenericLinuxDeviceConfigurationWizardSetupPage setupPage;
|
GenericLinuxDeviceConfigurationWizardSetupPage setupPage;
|
||||||
GenericLinuxDeviceConfigurationWizardKeyDeploymentPage keyDeploymentPage;
|
GenericLinuxDeviceConfigurationWizardKeyDeploymentPage keyDeploymentPage;
|
||||||
GenericLinuxDeviceConfigurationWizardFinalPage finalPage;
|
GenericLinuxDeviceConfigurationWizardFinalPage finalPage;
|
||||||
LinuxDevice::Ptr device;
|
LinuxDevice::Ptr device;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
GenericLinuxDeviceConfigurationWizard::GenericLinuxDeviceConfigurationWizard(QWidget *parent)
|
GenericLinuxDeviceConfigurationWizard::GenericLinuxDeviceConfigurationWizard()
|
||||||
: Utils::Wizard(parent),
|
: Utils::Wizard(Core::ICore::dialogParent())
|
||||||
d(new Internal::GenericLinuxDeviceConfigurationWizardPrivate(this))
|
, d(new Internal::GenericLinuxDeviceConfigurationWizardPrivate)
|
||||||
{
|
{
|
||||||
setWindowTitle(Tr::tr("New Remote Linux Device Configuration Setup"));
|
setWindowTitle(Tr::tr("New Remote Linux Device Configuration Setup"));
|
||||||
setPage(Internal::SetupPageId, &d->setupPage);
|
addPage(&d->setupPage);
|
||||||
setPage(Internal::KeyDeploymentPageId, &d->keyDeploymentPage);
|
addPage(&d->keyDeploymentPage);
|
||||||
setPage(Internal::FinalPageId, &d->finalPage);
|
addPage(&d->finalPage);
|
||||||
d->finalPage.setCommitPage(true);
|
d->finalPage.setCommitPage(true);
|
||||||
|
|
||||||
d->device = LinuxDevice::create();
|
d->device = LinuxDevice::create();
|
||||||
|
|
||||||
d->setupPage.setDevice(d->device);
|
d->setupPage.setDevice(d->device);
|
||||||
d->keyDeploymentPage.setDevice(d->device);
|
d->keyDeploymentPage.setDevice(d->device);
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@ class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizard : public Utils::W
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GenericLinuxDeviceConfigurationWizard(QWidget *parent = nullptr);
|
GenericLinuxDeviceConfigurationWizard();
|
||||||
~GenericLinuxDeviceConfigurationWizard() override;
|
~GenericLinuxDeviceConfigurationWizard() override;
|
||||||
|
|
||||||
ProjectExplorer::IDevicePtr device();
|
ProjectExplorer::IDevicePtr device();
|
||||||
|
@@ -1485,7 +1485,7 @@ LinuxDeviceFactory::LinuxDeviceFactory()
|
|||||||
setConstructionFunction(&LinuxDevice::create);
|
setConstructionFunction(&LinuxDevice::create);
|
||||||
setQuickCreationAllowed(true);
|
setQuickCreationAllowed(true);
|
||||||
setCreator([] {
|
setCreator([] {
|
||||||
GenericLinuxDeviceConfigurationWizard wizard(Core::ICore::dialogParent());
|
GenericLinuxDeviceConfigurationWizard wizard;
|
||||||
if (wizard.exec() != QDialog::Accepted)
|
if (wizard.exec() != QDialog::Accepted)
|
||||||
return IDevice::Ptr();
|
return IDevice::Ptr();
|
||||||
return wizard.device();
|
return wizard.device();
|
||||||
|
Reference in New Issue
Block a user