Skip to content

Commit

Permalink
Added tooltip for more information
Browse files Browse the repository at this point in the history
  • Loading branch information
JJuiice committed May 30, 2020
1 parent 92953f5 commit cae9596
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/gui/entry/EntryModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,29 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const
if (index.column() == Paperclip) {
return Qt::AlignCenter;
}
} else if (role == Qt::ToolTipRole) {
if (index.column() == PasswordStrength) {
PasswordHealth health(entry->password());
QString quality;

switch (health.quality()) {
case PasswordHealth::Quality::Bad:
case PasswordHealth::Quality::Poor:
quality = tr("Poor");
break;
case PasswordHealth::Quality::Weak:
quality = tr("Weak");
break;
case PasswordHealth::Quality::Good:
quality = tr("Good");
break;
case PasswordHealth::Quality::Excellent:
quality = tr("Excellent");
break;
}

return quality;
}
}

return QVariant();
Expand Down

0 comments on commit cae9596

Please sign in to comment.