From c6771c06689dfb49b8050e99b9c3572c27a8cb3e Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Fri, 29 Nov 2019 17:18:58 -0600 Subject: Qt UI: Add Accounts page, still in progress --- ui/qt5/useraccountwidget.hh | 57 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 ui/qt5/useraccountwidget.hh (limited to 'ui/qt5/useraccountwidget.hh') diff --git a/ui/qt5/useraccountwidget.hh b/ui/qt5/useraccountwidget.hh new file mode 100644 index 0000000..71a23b7 --- /dev/null +++ b/ui/qt5/useraccountwidget.hh @@ -0,0 +1,57 @@ +/* + * useraccountwidget.cc - Implementation of a widget for managing user accounts + * horizon-qt5, the Qt 5 user interface for + * Project Horizon + * + * Copyright (c) 2019 Adélie Linux and contributors. All rights reserved. + * This code is licensed under the AGPL 3.0 license, as noted in the + * LICENSE-code file in the root directory of this repository. + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +#ifndef USERACCOUNTWIDGET_HH +#define USERACCOUNTWIDGET_HH + +#include +#include +#include +#include + +class UserAccountWidget : public QWidget { + Q_OBJECT +public: + /*! Constructs a new User Account widget. */ + UserAccountWidget(QWidget *parent = nullptr); + + /*! Returns the current text in the Account Name text entry. */ + QString accountText(void) const; + /*! Sets the current text in the Account Name text entry. */ + void setAccountText(QString); + /*! Returns the current text in the passphrase entry. */ + QString passphraseText(void) const; + /*! Returns the current text in the Personal Name text entry. */ + QString personalText(void) const; + /*! Sets the current text in the Personal Name text entry. */ + void setPersonalText(QString); + + /*! Returns whether the Admin tickbox is ticked or not. */ + bool isAdmin(void) const; + /*! Changes whether the Admin tickbox is ticked or not. */ + void setAdmin(bool); + + /*! Returns whether the widget defines a valid account. */ + bool isValid(void) const; +signals: + void validityChanged(); +private: + QLineEdit *accountName; + QLineEdit *personalName; + QLineEdit *passphrase; + QPushButton *aviButton; + QCheckBox *adminTick; + /*! When set, auto-update of accountName from personalName is prevented. */ + bool acctEverTouched; +}; + +#endif /* !USERACCOUNTWIDGET_HH */ -- cgit v1.2.3-60-g2f50