12#include <QInputDialog>
30 <<
"invalid result for key"
37 case QVariant::String:
40 return result.toList ().value (0).toString ();
41 case QVariant::StringList:
42 return result.toStringList ().value (0);
45 <<
"unknown result type"
65 const auto&
result = QInputDialog::getText (
nullptr,
91 dialog->setInputMode (QInputDialog::TextInput);
94 dialog->setTextEchoMode (QLineEdit::Password);
95 dialog->setAttribute (Qt::WA_DeleteOnClose);
101 &QObject::deleteLater);
108 if (
r == QDialog::Rejected ||
value.isEmpty ())
Interface for plugins providing persistent (and possibly secure) storage.
A peir of two functions, typically a continuation and an error handler.
std::shared_ptr< ICoreProxy > ICoreProxy_ptr
Container< T > Filter(const Container< T > &c, F f)
QVariant GetPersistentData(const QByteArray &key, const ICoreProxy_ptr &proxy)
Returns persistent data stored under given key.
void SavePassword(const QString &password, const QString &key, const ICoreProxy_ptr &proxy)
Saves the password to be retrieved later via GetPassword().
QString GetPassword(const QString &key, const QString &diaText, const ICoreProxy_ptr &proxy, bool useStored)
Returns password for the key, possibly asking the user.