mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Prompt user when KWallet is disabled
Summary: From now, when the user saves the password by clicking remember he will get a notification that the password is saved. Reviewers: SGOrava, drosca Reviewed By: SGOrava, drosca Subscribers: drosca, alukichev, falkon Tags: #falkon Differential Revision: https://phabricator.kde.org/D26932
This commit is contained in:
parent
0e25b116cb
commit
e4b468e233
|
@ -19,6 +19,7 @@
|
|||
#include "kdeframeworksintegrationplugin.h"
|
||||
#include "mainapplication.h"
|
||||
#include "browserwindow.h"
|
||||
#include "desktopnotificationsfactory.h"
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
|
@ -83,6 +84,7 @@ void KWalletPasswordBackend::addEntry(const PasswordEntry &entry)
|
|||
initialize();
|
||||
|
||||
if (!m_wallet) {
|
||||
showErrorNotification();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -99,6 +101,7 @@ bool KWalletPasswordBackend::updateEntry(const PasswordEntry &entry)
|
|||
initialize();
|
||||
|
||||
if (!m_wallet) {
|
||||
showErrorNotification();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -119,6 +122,7 @@ void KWalletPasswordBackend::updateLastUsed(PasswordEntry &entry)
|
|||
initialize();
|
||||
|
||||
if (!m_wallet) {
|
||||
showErrorNotification();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -140,6 +144,7 @@ void KWalletPasswordBackend::removeEntry(const PasswordEntry &entry)
|
|||
initialize();
|
||||
|
||||
if (!m_wallet) {
|
||||
showErrorNotification();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -157,6 +162,7 @@ void KWalletPasswordBackend::removeAll()
|
|||
initialize();
|
||||
|
||||
if (!m_wallet) {
|
||||
showErrorNotification();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -166,6 +172,16 @@ void KWalletPasswordBackend::removeAll()
|
|||
m_wallet->createFolder("Falkon");
|
||||
}
|
||||
|
||||
void KWalletPasswordBackend::showErrorNotification()
|
||||
{
|
||||
static bool initialized;
|
||||
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
mApp->desktopNotifications()->showNotification(KDEFrameworksIntegrationPlugin::tr("KWallet disabled"), KDEFrameworksIntegrationPlugin::tr("Please enable KWallet to save password."));
|
||||
}
|
||||
}
|
||||
|
||||
void KWalletPasswordBackend::initialize()
|
||||
{
|
||||
if (m_wallet) {
|
||||
|
|
|
@ -47,6 +47,7 @@ public:
|
|||
|
||||
private:
|
||||
void initialize();
|
||||
void showErrorNotification();
|
||||
|
||||
KWallet::Wallet* m_wallet;
|
||||
QVector<PasswordEntry> m_allEntries;
|
||||
|
|
Loading…
Reference in New Issue
Block a user