Rework the Account Popup Widget

Fixed Account Popup Widget Follow/Unfollow
Ignoring now also works, but doesn't have the ability to unignore

Add a URL Delete method to the network manager

Fixes #235
This commit is contained in:
Rasmus Karlsson
2018-01-18 18:20:40 +01:00
parent 1e7d3a2ec6
commit 702d4b2eec
10 changed files with 268 additions and 78 deletions
+25 -4
View File
@@ -28,7 +28,11 @@ public:
void setName(const QString &name);
void setChannel(SharedChannel _channel);
void updatePermissions();
public slots:
void actuallyRefreshButtons();
signals:
void refreshButtons();
protected:
virtual void dpiMultiplierChanged(float oldDpi, float newDpi) override;
@@ -44,16 +48,33 @@ private:
void timeout(QPushButton *button, int time);
void sendCommand(QPushButton *button, QString command);
enum class permissions { User, Mod, Owner };
permissions permission;
void refreshLayouts();
enum class UserType { User, Mod, Owner };
SharedChannel channel;
QString userID;
QPixmap avatar;
util::ConcurrentMap<QString, QPixmap> avatarMap;
struct User {
QString username;
QString userID;
UserType userType = UserType::User;
void refreshUserType(const SharedChannel &channel, bool loggedInUser);
};
User loggedInUser;
User popupWidgetUser;
struct {
bool following = false;
bool ignoring = false;
} relationship;
protected:
virtual void focusOutEvent(QFocusEvent *event) override;
virtual void showEvent(QShowEvent *event) override;