2018-07-20 12:02:35 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
class Avatar;
|
|
|
|
class FlatButton;
|
|
|
|
class QLabel;
|
|
|
|
class QListWidget;
|
2018-07-20 16:15:50 +03:00
|
|
|
class Toggle;
|
|
|
|
|
|
|
|
struct DeviceInfo
|
|
|
|
{
|
|
|
|
QString device_id;
|
|
|
|
QString display_name;
|
|
|
|
};
|
|
|
|
|
|
|
|
Q_DECLARE_METATYPE(std::vector<DeviceInfo>)
|
2018-07-20 12:02:35 +03:00
|
|
|
|
2018-08-11 13:50:56 +03:00
|
|
|
class Proxy : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void done(const QString &user_id, const std::vector<DeviceInfo> &devices);
|
|
|
|
};
|
|
|
|
|
2018-07-20 12:02:35 +03:00
|
|
|
namespace dialogs {
|
|
|
|
|
|
|
|
class DeviceItem : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2018-07-20 16:15:50 +03:00
|
|
|
explicit DeviceItem(DeviceInfo device, QWidget *parent);
|
2018-07-20 12:02:35 +03:00
|
|
|
|
|
|
|
private:
|
2018-07-20 16:15:50 +03:00
|
|
|
DeviceInfo info_;
|
2018-07-20 12:02:35 +03:00
|
|
|
|
|
|
|
// Toggle *verifyToggle_;
|
|
|
|
};
|
|
|
|
|
|
|
|
class UserProfile : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit UserProfile(QWidget *parent = nullptr);
|
|
|
|
|
|
|
|
void init(const QString &userId, const QString &roomId);
|
|
|
|
|
2018-07-20 16:15:50 +03:00
|
|
|
private slots:
|
2018-07-21 14:33:35 +03:00
|
|
|
void updateDeviceList(const QString &user_id, const std::vector<DeviceInfo> &devices);
|
2018-07-20 16:15:50 +03:00
|
|
|
|
2018-07-20 12:02:35 +03:00
|
|
|
private:
|
2018-07-21 14:33:35 +03:00
|
|
|
void resetToDefaults();
|
|
|
|
|
2018-07-20 12:02:35 +03:00
|
|
|
Avatar *avatar_;
|
|
|
|
|
|
|
|
QLabel *userIdLabel_;
|
|
|
|
QLabel *displayNameLabel_;
|
|
|
|
|
|
|
|
FlatButton *banBtn_;
|
|
|
|
FlatButton *kickBtn_;
|
|
|
|
FlatButton *ignoreBtn_;
|
|
|
|
FlatButton *startChat_;
|
|
|
|
|
2018-07-20 16:15:50 +03:00
|
|
|
QLabel *devicesLabel_;
|
2018-07-20 12:02:35 +03:00
|
|
|
QListWidget *devices_;
|
|
|
|
};
|
2018-07-20 16:15:50 +03:00
|
|
|
|
2018-07-20 12:02:35 +03:00
|
|
|
} // dialogs
|