[users] Refactor password-validation

- add a method that does the work and sets UI strings for a
   generic double-field password entry
 - use that for user and root passwords
This commit is contained in:
Adriaan de Groot 2019-11-01 13:38:14 +01:00
parent 7d25173afb
commit 9fa817a244
2 changed files with 34 additions and 56 deletions

View file

@ -29,6 +29,8 @@
#include <QWidget>
class QLabel;
namespace Ui
{
class Page_UserSetup;
@ -75,6 +77,14 @@ signals:
void checkReady( bool );
private:
/** @brief Is the password acceptable?
*
* Checks the two copies of the password and places error messages in the
* given QLabels. Returns true (and clears the error messages) if the
* password is acceptable.
*/
bool checkPasswordAcceptance( const QString& pw1, const QString& pw2, QLabel* badge, QLabel* message );
Ui::Page_UserSetup* ui;
PasswordCheckList m_passwordChecks;