forked from blue/squawk
SimpleCrypt password jamming is now optional
This commit is contained in:
parent
85ff6c25ba
commit
9a44ae1fa5
6 changed files with 62 additions and 39 deletions
|
@ -26,6 +26,7 @@ Account::Account():
|
|||
m_ui->setupUi(this);
|
||||
|
||||
connect(m_ui->passwordType, qOverload<int>(&QComboBox::currentIndexChanged), this, &Account::onComboboxChange);
|
||||
QStandardItemModel *model = static_cast<QStandardItemModel*>(m_ui->passwordType->model());
|
||||
|
||||
for (int i = static_cast<int>(Shared::AccountPasswordLowest); i < static_cast<int>(Shared::AccountPasswordHighest) + 1; ++i) {
|
||||
Shared::AccountPassword ap = static_cast<Shared::AccountPassword>(i);
|
||||
|
@ -34,18 +35,19 @@ Account::Account():
|
|||
m_ui->passwordType->setCurrentIndex(static_cast<int>(Shared::AccountPassword::plain));
|
||||
|
||||
if (!Shared::Global::supported("KWallet")) {
|
||||
QStandardItemModel *model = static_cast<QStandardItemModel*>(m_ui->passwordType->model());
|
||||
QStandardItem *item = model->item(static_cast<int>(Shared::AccountPassword::kwallet));
|
||||
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
|
||||
}
|
||||
|
||||
if (!Shared::Global::supported("simpleCryptJammedPassword")) {
|
||||
QStandardItem *item = model->item(static_cast<int>(Shared::AccountPassword::jammed));
|
||||
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
Account::~Account()
|
||||
{
|
||||
}
|
||||
Account::~Account() {}
|
||||
|
||||
QMap<QString, QVariant> Account::value() const
|
||||
{
|
||||
QMap<QString, QVariant> Account::value() const {
|
||||
QMap<QString, QVariant> map;
|
||||
map["login"] = m_ui->login->text();
|
||||
map["password"] = m_ui->password->text();
|
||||
|
@ -58,13 +60,11 @@ QMap<QString, QVariant> Account::value() const
|
|||
return map;
|
||||
}
|
||||
|
||||
void Account::lockId()
|
||||
{
|
||||
void Account::lockId() {
|
||||
m_ui->name->setReadOnly(true);;
|
||||
}
|
||||
|
||||
void Account::setData(const QMap<QString, QVariant>& data)
|
||||
{
|
||||
void Account::setData(const QMap<QString, QVariant>& data) {
|
||||
m_ui->login->setText(data.value("login").toString());
|
||||
m_ui->password->setText(data.value("password").toString());
|
||||
m_ui->server->setText(data.value("server").toString());
|
||||
|
@ -73,8 +73,7 @@ void Account::setData(const QMap<QString, QVariant>& data)
|
|||
m_ui->passwordType->setCurrentIndex(data.value("passwordType").toInt());
|
||||
}
|
||||
|
||||
void Account::onComboboxChange(int index)
|
||||
{
|
||||
void Account::onComboboxChange(int index) {
|
||||
QString description = Shared::Global::getDescription(Shared::Global::fromInt<Shared::AccountPassword>(index));
|
||||
m_ui->comment->setText(description);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue