summary refs log tree commit diff
path: root/src/dialogs/UserProfile.h
diff options
context:
space:
mode:
authorCH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com>2020-08-30 22:27:14 +0530
committerCH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com>2020-08-30 22:27:14 +0530
commitb174bd938084a60fde5030dfc4dd0067a39f5a3f (patch)
tree6f2bb24fb2ba01adb2957aea67aecda501aa41ac /src/dialogs/UserProfile.h
parentChange the tag for mtxclient (diff)
parentMerge pull request #265 from trilene/voip (diff)
downloadnheko-b174bd938084a60fde5030dfc4dd0067a39f5a3f.tar.xz
Merge remote-tracking branch 'upstream/master' into device-verification
Diffstat (limited to 'src/dialogs/UserProfile.h')
-rw-r--r--src/dialogs/UserProfile.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/dialogs/UserProfile.h b/src/dialogs/UserProfile.h
new file mode 100644

index 00000000..8129fdcf --- /dev/null +++ b/src/dialogs/UserProfile.h
@@ -0,0 +1,70 @@ +#pragma once + +#include <QString> +#include <QWidget> + +class Avatar; +class FlatButton; +class QLabel; +class QListWidget; +class Toggle; + +struct DeviceInfo +{ + QString device_id; + QString display_name; +}; + +class Proxy : public QObject +{ + Q_OBJECT + +signals: + void done(const QString &user_id, const std::vector<DeviceInfo> &devices); +}; + +namespace dialogs { + +class DeviceItem : public QWidget +{ + Q_OBJECT + +public: + explicit DeviceItem(DeviceInfo device, QWidget *parent); + +private: + DeviceInfo info_; + + // Toggle *verifyToggle_; +}; + +class UserProfile : public QWidget +{ + Q_OBJECT +public: + explicit UserProfile(QWidget *parent = nullptr); + + void init(const QString &userId, const QString &roomId); + +private slots: + void updateDeviceList(const QString &user_id, const std::vector<DeviceInfo> &devices); + +private: + void resetToDefaults(); + + Avatar *avatar_; + QString roomId_; + + QLabel *userIdLabel_; + QLabel *displayNameLabel_; + + FlatButton *banBtn_; + FlatButton *kickBtn_; + FlatButton *ignoreBtn_; + FlatButton *startChat_; + + QLabel *devicesLabel_; + QListWidget *devices_; +}; + +} // dialogs