1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Don't show multiple autofill notifications to save/update password

Close the old autofill notification before adding new one.
This commit is contained in:
David Rosca 2017-05-29 19:27:35 +02:00
parent 49eb9a862e
commit fcc3cf1809
2 changed files with 15 additions and 4 deletions

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2016 David Rosca <nowrep@gmail.com>
* QupZilla - Qt web browser
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -208,8 +208,15 @@ void AutoFill::saveForm(WebPage *page, const QUrl &frameUrl, const PageFormData
}
}
if (m_lastNotification && m_lastNotificationPage == page) {
m_lastNotification->close();
}
AutoFillNotification* aWidget = new AutoFillNotification(frameUrl, formData, updateData);
page->view()->addNotification(aWidget);
m_lastNotification = aWidget;
m_lastNotificationPage = page;
}
// Returns all saved passwords on this page

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2016 David Rosca <nowrep@gmail.com>
* QupZilla - Qt web browser
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -19,6 +19,7 @@
#define AUTOFILL_H
#include <QObject>
#include <QPointer>
#include "qzcommon.h"
@ -28,6 +29,7 @@ class QWebEnginePage;
class WebPage;
class BrowserWindow;
class PasswordManager;
class AutoFillNotification;
struct PageFormData;
struct PasswordEntry;
@ -78,6 +80,8 @@ public:
private:
PasswordManager* m_manager;
bool m_isStoring;
QPointer<AutoFillNotification> m_lastNotification;
WebPage *m_lastNotificationPage = nullptr;
};