mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-27 00:35:27 -04:00
Launch KeePassXC password generator popup from the extension
* Closes #6473
This commit is contained in:
parent
2a9d92faeb
commit
dd41f093e6
8 changed files with 66 additions and 341 deletions
|
@ -311,6 +311,34 @@ QString BrowserService::getCurrentTotp(const QString& uuid)
|
|||
return {};
|
||||
}
|
||||
|
||||
void BrowserService::showPasswordGenerator(const QJsonObject& errorMessage, const QString& nonce)
|
||||
{
|
||||
if (!m_passwordGenerator) {
|
||||
m_passwordGenerator.reset(PasswordGeneratorWidget::popupGenerator());
|
||||
|
||||
connect(m_passwordGenerator.data(), &PasswordGeneratorWidget::closed, m_passwordGenerator.data(), [=] {
|
||||
m_passwordGenerator.reset();
|
||||
m_browserHost->sendClientMessage(errorMessage);
|
||||
hideWindow();
|
||||
});
|
||||
|
||||
connect(m_passwordGenerator.data(),
|
||||
&PasswordGeneratorWidget::appliedPassword,
|
||||
m_passwordGenerator.data(),
|
||||
[=](const QString& password) { emit passwordGenerated(password, nonce); });
|
||||
}
|
||||
|
||||
raiseWindow();
|
||||
m_passwordGenerator->raise();
|
||||
m_passwordGenerator->activateWindow();
|
||||
}
|
||||
|
||||
void BrowserService::sendPassword(const QJsonObject& message)
|
||||
{
|
||||
m_browserHost->sendClientMessage(message);
|
||||
hideWindow();
|
||||
}
|
||||
|
||||
QString BrowserService::storeKey(const QString& key)
|
||||
{
|
||||
auto db = getDatabase();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue