Commit 18bc7e43 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Honor KDE Kiosk setting lineedit_reveal_password

parent a23c4803
Pipeline #67346 failed with stage
in 24 minutes and 21 seconds
......@@ -13,6 +13,7 @@
#include "settingsadaptor.h"
#include "utils.h"
#include <KAuthorized>
#include <KLocalizedString>
#include <KWallet>
......@@ -488,6 +489,7 @@ QString Settings::promptForPassword(const QString &user)
label = new QLabel(i18n("Password: "), mainWidget);
hLayout->addWidget(label);
auto lineEdit = new KPasswordLineEdit();
lineEdit->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
hLayout->addWidget(lineEdit);
vLayout->addLayout(hLayout);
lineEdit->setFocus();
......
......@@ -6,6 +6,7 @@
#include "setupwizard.h"
#include <KAuthorized>
#include <KDAV/DavCollectionsMultiFetchJob>
#include <KLocalizedString>
#include <KPasswordLineEdit>
......@@ -217,6 +218,7 @@ CredentialsPage::CredentialsPage(QWidget *parent)
registerField(QStringLiteral("credentialsUserName*"), mUserName);
mPassword = new KPasswordLineEdit;
mPassword->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
layout->addRow(i18n("Password:"), mPassword);
registerField(QStringLiteral("credentialsPassword*"), mPassword, "password", SIGNAL(passwordChanged(QString)));
}
......
......@@ -10,6 +10,7 @@
#include <KDAV/DavCollectionModifyJob>
#include <KDAV/DavCollectionsFetchJob>
#include <KAuthorized>
#include <KLocalizedString>
#include <KMessageBox>
......@@ -27,6 +28,7 @@ UrlConfigurationDialog::UrlConfigurationDialog(QWidget *parent)
mainLayout->addWidget(mainWidget);
mUi.setupUi(mainWidget);
mUi.credentialsGroup->setVisible(false);
mUi.password->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
......
......@@ -6,6 +6,7 @@
#include "setupwizard.h"
#include <KAuthorized>
#include <KLocalizedString>
#include <KPasswordLineEdit>
#include <QCheckBox>
......@@ -76,6 +77,7 @@ LoginPage::LoginPage(QWidget *parent)
registerField(QStringLiteral("credentialsUserName*"), mUserName);
mPassword = new KPasswordLineEdit(this);
mPassword->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
layout->addRow(i18n("Password:"), mPassword);
registerField(QStringLiteral("credentialsPassword*"), mPassword, "password", SIGNAL(passwordChanged(QString)));
......
......@@ -6,6 +6,7 @@
#include "ewsconfigdialog.h"
#include <KAuthorized>
#include <KConfigDialogManager>
#include <KMessageBox>
#include <KWindowSystem>
......@@ -77,6 +78,7 @@ EwsConfigDialog::EwsConfigDialog(EwsResource *parentResource, EwsClient &client,
mUi = new Ui::SetupServerView;
mUi->setupUi(mainWidget);
mUi->accountName->setText(parentResource->name());
mUi->passwordEdit->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
mSubWidget = new EwsSubscriptionWidget(client, mSettings.data(), this);
mUi->subscriptionTabLayout->addWidget(mSubWidget);
......
......@@ -14,6 +14,8 @@
#include "auth/ewspasswordauth.h"
#include "ewsresource_debug.h"
#include <KAuthorized>
#include <kwidgetsaddons_version.h>
static const QString ewsWalletFolder = QStringLiteral("akonadi-ews");
......@@ -86,6 +88,9 @@ void EwsSettings::requestPassword(bool ask)
} else {
qCDebug(EWSRES_LOG) << "requestPassword: Requesting interactively";
mPasswordDlg = new KPasswordDialog(nullptr);
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 84, 0)
mPasswordDlg->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
#endif
mPasswordDlg->setModal(true);
mPasswordDlg->setPrompt(i18n("Please enter password for user '%1' and Exchange account '%2'.", username(), email()));
if (mPasswordDlg->exec() == QDialog::Accepted) {
......
......@@ -11,15 +11,16 @@
#include <KMessageBox>
#include "imapresource_debug.h"
#include "imapresourcebase.h"
#include "settings.h"
#include <KAuthorized>
#include <KPasswordDialog>
#include <QDialogButtonBox>
#include <QPushButton>
#include <kwidgetsaddons_version.h>
#include <kwindowsystem.h>
#include <mailtransport/transportbase.h>
#include "imapresourcebase.h"
#include "settings.h"
SettingsPasswordRequester::SettingsPasswordRequester(ImapResourceBase *resource, QObject *parent)
: PasswordRequesterInterface(parent)
, m_resource(resource)
......@@ -149,6 +150,9 @@ QString SettingsPasswordRequester::requestManualAuth(bool *userRejected)
dlg->setModal(true);
dlg->setPrompt(i18n("Please enter password for user '%1' on IMAP server '%2'.", m_resource->settings()->userName(), m_resource->settings()->imapServer()));
dlg->setPassword(m_resource->settings()->password());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 84, 0)
dlg->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
#endif
if (dlg->exec()) {
if (userRejected) {
*userRejected = false;
......
......@@ -33,6 +33,7 @@
#include <Akonadi/KMime/SpecialMailCollections>
#include <Akonadi/KMime/SpecialMailCollectionsRequestJob>
#include <CollectionModifyJob>
#include <KAuthorized>
#include <KEMailSettings>
#include <KLocalizedString>
#include <KMessageBox>
......@@ -119,6 +120,8 @@ SetupServer::SetupServer(ImapResourceBase *parentResource, WId parent)
{
auto networkConfigMgr = new QNetworkConfigurationManager(QCoreApplication::instance());
m_ui->password->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
m_ui->customPassword->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
m_parentResource->settings()->setWinId(parent);
auto mainWidget = new QWidget(this);
auto mainLayout = new QVBoxLayout(this);
......
......@@ -13,7 +13,6 @@
#include "settings.h"
#include "settingsadaptor.h"
// KDEPIMLIBS includes
#include <Akonadi/KMime/SpecialMailCollections>
#include <Akonadi/KMime/SpecialMailCollectionsRequestJob>
#include <Collection>
......@@ -22,8 +21,8 @@
#include <MailTransport/ServerTest>
#include <resourcesettings.h>
// KDELIBS includes
#include "pop3resource_debug.h"
#include <KAuthorized>
#include <KEMailSettings>
#include <KMessageBox>
#include <KUser>
......@@ -82,6 +81,8 @@ void AccountWidget::setupWidgets()
setupUi(page);
passwordEdit->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
// only letters, digits, '-', '.', ':' (IPv6) and '_' (for Windows
// compatibility) are allowed
hostEdit->setValidator(&mValidator);
......
......@@ -19,11 +19,13 @@
#include <kmime/kmime_util.h>
#include "pop3resource_debug.h"
#include <KAuthorized>
#include <KMessageBox>
#include <KNotification>
#include <KPasswordDialog>
#include <kio/global.h>
#include <kio/job.h>
#include <kwidgetsaddons_version.h>
#include <QTimer>
#include <qt5keychain/keychain.h>
......@@ -144,6 +146,9 @@ void POP3Resource::walletOpenedForLoading(QKeychain::Job *baseJob)
void POP3Resource::showPasswordDialog(const QString &queryText)
{
QPointer<KPasswordDialog> dlg = new KPasswordDialog(nullptr, KPasswordDialog::ShowUsernameLine);
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 84, 0)
dlg->setRevealPasswordAvailable(KAuthorized::authorize(QStringLiteral("lineedit_reveal_password")));
#endif
dlg->setModal(true);
dlg->setUsername(mSettings.login());
dlg->setPassword(mPassword);
......
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