ProjectExplorer: Allow Devices to be added without using the wizard

This re-organizes the buttons on the main device page a bit: The
topmost one still starts the wizard selection, below that are direct
individual buttons to add specific devices.

Change-Id: I52b2803febf658259dde9589544656fd4c8fc889
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2023-03-23 15:32:42 +01:00
parent 17a482bebe
commit 5996e58ffa
10 changed files with 80 additions and 25 deletions

View File

@@ -27,6 +27,7 @@
#include <utils/environment.h>
#include <utils/hostosinfo.h>
#include <utils/port.h>
#include <utils/portlist.h>
#include <utils/processinfo.h>
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
@@ -887,9 +888,16 @@ LinuxDevice::LinuxDevice()
{
setFileAccess(&d->m_fileAccess);
setDisplayType(Tr::tr("Remote Linux"));
setDefaultDisplayName(Tr::tr("Remote Linux Device"));
setOsType(OsTypeLinux);
setupId(IDevice::ManuallyAdded, Utils::Id());
setType(Constants::GenericLinuxOsType);
setMachineType(IDevice::Hardware);
setFreePorts(PortList::fromString(QLatin1String("10000-10100")));
SshParameters sshParams;
sshParams.timeout = 10;
setSshParameters(sshParams);
addDeviceAction({Tr::tr("Deploy Public Key..."), [](const IDevice::Ptr &device, QWidget *parent) {
if (auto d = PublicKeyDeploymentDialog::createDialog(device, parent)) {
d->exec();
@@ -1489,6 +1497,7 @@ LinuxDeviceFactory::LinuxDeviceFactory()
setDisplayName(Tr::tr("Remote Linux Device"));
setIcon(QIcon());
setConstructionFunction(&LinuxDevice::create);
setQuickCreationAllowed(true);
setCreator([] {
GenericLinuxDeviceConfigurationWizard wizard(Core::ICore::dialogParent());
if (wizard.exec() != QDialog::Accepted)