Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
b05b084f
Commit
b05b084f
authored
Jun 01, 2021
by
Friedrich W. H. Kossebau
Committed by
Christoph Cullmann
Jun 01, 2021
Browse files
SQL addon: use KPasswordLineEdit instead of KLineEdit::passwordMode
Enables to optionally view the password
parent
a4f32e2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/katesql/connectionwizard.cpp
View file @
b05b084f
...
...
@@ -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
K
Password
LineEdit
();
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
->
set
Text
(
c
->
password
);
passwordLineEdit
->
set
Password
(
c
->
password
);
databaseLineEdit
->
setText
(
c
->
database
);
optionsLineEdit
->
setText
(
c
->
options
);
portSpinBox
->
setValue
(
c
->
port
);
...
...
addons/katesql/connectionwizard.h
View file @
b05b084f
...
...
@@ -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
;
K
Password
LineEdit
*
passwordLineEdit
;
KLineEdit
*
databaseLineEdit
;
KLineEdit
*
optionsLineEdit
;
QSpinBox
*
portSpinBox
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment