From 0e814da91c8e041897a4c3f7e6e9234bbc7c6f7a Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Tue, 17 Jul 2018 16:37:25 +0300 Subject: Move all files under src/ --- include/dialogs/RoomSettings.hpp | 126 --------------------------------------- 1 file changed, 126 deletions(-) delete mode 100644 include/dialogs/RoomSettings.hpp (limited to 'include/dialogs/RoomSettings.hpp') diff --git a/include/dialogs/RoomSettings.hpp b/include/dialogs/RoomSettings.hpp deleted file mode 100644 index 6cab03b7..00000000 --- a/include/dialogs/RoomSettings.hpp +++ /dev/null @@ -1,126 +0,0 @@ -#pragma once - -#include -#include - -#include "Cache.h" - -class Avatar; -class FlatButton; -class QComboBox; -class QHBoxLayout; -class QLabel; -class QLabel; -class QLayout; -class QPixmap; -class TextField; -class TextField; -class Toggle; - -template -class QSharedPointer; - -class EditModal : public QWidget -{ - Q_OBJECT - -public: - EditModal(const QString &roomId, QWidget *parent = nullptr); - - void setFields(const QString &roomName, const QString &roomTopic); - -signals: - void nameChanged(const QString &roomName); - void nameEventSentCb(const QString &newName); - void topicEventSentCb(); - void stateEventErrorCb(const QString &msg); - -private: - QString roomId_; - QString initialName_; - QString initialTopic_; - - QLabel *errorField_; - - TextField *nameInput_; - TextField *topicInput_; - - FlatButton *applyBtn_; - FlatButton *cancelBtn_; -}; - -class TopSection : public QWidget -{ - Q_OBJECT - - Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor) - -public: - TopSection(const RoomInfo &info, const QImage &img, QWidget *parent = nullptr); - QSize sizeHint() const override; - void setRoomName(const QString &name); - - QColor textColor() const { return textColor_; } - void setTextColor(QColor &color) { textColor_ = color; } - -protected: - void paintEvent(QPaintEvent *event) override; - -private: - static constexpr int AvatarSize = 72; - static constexpr int Padding = 5; - - RoomInfo info_; - QPixmap avatar_; - QColor textColor_; -}; - -namespace dialogs { - -class RoomSettings : public QFrame -{ - Q_OBJECT -public: - RoomSettings(const QString &room_id, QWidget *parent = nullptr); - -signals: - void closing(); - void enableEncryptionError(const QString &msg); - -protected: - void paintEvent(QPaintEvent *event) override; - -private slots: - void saveSettings(); - -private: - static constexpr int AvatarSize = 64; - - void setAvatar(const QImage &img) { avatarImg_ = img; } - void setupEditButton(); - //! Retrieve the current room information from cache. - void retrieveRoomInfo(); - void enableEncryption(); - - //! Whether the user would be able to change the name or the topic of the room. - bool hasEditRights_ = true; - bool usesEncryption_ = false; - QHBoxLayout *editLayout_; - - // Button section - FlatButton *okBtn_; - FlatButton *cancelBtn_; - - FlatButton *editFieldsBtn_; - - RoomInfo info_; - QString room_id_; - QImage avatarImg_; - - TopSection *topSection_; - - QComboBox *accessCombo; - Toggle *encryptionToggle_; -}; - -} // dialogs -- cgit 1.5.1