mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
adf3ff3075
cstdint) Make MessageElement to a class to fit better with the derived classes. Make MessageLayoutElement to a class to fit better with the derived classes. Remove virtual from override functions Replace all instances of boost::signals2 with pajlada::Signals. This lets us properly use clang code model to check for issues. Add missing virtual destructor to AbstractIrcServer Add missing virtual destructor to MessageLayoutElement Remove unused "connectedConnection" connection in TwitchChannel Fix typo in TrimChannelName function Fix typo in MessageParseArgs Replace some raw pointers with unique pointers where it made more sense. This allowed us to remove some manually written destructors whose only purpose was to delete that raw pointer. Reformat: Add namespace comments Reformat: Add empty empty lines between main namespace beginning and end Reformat: Re-order includes Reformat: Fix some includes that used quotes where they should use angle brackets Reformat: Replace some typedef's with using's Filter out more useless warnings
85 lines
1.6 KiB
C++
85 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include "basewindow.hpp"
|
|
#include "providers/twitch/twitchchannel.hpp"
|
|
#include "util/concurrentmap.hpp"
|
|
|
|
#include <QPushButton>
|
|
#include <QWidget>
|
|
|
|
#include <memory>
|
|
|
|
namespace Ui {
|
|
class AccountPopup;
|
|
} // namespace Ui
|
|
|
|
namespace chatterino {
|
|
|
|
class Channel;
|
|
|
|
namespace widgets {
|
|
|
|
class AccountPopupWidget : public BaseWindow
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
AccountPopupWidget(ChannelPtr _channel);
|
|
|
|
void setName(const QString &name);
|
|
void setChannel(ChannelPtr _channel);
|
|
|
|
public slots:
|
|
void actuallyRefreshButtons();
|
|
|
|
signals:
|
|
void refreshButtons();
|
|
|
|
protected:
|
|
void scaleChangedEvent(float newDpi) override;
|
|
|
|
private:
|
|
Ui::AccountPopup *ui;
|
|
|
|
void getUserId();
|
|
void getUserData();
|
|
void loadAvatar(const QUrl &avatarUrl);
|
|
|
|
void updateButtons(QWidget *layout, bool state);
|
|
void timeout(QPushButton *button, int time);
|
|
void sendCommand(QPushButton *button, QString command);
|
|
|
|
void refreshLayouts();
|
|
|
|
enum class UserType { User, Mod, Owner };
|
|
|
|
ChannelPtr channel;
|
|
|
|
QPixmap avatar;
|
|
|
|
util::ConcurrentMap<QString, QPixmap> avatarMap;
|
|
|
|
struct User {
|
|
QString username;
|
|
QString userID;
|
|
UserType userType = UserType::User;
|
|
|
|
void refreshUserType(const ChannelPtr &channel, bool loggedInUser);
|
|
};
|
|
|
|
User loggedInUser;
|
|
|
|
User popupWidgetUser;
|
|
|
|
struct {
|
|
bool following = false;
|
|
bool ignoring = false;
|
|
} relationship;
|
|
|
|
protected:
|
|
void focusOutEvent(QFocusEvent *event) override;
|
|
void showEvent(QShowEvent *event) override;
|
|
};
|
|
|
|
} // namespace widgets
|
|
} // namespace chatterino
|