Commit b05b084f authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau Committed by Christoph Cullmann
Browse files

SQL addon: use KPasswordLineEdit instead of KLineEdit::passwordMode

Enables to optionally view the password
parent a4f32e2d
......@@ -11,6 +11,7 @@
#include <KLineEdit>
#include <KLocalizedString>
#include <KMessageBox>
#include <KPasswordLineEdit>
#include <KUrlRequester>
#include <QFormLayout>
......@@ -82,7 +83,7 @@ ConnectionStandardServerPage::ConnectionStandardServerPage(QWidget *parent)
hostnameLineEdit = new KLineEdit();
usernameLineEdit = new KLineEdit();
passwordLineEdit = new KLineEdit();
passwordLineEdit = new KPasswordLineEdit();
databaseLineEdit = new KLineEdit();
optionsLineEdit = new KLineEdit();
portSpinBox = new QSpinBox();
......@@ -91,8 +92,6 @@ ConnectionStandardServerPage::ConnectionStandardServerPage(QWidget *parent)
portSpinBox->setSpecialValueText(i18nc("@item Spinbox special value", "Default"));
portSpinBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
passwordLineEdit->setPasswordMode(true);
layout->addRow(i18nc("@label:textbox", "Hostname:"), hostnameLineEdit);
layout->addRow(i18nc("@label:textbox", "Username:"), usernameLineEdit);
layout->addRow(i18nc("@label:textbox", "Password:"), passwordLineEdit);
......@@ -104,7 +103,7 @@ ConnectionStandardServerPage::ConnectionStandardServerPage(QWidget *parent)
registerField(QStringLiteral("hostname*"), hostnameLineEdit);
registerField(QStringLiteral("username"), usernameLineEdit);
registerField(QStringLiteral("password"), passwordLineEdit);
registerField(QStringLiteral("password"), passwordLineEdit, "password", "passwordChanged");
registerField(QStringLiteral("database"), databaseLineEdit);
registerField(QStringLiteral("stdOptions"), optionsLineEdit);
registerField(QStringLiteral("port"), portSpinBox);
......@@ -124,7 +123,7 @@ void ConnectionStandardServerPage::initializePage()
if (c->driver == field(QStringLiteral("driver")).toString()) {
hostnameLineEdit->setText(c->hostname);
usernameLineEdit->setText(c->username);
passwordLineEdit->setText(c->password);
passwordLineEdit->setPassword(c->password);
databaseLineEdit->setText(c->database);
optionsLineEdit->setText(c->options);
portSpinBox->setValue(c->port);
......
......@@ -10,6 +10,7 @@
class SQLManager;
class KComboBox;
class KLineEdit;
class KPasswordLineEdit;
class QSpinBox;
class KUrlRequester;
......@@ -63,7 +64,7 @@ public:
private:
KLineEdit *hostnameLineEdit;
KLineEdit *usernameLineEdit;
KLineEdit *passwordLineEdit;
KPasswordLineEdit *passwordLineEdit;
KLineEdit *databaseLineEdit;
KLineEdit *optionsLineEdit;
QSpinBox *portSpinBox;
......
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