mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Fix bug with initial password dialogs accepting empty passwords
This commit is contained in:
parent
dea2ccf0b7
commit
18e875ef20
|
@ -1269,11 +1269,20 @@ QString Widget::passwordDialog(const QString& cancel, const QString& body)
|
||||||
dialog.setInputMode(QInputDialog::TextInput);
|
dialog.setInputMode(QInputDialog::TextInput);
|
||||||
dialog.setTextEchoMode(QLineEdit::Password);
|
dialog.setTextEchoMode(QLineEdit::Password);
|
||||||
dialog.setLabelText(body);
|
dialog.setLabelText(body);
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
int val = dialog.exec();
|
int val = dialog.exec();
|
||||||
if (val == QDialog::Accepted)
|
if (val != QDialog::Accepted)
|
||||||
|
return QString();
|
||||||
|
else
|
||||||
|
{
|
||||||
ret = dialog.textValue();
|
ret = dialog.textValue();
|
||||||
|
if (!ret.isEmpty())
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
dialog.setLabelText(body + "\n" + tr("You must enter a non-empty password."));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::clearAllReceipts()
|
void Widget::clearAllReceipts()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user