Commit 92b17264 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

RemoteLinux: Export and re-use wizard page.

Also rename the respective file to better reflect its new purpose.

Change-Id: I815807a958d2d76db87d4d27b63338f5ced9ffeb
Reviewed-on: http://codereview.qt.nokia.com/544

Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent e31accb8
......@@ -30,46 +30,15 @@
**************************************************************************/
#include "genericlinuxdeviceconfigurationwizard.h"
#include "genericlinuxdeviceconfigurationwizardsetuppage.h"
#include "genericlinuxdeviceconfigurationwizardpages.h"
#include "maemoconfigtestdialog.h"
#include <QtGui/QLabel>
#include <QtGui/QVBoxLayout>
using namespace Utils;
namespace RemoteLinux {
namespace Internal {
namespace {
enum PageId { SetupPageId, FinalPageId };
class GenericLinuxDeviceConfigurationWizardFinalPage : public QWizardPage
{
Q_OBJECT
public:
GenericLinuxDeviceConfigurationWizardFinalPage(QWidget *parent)
: QWizardPage(parent), m_infoLabel(new QLabel(this))
{
setTitle(tr("Setup Finished"));
setSubTitle(QLatin1String(" ")); // For Qt bug (background color)
m_infoLabel->setWordWrap(true);
QVBoxLayout * const layout = new QVBoxLayout(this);
layout->addWidget(m_infoLabel);
}
virtual void initializePage()
{
const QString infoText = tr("The new device configuration will now be "
"created. In addition, a test procedure will be run to check whether "
"Qt Creator can connect to the device and to provide some information about it.");
m_infoLabel->setText(infoText);
}
private:
QLabel * const m_infoLabel;
};
} // anonymous namespace
class GenericLinuxDeviceConfigurationWizardPrivate
......@@ -117,5 +86,3 @@ LinuxDeviceConfiguration::Ptr GenericLinuxDeviceConfigurationWizard::deviceConfi
}
} // namespace RemoteLinux
#include "genericlinuxdeviceconfigurationwizard.moc"
......@@ -28,7 +28,7 @@
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#include "genericlinuxdeviceconfigurationwizardsetuppage.h"
#include "genericlinuxdeviceconfigurationwizardpages.h"
#include "ui_genericlinuxdeviceconfigurationwizardsetuppage.h"
#include "linuxdeviceconfiguration.h"
......@@ -71,6 +71,7 @@ void GenericLinuxDeviceConfigurationWizardSetupPage::initializePage()
m_d->ui.hostNameLineEdit->setText(defaultHostName());
m_d->ui.userNameLineEdit->setText(defaultUserName());
m_d->ui.passwordButton->setChecked(true);
m_d->ui.passwordLineEdit->setText(defaultPassWord());
m_d->ui.passwordLineEdit->clear();
m_d->ui.privateKeyPathChooser->setPath(LinuxDeviceConfiguration::defaultPrivateKeyFilePath());
handleAuthTypeChanged();
......@@ -125,6 +126,11 @@ QString GenericLinuxDeviceConfigurationWizardSetupPage::defaultUserName() const
return QString();
}
QString GenericLinuxDeviceConfigurationWizardSetupPage::defaultPassWord() const
{
return QString();
}
void GenericLinuxDeviceConfigurationWizardSetupPage::handleAuthTypeChanged()
{
m_d->ui.passwordLineEdit->setEnabled(authenticationType() == SshConnectionParameters::AuthenticationByPassword);
......@@ -132,4 +138,26 @@ void GenericLinuxDeviceConfigurationWizardSetupPage::handleAuthTypeChanged()
emit completeChanged();
}
GenericLinuxDeviceConfigurationWizardFinalPage::GenericLinuxDeviceConfigurationWizardFinalPage(QWidget *parent)
: QWizardPage(parent), m_infoLabel(new QLabel(this))
{
setTitle(tr("Setup Finished"));
setSubTitle(QLatin1String(" ")); // For Qt bug (background color)
m_infoLabel->setWordWrap(true);
QVBoxLayout * const layout = new QVBoxLayout(this);
layout->addWidget(m_infoLabel);
}
void GenericLinuxDeviceConfigurationWizardFinalPage::initializePage()
{
m_infoLabel->setText(infoText());
}
QString GenericLinuxDeviceConfigurationWizardFinalPage::infoText() const
{
return tr("The new device configuration will now be created.\n"
"In addition, device connectivity will be tested.");
}
} // namespace RemoteLinux
......@@ -37,6 +37,10 @@
#include <QtGui/QWizardPage>
QT_BEGIN_NAMESPACE
class QLabel;
QT_END_NAMESPACE
namespace RemoteLinux {
namespace Internal {
class GenericLinuxDeviceConfigurationWizardSetupPagePrivate;
......@@ -63,6 +67,7 @@ public:
virtual QString defaultHostName() const;
virtual QString defaultUserName() const;
virtual QString defaultPassWord() const;
private:
Q_SLOT void handleAuthTypeChanged();
......@@ -70,6 +75,22 @@ private:
Internal::GenericLinuxDeviceConfigurationWizardSetupPagePrivate * const m_d;
};
class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWizardFinalPage : public QWizardPage
{
Q_OBJECT
public:
GenericLinuxDeviceConfigurationWizardFinalPage(QWidget *parent);
void initializePage();
protected:
virtual QString infoText() const;
private:
QLabel * const m_infoLabel;
};
} // namespace RemoteLinux
#endif // GENERICLINUXDEVICECONFIGURATIONWIZARDSETUPPAGE_H
......@@ -42,6 +42,7 @@
#include "maemoglobal.h"
#include "maemokeydeployer.h"
#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
#include <utils/fileutils.h>
#include <utils/ssh/sshkeygenerator.h>
......@@ -532,39 +533,23 @@ private:
QString m_instructionTextTemplate;
};
class MaemoDeviceConfigWizardFinalPage : public QWizardPage
class MaemoDeviceConfigWizardFinalPage : public GenericLinuxDeviceConfigurationWizardFinalPage
{
Q_OBJECT
public:
MaemoDeviceConfigWizardFinalPage(const WizardData &wizardData,
QWidget *parent)
: QWizardPage(parent),
m_infoLabel(new QLabel(this)),
m_wizardData(wizardData)
MaemoDeviceConfigWizardFinalPage(const WizardData &wizardData, QWidget *parent)
: GenericLinuxDeviceConfigurationWizardFinalPage(parent), m_wizardData(wizardData)
{
setTitle(tr("Setup Finished"));
setSubTitle(QLatin1String(" ")); // For Qt bug (background color)
m_infoLabel->setWordWrap(true);
QVBoxLayout * const layout = new QVBoxLayout(this);
layout->addWidget(m_infoLabel);
}
virtual void initializePage()
private:
QString infoText() const
{
QString infoText;
if (m_wizardData.deviceType == LinuxDeviceConfiguration::Physical) {
infoText = tr("The new device configuration will now be "
"created and a test procedure will be run to check whether "
"Qt Creator can connect to the device and to provide some "
"information about its features.");
} else {
infoText = tr("The new device configuration will now be created.");
}
m_infoLabel->setText(infoText);
if (m_wizardData.deviceType == LinuxDeviceConfiguration::Emulator)
return tr("The new device configuration will now be created.");
return GenericLinuxDeviceConfigurationWizardFinalPage::infoText();
}
private:
QLabel * const m_infoLabel;
const WizardData &m_wizardData;
};
......
......@@ -47,7 +47,7 @@ using ProjectExplorer::RunControl;
using ProjectExplorer::Target;
namespace RemoteLinux {
namespace Internal {
namespace Internal {
class MaemoRunConfigurationFactory : public IRunConfigurationFactory
{
......
......@@ -75,7 +75,6 @@ HEADERS += \
linuxdevicefactoryselectiondialog.h \
publickeydeploymentdialog.h \
genericlinuxdeviceconfigurationwizard.h \
genericlinuxdeviceconfigurationwizardsetuppage.h \
genericlinuxdeviceconfigurationfactory.h \
maddedeviceconfigurationfactory.h \
maemorunconfiguration.h \
......@@ -84,7 +83,8 @@ HEADERS += \
remotelinuxapplicationrunner.h \
remotelinuxruncontrol.h \
remotelinuxruncontrolfactory.h \
remotelinuxdebugsupport.h
remotelinuxdebugsupport.h \
genericlinuxdeviceconfigurationwizardpages.h
SOURCES += \
remotelinuxplugin.cpp \
......@@ -151,7 +151,6 @@ SOURCES += \
linuxdevicefactoryselectiondialog.cpp \
publickeydeploymentdialog.cpp \
genericlinuxdeviceconfigurationwizard.cpp \
genericlinuxdeviceconfigurationwizardsetuppage.cpp \
genericlinuxdeviceconfigurationfactory.cpp \
maddedeviceconfigurationfactory.cpp \
maemorunconfiguration.cpp \
......@@ -160,7 +159,8 @@ SOURCES += \
remotelinuxapplicationrunner.cpp \
remotelinuxruncontrol.cpp \
remotelinuxruncontrolfactory.cpp \
remotelinuxdebugsupport.cpp
remotelinuxdebugsupport.cpp \
genericlinuxdeviceconfigurationwizardpages.cpp
FORMS += \
maemoconfigtestdialog.ui \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment