Also rename the respective file to better reflect its new purpose.
Change-Id: I815807a958d2d76db87d4d27b63338f5ced9ffeb
Reviewed-on: http://codereview.qt.nokia.com/544
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
**************************************************************************/
#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
}
} // namespace RemoteLinux
-
-#include "genericlinuxdeviceconfigurationwizard.moc"
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
-#include "genericlinuxdeviceconfigurationwizardsetuppage.h"
+#include "genericlinuxdeviceconfigurationwizardpages.h"
#include "ui_genericlinuxdeviceconfigurationwizardsetuppage.h"
#include "linuxdeviceconfiguration.h"
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();
return QString();
}
+QString GenericLinuxDeviceConfigurationWizardSetupPage::defaultPassWord() const
+{
+ return QString();
+}
+
void GenericLinuxDeviceConfigurationWizardSetupPage::handleAuthTypeChanged()
{
m_d->ui.passwordLineEdit->setEnabled(authenticationType() == SshConnectionParameters::AuthenticationByPassword);
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
#include <QtGui/QWizardPage>
+QT_BEGIN_NAMESPACE
+class QLabel;
+QT_END_NAMESPACE
+
namespace RemoteLinux {
namespace Internal {
class GenericLinuxDeviceConfigurationWizardSetupPagePrivate;
virtual QString defaultHostName() const;
virtual QString defaultUserName() const;
+ virtual QString defaultPassWord() const;
private:
Q_SLOT void handleAuthTypeChanged();
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
#include "maemoglobal.h"
#include "maemokeydeployer.h"
+#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
#include <utils/fileutils.h>
#include <utils/ssh/sshkeygenerator.h>
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;
};
using ProjectExplorer::Target;
namespace RemoteLinux {
- namespace Internal {
+namespace Internal {
class MaemoRunConfigurationFactory : public IRunConfigurationFactory
{
linuxdevicefactoryselectiondialog.h \
publickeydeploymentdialog.h \
genericlinuxdeviceconfigurationwizard.h \
- genericlinuxdeviceconfigurationwizardsetuppage.h \
genericlinuxdeviceconfigurationfactory.h \
maddedeviceconfigurationfactory.h \
maemorunconfiguration.h \
remotelinuxapplicationrunner.h \
remotelinuxruncontrol.h \
remotelinuxruncontrolfactory.h \
- remotelinuxdebugsupport.h
+ remotelinuxdebugsupport.h \
+ genericlinuxdeviceconfigurationwizardpages.h
SOURCES += \
remotelinuxplugin.cpp \
linuxdevicefactoryselectiondialog.cpp \
publickeydeploymentdialog.cpp \
genericlinuxdeviceconfigurationwizard.cpp \
- genericlinuxdeviceconfigurationwizardsetuppage.cpp \
genericlinuxdeviceconfigurationfactory.cpp \
maddedeviceconfigurationfactory.cpp \
maemorunconfiguration.cpp \
remotelinuxapplicationrunner.cpp \
remotelinuxruncontrol.cpp \
remotelinuxruncontrolfactory.cpp \
- remotelinuxdebugsupport.cpp
+ remotelinuxdebugsupport.cpp \
+ genericlinuxdeviceconfigurationwizardpages.cpp
FORMS += \
maemoconfigtestdialog.ui \