summaryrefslogtreecommitdiff
path: root/ui/qt5/useraccountwidget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt5/useraccountwidget.cc')
-rw-r--r--ui/qt5/useraccountwidget.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/qt5/useraccountwidget.cc b/ui/qt5/useraccountwidget.cc
index 9151572..72afc37 100644
--- a/ui/qt5/useraccountwidget.cc
+++ b/ui/qt5/useraccountwidget.cc
@@ -12,6 +12,7 @@
#include "useraccountwidget.hh"
+#include "avatardialog.hh"
#include <QAction>
#include <QHBoxLayout>
#include <QMenu>
@@ -78,6 +79,14 @@ UserAccountWidget::UserAccountWidget(QWidget *parent)
aviButton->setIconSize(QSize(32, 32));
aviButton->setToolTip(tr("Change this user's avatar"));
aviButton->setWhatsThis(tr("Allows you to choose the user's avatar, which will be shown on the log in screen."));
+ connect(aviButton, &QPushButton::clicked, [=]{
+ AvatarDialog *d = new AvatarDialog;
+ if(d->exec() == QDialog::Accepted) {
+ aviPath = d->avatar();
+ aviButton->setIcon(QPixmap(aviPath));
+ }
+ d->deleteLater();
+ });
overallLayout->addWidget(aviButton);
overallLayout->addLayout(detailLayout);
@@ -127,6 +136,10 @@ void UserAccountWidget::setAccountText(QString account) {
accountName->textEdited(account);
}
+QString UserAccountWidget::avatarPath() const {
+ return aviPath;
+}
+
QString UserAccountWidget::passphraseText(void) const {
return passphrase->text();
}