Commit 5986ffbb authored by Jan Grulich's avatar Jan Grulich

PasswordField: add option to hide AlwaysAsk mode

parent dfbcf8b1
......@@ -95,6 +95,21 @@ void PasswordField::setPasswordOptionsEnabled(bool enable)
}
}
void PasswordField::setPasswordNotSavedEnabled(bool enable)
{
if (enable) {
const int index = m_passwordOptionsMenu->findData(AlwaysAsk);
if (index == -1) {
m_passwordOptionsMenu->addItem(QIcon::fromTheme(QStringLiteral("dialog-messages")), i18n("Ask for this password every time"), AlwaysAsk);
}
} else {
const int index = m_passwordOptionsMenu->findData(AlwaysAsk);
if (index != -1) {
m_passwordOptionsMenu->removeItem(index);
}
}
}
void PasswordField::setPasswordNotRequiredEnabled(bool enable)
{
if (enable) {
......
......@@ -43,6 +43,7 @@ public:
void setMaxLength(int maxLength);
void setPasswordModeEnabled(bool passwordMode);
void setPasswordOptionsEnabled(bool enable);
void setPasswordNotSavedEnabled(bool enable);
void setPasswordNotRequiredEnabled(bool enable);
PasswordOption passwordOption() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment