calamares/src/modules/users/UsersPage.h

86 lines
2.4 KiB
C
Raw Normal View History

/* === This file is part of Calamares - <https://github.com/calamares> ===
2014-07-31 14:52:05 +02:00
*
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
2014-07-31 14:52:05 +02:00
*
* Portions from the Manjaro Installation Framework
* by Roland Singer <roland@manjaro.org>
* Copyright (C) 2007 Free Software Foundation, Inc.
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef USERSPAGE_H
#define USERSPAGE_H
#include <QWidget>
class Config;
class QLabel;
namespace Ui
{
2014-07-31 14:52:05 +02:00
class Page_UserSetup;
}
class UsersPage : public QWidget
{
Q_OBJECT
public:
explicit UsersPage( Config* config, QWidget* parent = nullptr );
2014-07-31 14:52:05 +02:00
virtual ~UsersPage();
bool isReady() const;
2014-07-31 14:52:05 +02:00
void fillGlobalStorage() const;
void onActivate();
2014-07-31 14:52:05 +02:00
protected slots:
void onFullNameTextEdited( const QString& );
void reportLoginNameStatus( const QString& );
void reportHostNameStatus( const QString& );
2014-07-31 14:52:05 +02:00
void onPasswordTextChanged( const QString& );
void onRootPasswordTextChanged( const QString& );
void onReuseUserPasswordChanged( const int );
2014-07-31 14:52:05 +02:00
signals:
void checkReady( bool );
private:
/// @brief Which password are we talking about? (for checkPasswordAcceptance())
enum class Password { Root, User };
/** @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( Password p, QLabel* badge, QLabel* message );
void retranslate();
2014-07-31 14:52:05 +02:00
Ui::Page_UserSetup* ui;
Config* m_config;
bool m_readyFullName;
2014-07-31 14:52:05 +02:00
bool m_readyUsername;
bool m_readyHostname;
bool m_readyPassword;
bool m_readyRootPassword;
};
#endif // USERSPAGE_H