servatrice/cockatrice/src/userinfobox.h
ebbit1q c874f201c3 add a bunch of parents to dialogs (#3658)
* add a bunch of parents to dialogs

works on #3651

* use game as parent instead

* add more parents

* fix create token dialog modality

* add parent to game information window

* replace a bunch of nullptrs with the magic of sed

* add parent to tip of the day and counters

* reorder game ptr

* set parent for life counter

* clangify
2019-03-26 14:54:47 -04:00

40 lines
1.1 KiB
C++

#ifndef USERINFOBOX_H
#define USERINFOBOX_H
#include <QLabel>
#include <QPushButton>
#include <QWidget>
class ServerInfo_User;
class AbstractClient;
class Response;
class UserInfoBox : public QWidget
{
Q_OBJECT
private:
AbstractClient *client;
bool editable;
QLabel avatarLabel, nameLabel, realNameLabel1, realNameLabel2, countryLabel1, countryLabel2, countryLabel3,
userLevelLabel1, userLevelLabel2, userLevelLabel3, accountAgeLebel1, accountAgeLabel2;
QPushButton editButton, passwordButton, avatarButton;
public:
UserInfoBox(AbstractClient *_client, bool editable, QWidget *parent = nullptr, Qt::WindowFlags flags = 0);
void retranslateUi();
private slots:
void processResponse(const Response &r);
void processEditResponse(const Response &r);
void processPasswordResponse(const Response &r);
void processAvatarResponse(const Response &r);
void actEdit();
void actEditInternal(const Response &r);
void actPassword();
void actAvatar();
public slots:
void updateInfo(const ServerInfo_User &user);
void updateInfo(const QString &userName);
};
#endif