Commit 6400d842 authored by Christian Kandeler's avatar Christian Kandeler Committed by Leena Miettinen

RemoteLinux: Device configuration wizard improvements.

- Fix factory list widget item heights.
- Use more consistent wording.
- Remove unused wizard page.

Change-Id: I5d0b215e7de8da0c872077a7597453739131c0d4
Reviewed-on: http://codereview.qt.nokia.com/1304Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarLeena Miettinen <riitta-leena.miettinen@nokia.com>
parent 862bc044
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>542</width>
<height>201</height>
<width>564</width>
<height>207</height>
</rect>
</property>
<property name="windowTitle">
......@@ -71,7 +71,7 @@
<item row="2" column="0">
<widget class="QLabel" name="userNameLabel">
<property name="text">
<string>User name:</string>
<string>The user name to log into the device:</string>
</property>
</widget>
</item>
......@@ -98,7 +98,7 @@
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Authentication type:</string>
<string>The authentication type:</string>
</property>
</widget>
</item>
......@@ -136,7 +136,7 @@
<item row="4" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Password:</string>
<string>The user's password:</string>
</property>
</widget>
</item>
......@@ -167,7 +167,7 @@
<item row="5" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Private key:</string>
<string>The file containing the user's private key:</string>
</property>
</widget>
</item>
......
......@@ -17,12 +17,15 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Available wizards:</string>
<string>Available device types:</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="resizeMode">
<enum>QListView::Adjust</enum>
</property>
......@@ -30,7 +33,7 @@
<bool>true</bool>
</property>
<property name="wordWrap">
<bool>true</bool>
<bool>false</bool>
</property>
</widget>
</item>
......
......@@ -32,7 +32,6 @@
#include "maemodeviceconfigwizard.h"
#include "ui_maemodeviceconfigwizardkeycreationpage.h"
#include "ui_maemodeviceconfigwizardkeydeploymentpage.h"
#include "ui_maemodeviceconfigwizardlogindatapage.h"
#include "ui_maemodeviceconfigwizardpreviouskeysetupcheckpage.h"
#include "ui_maemodeviceconfigwizardreusekeyscheckpage.h"
#include "ui_maemodeviceconfigwizardstartpage.h"
......@@ -86,8 +85,8 @@ struct WizardData
};
enum PageId {
StartPageId, LoginDataPageId, PreviousKeySetupCheckPageId,
ReuseKeysCheckPageId, KeyCreationPageId, KeyDeploymentPageId, FinalPageId
StartPageId, PreviousKeySetupCheckPageId, ReuseKeysCheckPageId, KeyCreationPageId,
KeyDeploymentPageId, FinalPageId
};
class MaemoDeviceConfigWizardStartPage : public QWizardPage
......@@ -174,67 +173,6 @@ private:
const QScopedPointer<Ui::MaemoDeviceConfigWizardStartPage> m_ui;
};
class MaemoDeviceConfigWizardLoginDataPage : public QWizardPage
{
Q_OBJECT
public:
MaemoDeviceConfigWizardLoginDataPage(WizardData &wizardData, QWidget *parent)
: QWizardPage(parent),
m_ui(new Ui::MaemoDeviceConfigWizardLoginDataPage),
m_wizardData(wizardData)
{
m_ui->setupUi(this);
setTitle(tr("Login Data"));
m_ui->privateKeyPathChooser->setExpectedKind(PathChooser::File);
setSubTitle(QLatin1String(" ")); // For Qt bug (background color)
connect(m_ui->userNameLineEdit, SIGNAL(textChanged(QString)),
SIGNAL(completeChanged()));
connect(m_ui->privateKeyPathChooser, SIGNAL(validChanged()),
SIGNAL(completeChanged()));
connect(m_ui->passwordButton, SIGNAL(toggled(bool)),
SLOT(handleAuthTypeChanged()));
}
virtual bool isComplete() const
{
return !userName().isEmpty()
&& (authType() == SshConnectionParameters::AuthenticationByPassword
|| m_ui->privateKeyPathChooser->isValid());
}
virtual void initializePage()
{
m_ui->userNameLineEdit->setText(defaultUser(m_wizardData.osType));
m_ui->passwordButton->setChecked(true);
m_ui->passwordLineEdit->clear();
m_ui->privateKeyPathChooser->setPath(LinuxDeviceConfiguration::defaultPrivateKeyFilePath());
handleAuthTypeChanged();
}
SshConnectionParameters::AuthenticationType authType() const
{
return m_ui->passwordButton->isChecked()
? SshConnectionParameters::AuthenticationByPassword
: SshConnectionParameters::AuthenticationByKey;
}
QString userName() const { return m_ui->userNameLineEdit->text().trimmed(); }
QString password() const { return m_ui->passwordLineEdit->text(); }
QString privateKeyFilePath() const { return m_ui->privateKeyPathChooser->path(); }
private:
Q_SLOT void handleAuthTypeChanged()
{
m_ui->passwordLineEdit->setEnabled(authType() == SshConnectionParameters::AuthenticationByPassword);
m_ui->privateKeyPathChooser->setEnabled(authType() == SshConnectionParameters::AuthenticationByKey);
emit completeChanged();
}
const QScopedPointer<Ui::MaemoDeviceConfigWizardLoginDataPage> m_ui;
const WizardData &m_wizardData;
};
class MaemoDeviceConfigWizardPreviousKeySetupCheckPage : public QWizardPage
{
Q_OBJECT
......@@ -578,7 +516,6 @@ struct MaemoDeviceConfigWizardPrivate
{
MaemoDeviceConfigWizardPrivate(QWidget *parent)
: startPage(parent),
loginDataPage(wizardData, parent),
previousKeySetupPage(parent),
reuseKeysCheckPage(parent),
keyCreationPage(parent),
......@@ -589,7 +526,6 @@ struct MaemoDeviceConfigWizardPrivate
WizardData wizardData;
MaemoDeviceConfigWizardStartPage startPage;
MaemoDeviceConfigWizardLoginDataPage loginDataPage;
MaemoDeviceConfigWizardPreviousKeySetupCheckPage previousKeySetupPage;
MaemoDeviceConfigWizardReuseKeysCheckPage reuseKeysCheckPage;
MaemoDeviceConfigWizardKeyCreationPage keyCreationPage;
......@@ -603,7 +539,6 @@ MaemoDeviceConfigWizard::MaemoDeviceConfigWizard(QWidget *parent)
{
setWindowTitle(tr("New Device Configuration Setup"));
setPage(StartPageId, &d->startPage);
setPage(LoginDataPageId, &d->loginDataPage);
setPage(PreviousKeySetupCheckPageId, &d->previousKeySetupPage);
setPage(ReuseKeysCheckPageId, &d->reuseKeysCheckPage);
setPage(KeyCreationPageId, &d->keyCreationPage);
......@@ -658,14 +593,6 @@ int MaemoDeviceConfigWizard::nextId() const
if (d->wizardData.deviceType == LinuxDeviceConfiguration::Emulator)
return FinalPageId;
return PreviousKeySetupCheckPageId;
case LoginDataPageId:
d->wizardData.userName = d->loginDataPage.userName();
d->wizardData.authType = d->loginDataPage.authType();
if (d->wizardData.authType == SshConnectionParameters::AuthenticationByPassword)
d->wizardData.password = d->loginDataPage.password();
else
d->wizardData.privateKeyFilePath = d->loginDataPage.privateKeyFilePath();
return FinalPageId;
case PreviousKeySetupCheckPageId:
if (d->previousKeySetupPage.keyBasedLoginWasSetup()) {
d->wizardData.privateKeyFilePath
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MaemoDeviceConfigWizardLoginDataPage</class>
<widget class="QWizardPage" name="MaemoDeviceConfigWizardLoginDataPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>423</width>
<height>127</height>
</rect>
</property>
<property name="windowTitle">
<string>WizardPage</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="userNameLabel">
<property name="text">
<string>User name:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="userNameLineEdit"/>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Authentication type:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QRadioButton" name="passwordButton">
<property name="text">
<string>Password</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton">
<property name="text">
<string>Key</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="passwordLineEdit">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Private key:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="Utils::PathChooser" name="privateKeyPathChooser"/>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::PathChooser</class>
<extends>QWidget</extends>
<header location="global">utils/pathchooser.h</header>
<container>1</container>
<slots>
<signal>editingFinished()</signal>
<signal>browsingFinished()</signal>
</slots>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -102,7 +102,7 @@
<item row="4" column="0">
<widget class="QLabel" name="sshPortLabel">
<property name="text">
<string>The SSH port:</string>
<string>The SSH server port:</string>
</property>
</widget>
</item>
......
......@@ -180,7 +180,6 @@ FORMS += \
maemodeviceconfigwizardkeycreationpage.ui \
maemodeviceconfigwizardkeydeploymentpage.ui \
maemodeployconfigurationwidget.ui \
maemodeviceconfigwizardlogindatapage.ui \
linuxdevicefactoryselectiondialog.ui \
genericlinuxdeviceconfigurationwizardsetuppage.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