forked from qt-creator/qt-creator
Device support: Make device testing a "well-known" concept.
This entails the following:
- Rename AbstractLinuxDeviceTester to DeviceTester and
move it up into ProjectExplorer. The class stays
unchanged, as there was nothing Linux-specific about it.
The same goes for the associated dialog.
- Move the createDeviceTester() function from LinuxDevice
to IDevice and introduce IDevice::hasDeviceTester() to
enable generic code to make use of this feature.
- Move device testing out of the list of opaque
device-specific actions; instead, the device settings widget
now uses the device tester directly, if applicable.
Rationale:
- Device testing, just like remote process listing (if not more so),
is a general concept that implementors of device classes will
probably want to implement (and they should be encouraged to do so).
Without the mechanism provided here, they would all need to put
basically the same code into the actionIds(), displayNameForActionId()
and executeAction() functions.
This patch is the natural extension of b90e3bbd8b.
Change-Id: I94f2badb4ceeda9f5cd3b066c13626bb4f65505d
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
This commit is contained in:
@@ -31,7 +31,6 @@
|
|||||||
#include "maddedevicetester.h"
|
#include "maddedevicetester.h"
|
||||||
#include "maemoconstants.h"
|
#include "maemoconstants.h"
|
||||||
|
|
||||||
#include <remotelinux/linuxdevicetestdialog.h>
|
|
||||||
#include <remotelinux/publickeydeploymentdialog.h>
|
#include <remotelinux/publickeydeploymentdialog.h>
|
||||||
#include <remotelinux/remotelinux_constants.h>
|
#include <remotelinux/remotelinux_constants.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -111,7 +110,7 @@ QSize MaddeDevice::packageManagerIconSize(Core::Id type)
|
|||||||
return QSize();
|
return QSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractLinuxDeviceTester *MaddeDevice::createDeviceTester() const
|
DeviceTester *MaddeDevice::createDeviceTester() const
|
||||||
{
|
{
|
||||||
return new MaddeDeviceTester;
|
return new MaddeDeviceTester;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
|
|
||||||
static QSize packageManagerIconSize(Core::Id type);
|
static QSize packageManagerIconSize(Core::Id type);
|
||||||
|
|
||||||
RemoteLinux::AbstractLinuxDeviceTester *createDeviceTester() const;
|
ProjectExplorer::DeviceTester *createDeviceTester() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MaddeDevice();
|
MaddeDevice();
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const char QmlToolingDirectory[] = "/usr/lib/qt4/plugins/qmltooling";
|
|||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
MaddeDeviceTester::MaddeDeviceTester(QObject *parent)
|
MaddeDeviceTester::MaddeDeviceTester(QObject *parent)
|
||||||
: AbstractLinuxDeviceTester(parent),
|
: ProjectExplorer::DeviceTester(parent),
|
||||||
m_genericTester(new GenericLinuxDeviceTester(this)),
|
m_genericTester(new GenericLinuxDeviceTester(this)),
|
||||||
m_state(Inactive),
|
m_state(Inactive),
|
||||||
m_processRunner(0)
|
m_processRunner(0)
|
||||||
@@ -68,8 +68,8 @@ void MaddeDeviceTester::testDevice(const ProjectExplorer::IDevice::ConstPtr &dev
|
|||||||
m_state = GenericTest;
|
m_state = GenericTest;
|
||||||
connect(m_genericTester, SIGNAL(progressMessage(QString)), SIGNAL(progressMessage(QString)));
|
connect(m_genericTester, SIGNAL(progressMessage(QString)), SIGNAL(progressMessage(QString)));
|
||||||
connect(m_genericTester, SIGNAL(errorMessage(QString)), SIGNAL(errorMessage(QString)));
|
connect(m_genericTester, SIGNAL(errorMessage(QString)), SIGNAL(errorMessage(QString)));
|
||||||
connect(m_genericTester, SIGNAL(finished(RemoteLinux::AbstractLinuxDeviceTester::TestResult)),
|
connect(m_genericTester, SIGNAL(finished(ProjectExplorer::DeviceTester::TestResult)),
|
||||||
SLOT(handleGenericTestFinished(RemoteLinux::AbstractLinuxDeviceTester::TestResult)));
|
SLOT(handleGenericTestFinished(ProjectExplorer::DeviceTester::TestResult)));
|
||||||
m_genericTester->testDevice(deviceConfiguration);
|
m_genericTester->testDevice(deviceConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class SshRemoteProcessRunner;
|
|||||||
namespace Madde {
|
namespace Madde {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class MaddeDeviceTester : public RemoteLinux::AbstractLinuxDeviceTester
|
class MaddeDeviceTester : public ProjectExplorer::DeviceTester
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
void stopTest();
|
void stopTest();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleGenericTestFinished(RemoteLinux::AbstractLinuxDeviceTester::TestResult result);
|
void handleGenericTestFinished(ProjectExplorer::DeviceTester::TestResult result);
|
||||||
void handleConnectionError();
|
void handleConnectionError();
|
||||||
void handleProcessFinished(int exitStatus);
|
void handleProcessFinished(int exitStatus);
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ private:
|
|||||||
|
|
||||||
RemoteLinux::GenericLinuxDeviceTester * const m_genericTester;
|
RemoteLinux::GenericLinuxDeviceTester * const m_genericTester;
|
||||||
State m_state;
|
State m_state;
|
||||||
TestResult m_result;
|
ProjectExplorer::DeviceTester::TestResult m_result;
|
||||||
QSsh::SshRemoteProcessRunner *m_processRunner;
|
QSsh::SshRemoteProcessRunner *m_processRunner;
|
||||||
ProjectExplorer::IDevice::ConstPtr m_deviceConfiguration;
|
ProjectExplorer::IDevice::ConstPtr m_deviceConfiguration;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
#include "maemoglobal.h"
|
#include "maemoglobal.h"
|
||||||
|
|
||||||
#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
|
#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
|
||||||
#include <remotelinux/linuxdevicetestdialog.h>
|
|
||||||
#include <remotelinux/sshkeydeployer.h>
|
#include <remotelinux/sshkeydeployer.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <ssh/sshkeygenerator.h>
|
#include <ssh/sshkeygenerator.h>
|
||||||
@@ -553,7 +552,6 @@ MaemoDeviceConfigWizard::~MaemoDeviceConfigWizard()
|
|||||||
|
|
||||||
IDevice::Ptr MaemoDeviceConfigWizard::device()
|
IDevice::Ptr MaemoDeviceConfigWizard::device()
|
||||||
{
|
{
|
||||||
bool doTest;
|
|
||||||
QString freePortsSpec;
|
QString freePortsSpec;
|
||||||
QSsh::SshConnectionParameters sshParams;
|
QSsh::SshConnectionParameters sshParams;
|
||||||
sshParams.userName = defaultUser();
|
sshParams.userName = defaultUser();
|
||||||
@@ -564,24 +562,16 @@ IDevice::Ptr MaemoDeviceConfigWizard::device()
|
|||||||
sshParams.password.clear();
|
sshParams.password.clear();
|
||||||
sshParams.timeout = 30;
|
sshParams.timeout = 30;
|
||||||
freePortsSpec = QLatin1String("13219,14168");
|
freePortsSpec = QLatin1String("13219,14168");
|
||||||
doTest = false;
|
|
||||||
} else {
|
} else {
|
||||||
sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationTypePublicKey;
|
sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationTypePublicKey;
|
||||||
sshParams.privateKeyFile = d->wizardData.privateKeyFilePath;
|
sshParams.privateKeyFile = d->wizardData.privateKeyFilePath;
|
||||||
sshParams.timeout = 10;
|
sshParams.timeout = 10;
|
||||||
freePortsSpec = QLatin1String("10000-10100");
|
freePortsSpec = QLatin1String("10000-10100");
|
||||||
doTest = true;
|
|
||||||
}
|
}
|
||||||
const MaddeDevice::Ptr device = MaddeDevice::create(d->wizardData.configName,
|
const MaddeDevice::Ptr device = MaddeDevice::create(d->wizardData.configName,
|
||||||
d->wizardData.deviceType, d->wizardData.machineType);
|
d->wizardData.deviceType, d->wizardData.machineType);
|
||||||
device->setFreePorts(PortList::fromString(freePortsSpec));
|
device->setFreePorts(PortList::fromString(freePortsSpec));
|
||||||
device->setSshParameters(sshParams);
|
device->setSshParameters(sshParams);
|
||||||
if (doTest) {
|
|
||||||
// Might be called after accept.
|
|
||||||
QWidget *parent = isVisible() ? this : static_cast<QWidget *>(0);
|
|
||||||
LinuxDeviceTestDialog dlg(device, new MaddeDeviceTester(this), parent);
|
|
||||||
dlg.exec();
|
|
||||||
}
|
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#include "devicemanager.h"
|
#include "devicemanager.h"
|
||||||
#include "devicemanagermodel.h"
|
#include "devicemanagermodel.h"
|
||||||
#include "deviceprocessesdialog.h"
|
#include "deviceprocessesdialog.h"
|
||||||
|
#include "devicetestdialog.h"
|
||||||
#include "idevice.h"
|
#include "idevice.h"
|
||||||
#include "idevicefactory.h"
|
#include "idevicefactory.h"
|
||||||
#include "idevicewidget.h"
|
#include "idevicewidget.h"
|
||||||
@@ -167,6 +168,8 @@ void DeviceSettingsWidget::addDevice()
|
|||||||
m_deviceManager->addDevice(device);
|
m_deviceManager->addDevice(device);
|
||||||
m_ui->removeConfigButton->setEnabled(true);
|
m_ui->removeConfigButton->setEnabled(true);
|
||||||
m_ui->configurationComboBox->setCurrentIndex(m_deviceManagerModel->indexOf(device));
|
m_ui->configurationComboBox->setCurrentIndex(m_deviceManagerModel->indexOf(device));
|
||||||
|
if (device->hasDeviceTester())
|
||||||
|
testDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceSettingsWidget::removeDevice()
|
void DeviceSettingsWidget::removeDevice()
|
||||||
@@ -262,6 +265,14 @@ void DeviceSettingsWidget::setDefaultDevice()
|
|||||||
m_ui->defaultDeviceButton->setEnabled(false);
|
m_ui->defaultDeviceButton->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeviceSettingsWidget::testDevice()
|
||||||
|
{
|
||||||
|
const IDevice::ConstPtr &device = currentDevice();
|
||||||
|
QTC_ASSERT(device && device->hasDeviceTester(), return);
|
||||||
|
DeviceTestDialog dlg(device, this);
|
||||||
|
dlg.exec();
|
||||||
|
}
|
||||||
|
|
||||||
void DeviceSettingsWidget::handleDeviceUpdated(Id id)
|
void DeviceSettingsWidget::handleDeviceUpdated(Id id)
|
||||||
{
|
{
|
||||||
const int index = m_deviceManagerModel->indexForId(id);
|
const int index = m_deviceManagerModel->indexForId(id);
|
||||||
@@ -286,6 +297,13 @@ void DeviceSettingsWidget::currentDeviceChanged(int index)
|
|||||||
setDeviceInfoWidgetsEnabled(true);
|
setDeviceInfoWidgetsEnabled(true);
|
||||||
m_ui->removeConfigButton->setEnabled(true);
|
m_ui->removeConfigButton->setEnabled(true);
|
||||||
|
|
||||||
|
if (device->hasDeviceTester()) {
|
||||||
|
QPushButton * const button = new QPushButton(tr("Test"));
|
||||||
|
m_additionalActionButtons << button;
|
||||||
|
connect(button, SIGNAL(clicked()), SLOT(testDevice()));
|
||||||
|
m_ui->buttonsLayout->insertWidget(m_ui->buttonsLayout->count() - 1, button);
|
||||||
|
}
|
||||||
|
|
||||||
if (device->canCreateProcessModel()) {
|
if (device->canCreateProcessModel()) {
|
||||||
QPushButton * const button = new QPushButton(tr("Show Running Processes"));
|
QPushButton * const button = new QPushButton(tr("Show Running Processes"));
|
||||||
m_additionalActionButtons << button;
|
m_additionalActionButtons << button;
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ private slots:
|
|||||||
void removeDevice();
|
void removeDevice();
|
||||||
void deviceNameEditingFinished();
|
void deviceNameEditingFinished();
|
||||||
void setDefaultDevice();
|
void setDefaultDevice();
|
||||||
|
void testDevice();
|
||||||
void handleAdditionalActionRequest(int actionId);
|
void handleAdditionalActionRequest(int actionId);
|
||||||
void handleProcessListRequested();
|
void handleProcessListRequested();
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "linuxdevicetestdialog.h"
|
#include "devicetestdialog.h"
|
||||||
#include "ui_linuxdevicetestdialog.h"
|
#include "ui_devicetestdialog.h"
|
||||||
|
|
||||||
#include <QBrush>
|
#include <QBrush>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
@@ -35,72 +35,70 @@
|
|||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QTextCharFormat>
|
#include <QTextCharFormat>
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace ProjectExplorer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class LinuxDeviceTestDialogPrivate {
|
|
||||||
|
class DeviceTestDialog::DeviceTestDialogPrivate
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
LinuxDeviceTestDialogPrivate(AbstractLinuxDeviceTester *tester)
|
DeviceTestDialogPrivate(DeviceTester *tester)
|
||||||
: deviceTester(tester), finished(false)
|
: deviceTester(tester), finished(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Ui::LinuxDeviceTestDialog ui;
|
Ui::DeviceTestDialog ui;
|
||||||
AbstractLinuxDeviceTester * const deviceTester;
|
DeviceTester * const deviceTester;
|
||||||
bool finished;
|
bool finished;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
DeviceTestDialog::DeviceTestDialog(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration,
|
||||||
|
QWidget *parent)
|
||||||
using namespace Internal;
|
: QDialog(parent), d(new DeviceTestDialogPrivate(deviceConfiguration->createDeviceTester()))
|
||||||
|
|
||||||
LinuxDeviceTestDialog::LinuxDeviceTestDialog(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration,
|
|
||||||
AbstractLinuxDeviceTester *deviceTester, QWidget *parent)
|
|
||||||
: QDialog(parent), d(new LinuxDeviceTestDialogPrivate(deviceTester))
|
|
||||||
{
|
{
|
||||||
d->ui.setupUi(this);
|
d->ui.setupUi(this);
|
||||||
|
|
||||||
d->deviceTester->setParent(this);
|
d->deviceTester->setParent(this);
|
||||||
connect(d->deviceTester, SIGNAL(progressMessage(QString)), SLOT(handleProgressMessage(QString)));
|
connect(d->deviceTester, SIGNAL(progressMessage(QString)), SLOT(handleProgressMessage(QString)));
|
||||||
connect(d->deviceTester, SIGNAL(errorMessage(QString)), SLOT(handleErrorMessage(QString)));
|
connect(d->deviceTester, SIGNAL(errorMessage(QString)), SLOT(handleErrorMessage(QString)));
|
||||||
connect(d->deviceTester, SIGNAL(finished(RemoteLinux::AbstractLinuxDeviceTester::TestResult)),
|
connect(d->deviceTester, SIGNAL(finished(ProjectExplorer::DeviceTester::TestResult)),
|
||||||
SLOT(handleTestFinished(RemoteLinux::AbstractLinuxDeviceTester::TestResult)));
|
SLOT(handleTestFinished(ProjectExplorer::DeviceTester::TestResult)));
|
||||||
d->deviceTester->testDevice(deviceConfiguration);
|
d->deviceTester->testDevice(deviceConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
LinuxDeviceTestDialog::~LinuxDeviceTestDialog()
|
DeviceTestDialog::~DeviceTestDialog()
|
||||||
{
|
{
|
||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinuxDeviceTestDialog::reject()
|
void DeviceTestDialog::reject()
|
||||||
{
|
{
|
||||||
if (!d->finished)
|
if (!d->finished)
|
||||||
d->deviceTester->stopTest();
|
d->deviceTester->stopTest();
|
||||||
QDialog::reject();
|
QDialog::reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinuxDeviceTestDialog::handleProgressMessage(const QString &message)
|
void DeviceTestDialog::handleProgressMessage(const QString &message)
|
||||||
{
|
{
|
||||||
addText(message, QLatin1String("black"), false);
|
addText(message, QLatin1String("black"), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinuxDeviceTestDialog::handleErrorMessage(const QString &message)
|
void DeviceTestDialog::handleErrorMessage(const QString &message)
|
||||||
{
|
{
|
||||||
addText(message, QLatin1String("red"), false);
|
addText(message, QLatin1String("red"), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinuxDeviceTestDialog::handleTestFinished(AbstractLinuxDeviceTester::TestResult result)
|
void DeviceTestDialog::handleTestFinished(ProjectExplorer::DeviceTester::TestResult result)
|
||||||
{
|
{
|
||||||
d->finished = true;
|
d->finished = true;
|
||||||
d->ui.buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Close"));
|
d->ui.buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Close"));
|
||||||
|
|
||||||
if (result == AbstractLinuxDeviceTester::TestSuccess)
|
if (result == ProjectExplorer::DeviceTester::TestSuccess)
|
||||||
addText(tr("Device test finished successfully."), QLatin1String("blue"), true);
|
addText(tr("Device test finished successfully."), QLatin1String("blue"), true);
|
||||||
else
|
else
|
||||||
addText(tr("Device test failed."), QLatin1String("red"), true);
|
addText(tr("Device test failed."), QLatin1String("red"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinuxDeviceTestDialog::addText(const QString &text, const QString &color, bool bold)
|
void DeviceTestDialog::addText(const QString &text, const QString &color, bool bold)
|
||||||
{
|
{
|
||||||
QTextCharFormat format = d->ui.textEdit->currentCharFormat();
|
QTextCharFormat format = d->ui.textEdit->currentCharFormat();
|
||||||
format.setForeground(QBrush(QColor(color)));
|
format.setForeground(QBrush(QColor(color)));
|
||||||
@@ -111,4 +109,5 @@ void LinuxDeviceTestDialog::addText(const QString &text, const QString &color, b
|
|||||||
d->ui.textEdit->appendPlainText(text);
|
d->ui.textEdit->appendPlainText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace RemoteLinux
|
} // namespace Internal
|
||||||
|
} // namespace ProjectExplorer
|
||||||
@@ -26,42 +26,39 @@
|
|||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#ifndef LINUXDEVICETESTDIALOG_H
|
#ifndef DEVICETESTDIALOG_H
|
||||||
#define LINUXDEVICETESTDIALOG_H
|
#define DEVICETESTDIALOG_H
|
||||||
|
|
||||||
#include "linuxdevicetester.h"
|
#include "idevice.h"
|
||||||
#include "remotelinux_export.h"
|
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace ProjectExplorer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class LinuxDeviceTestDialogPrivate;
|
|
||||||
} // namespace Internal
|
|
||||||
|
|
||||||
class REMOTELINUX_EXPORT LinuxDeviceTestDialog : public QDialog
|
class DeviceTestDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Note: The dialog takes ownership of deviceTester
|
DeviceTestDialog(const IDevice::ConstPtr &deviceConfiguration, QWidget *parent = 0);
|
||||||
LinuxDeviceTestDialog(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration,
|
~DeviceTestDialog();
|
||||||
AbstractLinuxDeviceTester * deviceTester, QWidget *parent = 0);
|
|
||||||
~LinuxDeviceTestDialog();
|
|
||||||
|
|
||||||
void reject();
|
void reject();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleProgressMessage(const QString &message);
|
void handleProgressMessage(const QString &message);
|
||||||
void handleErrorMessage(const QString &message);
|
void handleErrorMessage(const QString &message);
|
||||||
void handleTestFinished(RemoteLinux::AbstractLinuxDeviceTester::TestResult result);
|
void handleTestFinished(ProjectExplorer::DeviceTester::TestResult result);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void addText(const QString &text, const QString &color, bool bold);
|
void addText(const QString &text, const QString &color, bool bold);
|
||||||
|
|
||||||
Internal::LinuxDeviceTestDialogPrivate * const d;
|
class DeviceTestDialogPrivate;
|
||||||
|
DeviceTestDialogPrivate * const d;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace RemoteLinux
|
} // namespace Internal
|
||||||
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
#endif // LINUXDEVICETESTDIALOG_H
|
#endif // Include guard.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>RemoteLinux::Internal::LinuxDeviceTestDialog</class>
|
<class>ProjectExplorer::Internal::DeviceTestDialog</class>
|
||||||
<widget class="QDialog" name="RemoteLinux::Internal::LinuxDeviceTestDialog">
|
<widget class="QDialog" name="ProjectExplorer::Internal::DeviceTestDialog">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>accepted()</signal>
|
<signal>accepted()</signal>
|
||||||
<receiver>RemoteLinux::Internal::LinuxDeviceTestDialog</receiver>
|
<receiver>ProjectExplorer::Internal::DeviceTestDialog</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>rejected()</signal>
|
<signal>rejected()</signal>
|
||||||
<receiver>RemoteLinux::Internal::LinuxDeviceTestDialog</receiver>
|
<receiver>ProjectExplorer::Internal::DeviceTestDialog</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
@@ -194,6 +194,7 @@ public:
|
|||||||
|
|
||||||
PortsGatheringMethod::~PortsGatheringMethod() { }
|
PortsGatheringMethod::~PortsGatheringMethod() { }
|
||||||
DeviceProcessSupport::~DeviceProcessSupport() { }
|
DeviceProcessSupport::~DeviceProcessSupport() { }
|
||||||
|
DeviceTester::DeviceTester(QObject *parent) : QObject(parent) { }
|
||||||
|
|
||||||
IDevice::IDevice() : d(new Internal::IDevicePrivate)
|
IDevice::IDevice() : d(new Internal::IDevicePrivate)
|
||||||
{ }
|
{ }
|
||||||
@@ -268,6 +269,12 @@ DeviceProcessList *IDevice::createProcessListModel(QObject *parent) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DeviceTester *IDevice::createDeviceTester() const
|
||||||
|
{
|
||||||
|
QTC_ASSERT(false, qDebug("This should not have been called..."));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
IDevice::DeviceState IDevice::deviceState() const
|
IDevice::DeviceState IDevice::deviceState() const
|
||||||
{
|
{
|
||||||
return d->deviceState;
|
return d->deviceState;
|
||||||
|
|||||||
@@ -35,11 +35,11 @@
|
|||||||
|
|
||||||
#include <QAbstractSocket>
|
#include <QAbstractSocket>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QObject>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QObject;
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
@@ -52,6 +52,7 @@ class DeviceProcessList;
|
|||||||
namespace Internal { class IDevicePrivate; }
|
namespace Internal { class IDevicePrivate; }
|
||||||
|
|
||||||
class IDeviceWidget;
|
class IDeviceWidget;
|
||||||
|
class DeviceTester;
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT DeviceProcessSupport
|
class PROJECTEXPLORER_EXPORT DeviceProcessSupport
|
||||||
{
|
{
|
||||||
@@ -73,7 +74,6 @@ public:
|
|||||||
virtual QList<int> usedPorts(const QByteArray &commandOutput) const = 0;
|
virtual QList<int> usedPorts(const QByteArray &commandOutput) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// See cpp file for documentation.
|
// See cpp file for documentation.
|
||||||
class PROJECTEXPLORER_EXPORT IDevice
|
class PROJECTEXPLORER_EXPORT IDevice
|
||||||
{
|
{
|
||||||
@@ -118,6 +118,8 @@ public:
|
|||||||
virtual PortsGatheringMethod::Ptr portsGatheringMethod() const;
|
virtual PortsGatheringMethod::Ptr portsGatheringMethod() const;
|
||||||
virtual bool canCreateProcessModel() const { return false; }
|
virtual bool canCreateProcessModel() const { return false; }
|
||||||
virtual DeviceProcessList *createProcessListModel(QObject *parent = 0) const;
|
virtual DeviceProcessList *createProcessListModel(QObject *parent = 0) const;
|
||||||
|
virtual bool hasDeviceTester() const { return false; }
|
||||||
|
virtual DeviceTester *createDeviceTester() const;
|
||||||
|
|
||||||
enum DeviceState { DeviceReadyToUse, DeviceConnected, DeviceDisconnected, DeviceStateUnknown };
|
enum DeviceState { DeviceReadyToUse, DeviceConnected, DeviceDisconnected, DeviceStateUnknown };
|
||||||
DeviceState deviceState() const;
|
DeviceState deviceState() const;
|
||||||
@@ -159,6 +161,26 @@ private:
|
|||||||
friend class DeviceManager;
|
friend class DeviceManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class PROJECTEXPLORER_EXPORT DeviceTester : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
enum TestResult { TestSuccess, TestFailure };
|
||||||
|
|
||||||
|
virtual void testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration) = 0;
|
||||||
|
virtual void stopTest() = 0;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void progressMessage(const QString &message);
|
||||||
|
void errorMessage(const QString &message);
|
||||||
|
void finished(ProjectExplorer::DeviceTester::TestResult result);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
explicit DeviceTester(QObject *parent = 0);
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
#endif // IDEVICE_H
|
#endif // IDEVICE_H
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ HEADERS += projectexplorer.h \
|
|||||||
devicesupport/deviceprocessesdialog.h \
|
devicesupport/deviceprocessesdialog.h \
|
||||||
devicesupport/devicesettingswidget.h \
|
devicesupport/devicesettingswidget.h \
|
||||||
devicesupport/devicesettingspage.h \
|
devicesupport/devicesettingspage.h \
|
||||||
|
devicesupport/devicetestdialog.h \
|
||||||
devicesupport/deviceusedportsgatherer.h \
|
devicesupport/deviceusedportsgatherer.h \
|
||||||
devicesupport/deviceapplicationrunner.h \
|
devicesupport/deviceapplicationrunner.h \
|
||||||
devicesupport/localprocesslist.h \
|
devicesupport/localprocesslist.h \
|
||||||
@@ -237,6 +238,7 @@ SOURCES += projectexplorer.cpp \
|
|||||||
devicesupport/deviceprocessesdialog.cpp \
|
devicesupport/deviceprocessesdialog.cpp \
|
||||||
devicesupport/devicesettingswidget.cpp \
|
devicesupport/devicesettingswidget.cpp \
|
||||||
devicesupport/devicesettingspage.cpp \
|
devicesupport/devicesettingspage.cpp \
|
||||||
|
devicesupport/devicetestdialog.cpp \
|
||||||
devicesupport/deviceusedportsgatherer.cpp \
|
devicesupport/deviceusedportsgatherer.cpp \
|
||||||
devicesupport/deviceapplicationrunner.cpp \
|
devicesupport/deviceapplicationrunner.cpp \
|
||||||
devicesupport/localprocesslist.cpp \
|
devicesupport/localprocesslist.cpp \
|
||||||
@@ -257,6 +259,7 @@ FORMS += processstep.ui \
|
|||||||
codestylesettingspropertiespage.ui \
|
codestylesettingspropertiespage.ui \
|
||||||
devicesupport/devicefactoryselectiondialog.ui \
|
devicesupport/devicefactoryselectiondialog.ui \
|
||||||
devicesupport/devicesettingswidget.ui \
|
devicesupport/devicesettingswidget.ui \
|
||||||
|
devicesupport/devicetestdialog.ui \
|
||||||
devicesupport/desktopdeviceconfigurationwidget.ui
|
devicesupport/desktopdeviceconfigurationwidget.ui
|
||||||
|
|
||||||
WINSOURCES += \
|
WINSOURCES += \
|
||||||
|
|||||||
@@ -269,6 +269,9 @@ QtcPlugin {
|
|||||||
"devicesupport/devicesettingswidget.cpp",
|
"devicesupport/devicesettingswidget.cpp",
|
||||||
"devicesupport/devicesettingswidget.h",
|
"devicesupport/devicesettingswidget.h",
|
||||||
"devicesupport/devicesettingswidget.ui",
|
"devicesupport/devicesettingswidget.ui",
|
||||||
|
"devicesupport/devicetestdialog.cpp",
|
||||||
|
"devicesupport/devicetestdialog.h",
|
||||||
|
"devicesupport/devicetestdialog.ui",
|
||||||
"devicesupport/deviceusedportsgatherer.cpp",
|
"devicesupport/deviceusedportsgatherer.cpp",
|
||||||
"devicesupport/deviceusedportsgatherer.h",
|
"devicesupport/deviceusedportsgatherer.h",
|
||||||
"devicesupport/idevice.cpp",
|
"devicesupport/idevice.cpp",
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ ProjectExplorer::DeviceProcessList *QnxDeviceConfiguration::createProcessListMod
|
|||||||
return new QnxDeviceProcessList(sharedFromThis(), parent);
|
return new QnxDeviceProcessList(sharedFromThis(), parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoteLinux::AbstractLinuxDeviceTester *QnxDeviceConfiguration::createDeviceTester() const
|
ProjectExplorer::DeviceTester *QnxDeviceConfiguration::createDeviceTester() const
|
||||||
{
|
{
|
||||||
return new QnxDeviceTester;
|
return new QnxDeviceTester;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public:
|
|||||||
ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const;
|
ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const;
|
||||||
ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent) const;
|
ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent) const;
|
||||||
|
|
||||||
RemoteLinux::AbstractLinuxDeviceTester *createDeviceTester() const;
|
ProjectExplorer::DeviceTester *createDeviceTester() const;
|
||||||
|
|
||||||
QString displayType() const;
|
QString displayType() const;
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
|
|
||||||
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
||||||
#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
|
#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
|
||||||
#include <remotelinux/linuxdevicetestdialog.h>
|
|
||||||
#include <utils/portlist.h>
|
#include <utils/portlist.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -76,8 +75,5 @@ IDevice::Ptr QnxDeviceConfigurationWizard::device()
|
|||||||
device->setSshParameters(sshParams);
|
device->setSshParameters(sshParams);
|
||||||
device->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100")));
|
device->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100")));
|
||||||
|
|
||||||
RemoteLinux::LinuxDeviceTestDialog dlg(device, device->createDeviceTester(), this);
|
|
||||||
dlg.exec();
|
|
||||||
|
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ using namespace Qnx;
|
|||||||
using namespace Qnx::Internal;
|
using namespace Qnx::Internal;
|
||||||
|
|
||||||
QnxDeviceTester::QnxDeviceTester(QObject *parent)
|
QnxDeviceTester::QnxDeviceTester(QObject *parent)
|
||||||
: RemoteLinux::AbstractLinuxDeviceTester(parent)
|
: ProjectExplorer::DeviceTester(parent)
|
||||||
, m_result(TestSuccess)
|
, m_result(TestSuccess)
|
||||||
, m_state(Inactive)
|
, m_state(Inactive)
|
||||||
, m_currentCommandIndex(-1)
|
, m_currentCommandIndex(-1)
|
||||||
@@ -70,8 +70,8 @@ void QnxDeviceTester::testDevice(const ProjectExplorer::IDevice::ConstPtr &devic
|
|||||||
|
|
||||||
connect(m_genericTester, SIGNAL(progressMessage(QString)), SIGNAL(progressMessage(QString)));
|
connect(m_genericTester, SIGNAL(progressMessage(QString)), SIGNAL(progressMessage(QString)));
|
||||||
connect(m_genericTester, SIGNAL(errorMessage(QString)), SIGNAL(errorMessage(QString)));
|
connect(m_genericTester, SIGNAL(errorMessage(QString)), SIGNAL(errorMessage(QString)));
|
||||||
connect(m_genericTester, SIGNAL(finished(RemoteLinux::AbstractLinuxDeviceTester::TestResult)),
|
connect(m_genericTester, SIGNAL(finished(ProjectExplorer::DeviceTester::TestResult)),
|
||||||
SLOT(handleGenericTestFinished(RemoteLinux::AbstractLinuxDeviceTester::TestResult)));
|
SLOT(handleGenericTestFinished(ProjectExplorer::DeviceTester::TestResult)));
|
||||||
|
|
||||||
m_state = GenericTest;
|
m_state = GenericTest;
|
||||||
m_genericTester->testDevice(deviceConfiguration);
|
m_genericTester->testDevice(deviceConfiguration);
|
||||||
@@ -96,7 +96,7 @@ void QnxDeviceTester::stopTest()
|
|||||||
setFinished();
|
setFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QnxDeviceTester::handleGenericTestFinished(RemoteLinux::AbstractLinuxDeviceTester::TestResult result)
|
void QnxDeviceTester::handleGenericTestFinished(TestResult result)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_state == GenericTest, return);
|
QTC_ASSERT(m_state == GenericTest, return);
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class SshRemoteProcessRunner;
|
|||||||
namespace Qnx {
|
namespace Qnx {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QnxDeviceTester : public RemoteLinux::AbstractLinuxDeviceTester
|
class QnxDeviceTester : public ProjectExplorer::DeviceTester
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
void stopTest();
|
void stopTest();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleGenericTestFinished(RemoteLinux::AbstractLinuxDeviceTester::TestResult result);
|
void handleGenericTestFinished(ProjectExplorer::DeviceTester::TestResult result);
|
||||||
|
|
||||||
void handleProcessFinished(int exitStatus);
|
void handleProcessFinished(int exitStatus);
|
||||||
void handleConnectionError();
|
void handleConnectionError();
|
||||||
@@ -70,7 +70,7 @@ private:
|
|||||||
|
|
||||||
RemoteLinux::GenericLinuxDeviceTester *m_genericTester;
|
RemoteLinux::GenericLinuxDeviceTester *m_genericTester;
|
||||||
ProjectExplorer::IDevice::ConstPtr m_deviceConfiguration;
|
ProjectExplorer::IDevice::ConstPtr m_deviceConfiguration;
|
||||||
TestResult m_result;
|
ProjectExplorer::DeviceTester::TestResult m_result;
|
||||||
State m_state;
|
State m_state;
|
||||||
|
|
||||||
int m_currentCommandIndex;
|
int m_currentCommandIndex;
|
||||||
|
|||||||
@@ -31,8 +31,6 @@
|
|||||||
|
|
||||||
#include "genericlinuxdeviceconfigurationwizardpages.h"
|
#include "genericlinuxdeviceconfigurationwizardpages.h"
|
||||||
#include "linuxdevice.h"
|
#include "linuxdevice.h"
|
||||||
#include "linuxdevicetestdialog.h"
|
|
||||||
#include "linuxdevicetester.h"
|
|
||||||
#include "remotelinux_constants.h"
|
#include "remotelinux_constants.h"
|
||||||
|
|
||||||
#include <utils/portlist.h>
|
#include <utils/portlist.h>
|
||||||
@@ -91,10 +89,6 @@ IDevice::Ptr GenericLinuxDeviceConfigurationWizard::device()
|
|||||||
Core::Id(Constants::GenericLinuxOsType), IDevice::Hardware);
|
Core::Id(Constants::GenericLinuxOsType), IDevice::Hardware);
|
||||||
device->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100")));
|
device->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100")));
|
||||||
device->setSshParameters(sshParams);
|
device->setSshParameters(sshParams);
|
||||||
// Might be called after accept.
|
|
||||||
QWidget *parent = isVisible() ? this : static_cast<QWidget *>(0);
|
|
||||||
LinuxDeviceTestDialog dlg(device, new GenericLinuxDeviceTester(this), parent);
|
|
||||||
dlg.exec();
|
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#include "linuxdevice.h"
|
#include "linuxdevice.h"
|
||||||
|
|
||||||
#include "genericlinuxdeviceconfigurationwidget.h"
|
#include "genericlinuxdeviceconfigurationwidget.h"
|
||||||
#include "linuxdevicetestdialog.h"
|
#include "linuxdevicetester.h"
|
||||||
#include "publickeydeploymentdialog.h"
|
#include "publickeydeploymentdialog.h"
|
||||||
#include "remotelinux_constants.h"
|
#include "remotelinux_constants.h"
|
||||||
|
|
||||||
@@ -192,16 +192,13 @@ ProjectExplorer::IDeviceWidget *LinuxDevice::createWidget()
|
|||||||
|
|
||||||
QList<Core::Id> LinuxDevice::actionIds() const
|
QList<Core::Id> LinuxDevice::actionIds() const
|
||||||
{
|
{
|
||||||
return QList<Core::Id>() << Core::Id(Constants::GenericTestDeviceActionId)
|
return QList<Core::Id>() << Core::Id(Constants::GenericDeployKeyToDeviceActionId);
|
||||||
<< Core::Id(Constants::GenericDeployKeyToDeviceActionId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString LinuxDevice::displayNameForActionId(Core::Id actionId) const
|
QString LinuxDevice::displayNameForActionId(Core::Id actionId) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(actionIds().contains(actionId), return QString());
|
QTC_ASSERT(actionIds().contains(actionId), return QString());
|
||||||
|
|
||||||
if (actionId == Constants::GenericTestDeviceActionId)
|
|
||||||
return tr("Test");
|
|
||||||
if (actionId == Constants::GenericDeployKeyToDeviceActionId)
|
if (actionId == Constants::GenericDeployKeyToDeviceActionId)
|
||||||
return tr("Deploy Public Key...");
|
return tr("Deploy Public Key...");
|
||||||
return QString(); // Can't happen.
|
return QString(); // Can't happen.
|
||||||
@@ -213,9 +210,7 @@ void LinuxDevice::executeAction(Core::Id actionId, QWidget *parent) const
|
|||||||
|
|
||||||
QDialog *d = 0;
|
QDialog *d = 0;
|
||||||
const LinuxDevice::ConstPtr device = sharedFromThis().staticCast<const LinuxDevice>();
|
const LinuxDevice::ConstPtr device = sharedFromThis().staticCast<const LinuxDevice>();
|
||||||
if (actionId == Constants::GenericTestDeviceActionId)
|
if (actionId == Constants::GenericDeployKeyToDeviceActionId)
|
||||||
d = new LinuxDeviceTestDialog(device, createDeviceTester(), parent);
|
|
||||||
else if (actionId == Constants::GenericDeployKeyToDeviceActionId)
|
|
||||||
d = PublicKeyDeploymentDialog::createDialog(device, parent);
|
d = PublicKeyDeploymentDialog::createDialog(device, parent);
|
||||||
if (d)
|
if (d)
|
||||||
d->exec();
|
d->exec();
|
||||||
@@ -264,7 +259,7 @@ DeviceProcessList *LinuxDevice::createProcessListModel(QObject *parent) const
|
|||||||
return new LinuxDeviceProcessList(sharedFromThis(), parent);
|
return new LinuxDeviceProcessList(sharedFromThis(), parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractLinuxDeviceTester *LinuxDevice::createDeviceTester() const
|
DeviceTester *LinuxDevice::createDeviceTester() const
|
||||||
{
|
{
|
||||||
return new GenericLinuxDeviceTester;
|
return new GenericLinuxDeviceTester;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ namespace Utils { class PortList; }
|
|||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
namespace Internal { class LinuxDevicePrivate; }
|
namespace Internal { class LinuxDevicePrivate; }
|
||||||
class AbstractLinuxDeviceTester;
|
|
||||||
|
|
||||||
class REMOTELINUX_EXPORT LinuxDeviceProcessSupport : public ProjectExplorer::DeviceProcessSupport
|
class REMOTELINUX_EXPORT LinuxDeviceProcessSupport : public ProjectExplorer::DeviceProcessSupport
|
||||||
{
|
{
|
||||||
@@ -74,7 +73,8 @@ public:
|
|||||||
ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const;
|
ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const;
|
||||||
bool canCreateProcessModel() const { return true; }
|
bool canCreateProcessModel() const { return true; }
|
||||||
ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent) const;
|
ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent) const;
|
||||||
virtual AbstractLinuxDeviceTester *createDeviceTester() const;
|
bool hasDeviceTester() const { return true; }
|
||||||
|
ProjectExplorer::DeviceTester *createDeviceTester() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
LinuxDevice() {}
|
LinuxDevice() {}
|
||||||
|
|||||||
@@ -61,13 +61,8 @@ public:
|
|||||||
|
|
||||||
using namespace Internal;
|
using namespace Internal;
|
||||||
|
|
||||||
AbstractLinuxDeviceTester::AbstractLinuxDeviceTester(QObject *parent) : QObject(parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GenericLinuxDeviceTester::GenericLinuxDeviceTester(QObject *parent)
|
GenericLinuxDeviceTester::GenericLinuxDeviceTester(QObject *parent)
|
||||||
: AbstractLinuxDeviceTester(parent), d(new GenericLinuxDeviceTesterPrivate)
|
: DeviceTester(parent), d(new GenericLinuxDeviceTesterPrivate)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,27 +44,7 @@ namespace Internal {
|
|||||||
class GenericLinuxDeviceTesterPrivate;
|
class GenericLinuxDeviceTesterPrivate;
|
||||||
}
|
}
|
||||||
|
|
||||||
class REMOTELINUX_EXPORT AbstractLinuxDeviceTester : public QObject
|
class REMOTELINUX_EXPORT GenericLinuxDeviceTester : public ProjectExplorer::DeviceTester
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
enum TestResult { TestSuccess, TestFailure };
|
|
||||||
|
|
||||||
virtual void testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration) = 0;
|
|
||||||
virtual void stopTest() = 0;
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void progressMessage(const QString &message);
|
|
||||||
void errorMessage(const QString &message);
|
|
||||||
void finished(RemoteLinux::AbstractLinuxDeviceTester::TestResult result);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
explicit AbstractLinuxDeviceTester(QObject *parent = 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class REMOTELINUX_EXPORT GenericLinuxDeviceTester : public AbstractLinuxDeviceTester
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -85,7 +65,7 @@ private slots:
|
|||||||
void handlePortListReady();
|
void handlePortListReady();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setFinished(TestResult result);
|
void setFinished(ProjectExplorer::DeviceTester::TestResult result);
|
||||||
|
|
||||||
Internal::GenericLinuxDeviceTesterPrivate * const d;
|
Internal::GenericLinuxDeviceTesterPrivate * const d;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ HEADERS += \
|
|||||||
packageuploader.h \
|
packageuploader.h \
|
||||||
linuxdevicetester.h \
|
linuxdevicetester.h \
|
||||||
remotelinux_constants.h \
|
remotelinux_constants.h \
|
||||||
linuxdevicetestdialog.h \
|
|
||||||
remotelinuxenvironmentreader.h \
|
remotelinuxenvironmentreader.h \
|
||||||
sshkeydeployer.h \
|
sshkeydeployer.h \
|
||||||
typespecificdeviceconfigurationlistmodel.h \
|
typespecificdeviceconfigurationlistmodel.h \
|
||||||
@@ -81,7 +80,6 @@ SOURCES += \
|
|||||||
remotelinuxpackageinstaller.cpp \
|
remotelinuxpackageinstaller.cpp \
|
||||||
packageuploader.cpp \
|
packageuploader.cpp \
|
||||||
linuxdevicetester.cpp \
|
linuxdevicetester.cpp \
|
||||||
linuxdevicetestdialog.cpp \
|
|
||||||
remotelinuxenvironmentreader.cpp \
|
remotelinuxenvironmentreader.cpp \
|
||||||
sshkeydeployer.cpp \
|
sshkeydeployer.cpp \
|
||||||
typespecificdeviceconfigurationlistmodel.cpp \
|
typespecificdeviceconfigurationlistmodel.cpp \
|
||||||
@@ -98,7 +96,6 @@ SOURCES += \
|
|||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
genericlinuxdeviceconfigurationwizardsetuppage.ui \
|
genericlinuxdeviceconfigurationwizardsetuppage.ui \
|
||||||
linuxdevicetestdialog.ui \
|
|
||||||
remotelinuxdeployconfigurationwidget.ui \
|
remotelinuxdeployconfigurationwidget.ui \
|
||||||
genericlinuxdeviceconfigurationwidget.ui \
|
genericlinuxdeviceconfigurationwidget.ui \
|
||||||
remotelinuxcheckforfreediskspacestepwidget.ui
|
remotelinuxcheckforfreediskspacestepwidget.ui
|
||||||
|
|||||||
@@ -46,9 +46,6 @@ QtcPlugin {
|
|||||||
"genericremotelinuxdeploystepfactory.h",
|
"genericremotelinuxdeploystepfactory.h",
|
||||||
"linuxdevice.cpp",
|
"linuxdevice.cpp",
|
||||||
"linuxdevice.h",
|
"linuxdevice.h",
|
||||||
"linuxdevicetestdialog.cpp",
|
|
||||||
"linuxdevicetestdialog.h",
|
|
||||||
"linuxdevicetestdialog.ui",
|
|
||||||
"linuxdevicetester.cpp",
|
"linuxdevicetester.cpp",
|
||||||
"linuxdevicetester.h",
|
"linuxdevicetester.h",
|
||||||
"packageuploader.cpp",
|
"packageuploader.cpp",
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ namespace Constants {
|
|||||||
|
|
||||||
const char GenericLinuxOsType[] = "GenericLinuxOsType";
|
const char GenericLinuxOsType[] = "GenericLinuxOsType";
|
||||||
|
|
||||||
const char GenericTestDeviceActionId[] = "RemoteLinux.GenericTestDeviceAction";
|
|
||||||
const char GenericDeployKeyToDeviceActionId[] = "RemoteLinux.GenericDeployKeyToDeviceAction";
|
const char GenericDeployKeyToDeviceActionId[] = "RemoteLinux.GenericDeployKeyToDeviceAction";
|
||||||
|
|
||||||
const char EMBEDDED_LINUX_QT[] = "RemoteLinux.EmbeddedLinuxQt";
|
const char EMBEDDED_LINUX_QT[] = "RemoteLinux.EmbeddedLinuxQt";
|
||||||
|
|||||||
Reference in New Issue
Block a user