summaryrefslogtreecommitdiff
path: root/ui/qt5/useraccountwidget.hh
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-29 17:18:58 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-29 17:18:58 -0600
commitc6771c06689dfb49b8050e99b9c3572c27a8cb3e (patch)
treefa7a5d1c9fe7dddcb1478d3ebe6d22babe1c2300 /ui/qt5/useraccountwidget.hh
parentb9fad79ccf775de757997f532a45d6c300ae2a73 (diff)
downloadhorizon-c6771c06689dfb49b8050e99b9c3572c27a8cb3e.tar.gz
horizon-c6771c06689dfb49b8050e99b9c3572c27a8cb3e.tar.bz2
horizon-c6771c06689dfb49b8050e99b9c3572c27a8cb3e.tar.xz
horizon-c6771c06689dfb49b8050e99b9c3572c27a8cb3e.zip
Qt UI: Add Accounts page, still in progress
Diffstat (limited to 'ui/qt5/useraccountwidget.hh')
-rw-r--r--ui/qt5/useraccountwidget.hh57
1 files changed, 57 insertions, 0 deletions
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 <QCheckBox>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QWidget>
+
+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 */