mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-05 05:31:11 -04:00
Adding a GUI prompt for password. (#587)
This commit is contained in:
parent
a75746c7c1
commit
c3bd5d21aa
6 changed files with 64 additions and 20 deletions
|
@ -18,6 +18,7 @@
|
|||
#include "Database.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QTimer>
|
||||
#include <QXmlStreamReader>
|
||||
|
||||
|
@ -396,3 +397,17 @@ Database* Database::openDatabaseFile(QString fileName, CompositeKey key)
|
|||
return db;
|
||||
|
||||
}
|
||||
|
||||
Database* Database::unlockFromStdin(QString databaseFilename)
|
||||
{
|
||||
static QTextStream inputTextStream(stdin, QIODevice::ReadOnly);
|
||||
QTextStream outputTextStream(stdout);
|
||||
|
||||
outputTextStream << QString("Insert password to unlock " + databaseFilename + "\n>");
|
||||
outputTextStream.flush();
|
||||
|
||||
QString line = inputTextStream.readLine();
|
||||
CompositeKey key = CompositeKey::readFromLine(line);
|
||||
return Database::openDatabaseFile(databaseFilename, key);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue