summary refs log tree commit diff
path: root/include/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'include/dialogs')
-rw-r--r--include/dialogs/CreateRoom.h45
-rw-r--r--include/dialogs/ImageOverlay.h47
-rw-r--r--include/dialogs/InviteUsers.h42
-rw-r--r--include/dialogs/JoinRoom.h30
-rw-r--r--include/dialogs/LeaveRoom.h25
-rw-r--r--include/dialogs/Logout.h42
-rw-r--r--include/dialogs/MemberList.hpp61
-rw-r--r--include/dialogs/PreviewUploadOverlay.h61
-rw-r--r--include/dialogs/ReCaptcha.hpp28
-rw-r--r--include/dialogs/ReadReceipts.h58
-rw-r--r--include/dialogs/RoomSettings.hpp126
11 files changed, 0 insertions, 565 deletions
diff --git a/include/dialogs/CreateRoom.h b/include/dialogs/CreateRoom.h
deleted file mode 100644

index 46edebdc..00000000 --- a/include/dialogs/CreateRoom.h +++ /dev/null
@@ -1,45 +0,0 @@ -#pragma once - -#include <QFrame> - -#include <mtx.hpp> - -class FlatButton; -class TextField; -class QComboBox; -class Toggle; - -namespace dialogs { - -class CreateRoom : public QFrame -{ - Q_OBJECT -public: - CreateRoom(QWidget *parent = nullptr); - -signals: - void closing(bool isCreating, const mtx::requests::CreateRoom &request); - -protected: - void paintEvent(QPaintEvent *event) override; - void showEvent(QShowEvent *event) override; - -private: - void clearFields(); - - QComboBox *visibilityCombo_; - QComboBox *presetCombo_; - - Toggle *directToggle_; - - FlatButton *confirmBtn_; - FlatButton *cancelBtn_; - - TextField *nameInput_; - TextField *topicInput_; - TextField *aliasInput_; - - mtx::requests::CreateRoom request_; -}; - -} // dialogs diff --git a/include/dialogs/ImageOverlay.h b/include/dialogs/ImageOverlay.h deleted file mode 100644
index b4d42acb..00000000 --- a/include/dialogs/ImageOverlay.h +++ /dev/null
@@ -1,47 +0,0 @@ -/* - * nheko Copyright (C) 2017 Konstantinos Sideris <siderisk@auth.gr> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#pragma once - -#include <QDialog> -#include <QMouseEvent> -#include <QPixmap> - -namespace dialogs { - -class ImageOverlay : public QWidget -{ - Q_OBJECT -public: - ImageOverlay(QPixmap image, QWidget *parent = nullptr); - -protected: - void mousePressEvent(QMouseEvent *event) override; - void paintEvent(QPaintEvent *event) override; - -signals: - void closing(); - -private: - QPixmap originalImage_; - QPixmap image_; - - QRect content_; - QRect close_button_; - QRect screen_; -}; -} // dialogs diff --git a/include/dialogs/InviteUsers.h b/include/dialogs/InviteUsers.h deleted file mode 100644
index 41e6236a..00000000 --- a/include/dialogs/InviteUsers.h +++ /dev/null
@@ -1,42 +0,0 @@ -#pragma once - -#include <QFrame> -#include <QLabel> -#include <QListWidgetItem> -#include <QStringList> - -class FlatButton; -class TextField; -class QListWidget; - -namespace dialogs { - -class InviteUsers : public QFrame -{ - Q_OBJECT -public: - explicit InviteUsers(QWidget *parent = nullptr); - -protected: - void paintEvent(QPaintEvent *event) override; - void showEvent(QShowEvent *event) override; - -signals: - void closing(bool isLeaving, QStringList invitees); - -private slots: - void removeInvitee(QListWidgetItem *item); - -private: - void addUser(); - QStringList invitedUsers() const; - - FlatButton *confirmBtn_; - FlatButton *cancelBtn_; - - TextField *inviteeInput_; - QLabel *errorLabel_; - - QListWidget *inviteeList_; -}; -} // dialogs diff --git a/include/dialogs/JoinRoom.h b/include/dialogs/JoinRoom.h deleted file mode 100644
index 5919f08f..00000000 --- a/include/dialogs/JoinRoom.h +++ /dev/null
@@ -1,30 +0,0 @@ -#pragma once - -#include <QFrame> - -class FlatButton; -class TextField; - -namespace dialogs { - -class JoinRoom : public QFrame -{ - Q_OBJECT -public: - JoinRoom(QWidget *parent = nullptr); - -signals: - void closing(bool isJoining, const QString &room); - -protected: - void paintEvent(QPaintEvent *event) override; - void showEvent(QShowEvent *event) override; - -private: - FlatButton *confirmBtn_; - FlatButton *cancelBtn_; - - TextField *roomInput_; -}; - -} // dialogs diff --git a/include/dialogs/LeaveRoom.h b/include/dialogs/LeaveRoom.h deleted file mode 100644
index 98e4938d..00000000 --- a/include/dialogs/LeaveRoom.h +++ /dev/null
@@ -1,25 +0,0 @@ -#pragma once - -#include <QFrame> - -class FlatButton; - -namespace dialogs { - -class LeaveRoom : public QFrame -{ - Q_OBJECT -public: - explicit LeaveRoom(QWidget *parent = nullptr); - -protected: - void paintEvent(QPaintEvent *event) override; - -signals: - void closing(bool isLeaving); - -private: - FlatButton *confirmBtn_; - FlatButton *cancelBtn_; -}; -} // dialogs diff --git a/include/dialogs/Logout.h b/include/dialogs/Logout.h deleted file mode 100644
index cfefb970..00000000 --- a/include/dialogs/Logout.h +++ /dev/null
@@ -1,42 +0,0 @@ -/* - * nheko Copyright (C) 2017 Konstantinos Sideris <siderisk@auth.gr> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#pragma once - -#include <QFrame> - -class FlatButton; - -namespace dialogs { - -class Logout : public QFrame -{ - Q_OBJECT -public: - explicit Logout(QWidget *parent = nullptr); - -protected: - void paintEvent(QPaintEvent *event) override; - -signals: - void closing(bool isLoggingOut); - -private: - FlatButton *confirmBtn_; - FlatButton *cancelBtn_; -}; -} // dialogs diff --git a/include/dialogs/MemberList.hpp b/include/dialogs/MemberList.hpp deleted file mode 100644
index 9c3dc5dc..00000000 --- a/include/dialogs/MemberList.hpp +++ /dev/null
@@ -1,61 +0,0 @@ -#pragma once - -#include <QFrame> -#include <QListWidget> - -class Avatar; -class FlatButton; -class QHBoxLayout; -class QLabel; -class QVBoxLayout; - -struct RoomMember; - -template<class T> -class QSharedPointer; - -namespace dialogs { - -class MemberItem : public QWidget -{ - Q_OBJECT - -public: - MemberItem(const RoomMember &member, QWidget *parent); - -private: - QHBoxLayout *topLayout_; - QVBoxLayout *textLayout_; - - Avatar *avatar_; - - QLabel *userName_; - QLabel *userId_; -}; - -class MemberList : public QFrame -{ - Q_OBJECT -public: - MemberList(const QString &room_id, QWidget *parent = nullptr); - -public slots: - void addUsers(const std::vector<RoomMember> &users); - -protected: - void paintEvent(QPaintEvent *event) override; - void hideEvent(QHideEvent *event) override - { - list_->clear(); - QFrame::hideEvent(event); - } - -private: - void moveButtonToBottom(); - - QString room_id_; - QLabel *topLabel_; - QListWidget *list_; - FlatButton *moreBtn_; -}; -} // dialogs diff --git a/include/dialogs/PreviewUploadOverlay.h b/include/dialogs/PreviewUploadOverlay.h deleted file mode 100644
index 48795ca0..00000000 --- a/include/dialogs/PreviewUploadOverlay.h +++ /dev/null
@@ -1,61 +0,0 @@ -/* - * nheko Copyright (C) 2017 Konstantinos Sideris <siderisk@auth.gr> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#pragma once - -#include <QLabel> -#include <QLineEdit> -#include <QPixmap> -#include <QWidget> - -#include "FlatButton.h" - -class QMimeData; - -namespace dialogs { - -class PreviewUploadOverlay : public QWidget -{ - Q_OBJECT -public: - PreviewUploadOverlay(QWidget *parent = nullptr); - - void setPreview(const QByteArray data, const QString &mime); - void setPreview(const QString &path); - -signals: - void confirmUpload(const QByteArray data, const QString &media, const QString &filename); - -private: - void init(); - void setLabels(const QString &type, const QString &mime, uint64_t upload_size); - - bool isImage_; - QPixmap image_; - - QByteArray data_; - QString filePath_; - QString mediaType_; - - QLabel titleLabel_; - QLabel infoLabel_; - QLineEdit fileName_; - - FlatButton upload_; - FlatButton cancel_; -}; -} // dialogs diff --git a/include/dialogs/ReCaptcha.hpp b/include/dialogs/ReCaptcha.hpp deleted file mode 100644
index 5f47b0eb..00000000 --- a/include/dialogs/ReCaptcha.hpp +++ /dev/null
@@ -1,28 +0,0 @@ -#pragma once - -#include <QWidget> - -class FlatButton; -class RaisedButton; - -namespace dialogs { - -class ReCaptcha : public QWidget -{ - Q_OBJECT - -public: - ReCaptcha(const QString &session, QWidget *parent = nullptr); - -protected: - void paintEvent(QPaintEvent *event) override; - -signals: - void closing(); - -private: - FlatButton *openCaptchaBtn_; - RaisedButton *confirmBtn_; - RaisedButton *cancelBtn_; -}; -} // dialogs diff --git a/include/dialogs/ReadReceipts.h b/include/dialogs/ReadReceipts.h deleted file mode 100644
index 5e5615df..00000000 --- a/include/dialogs/ReadReceipts.h +++ /dev/null
@@ -1,58 +0,0 @@ -#pragma once - -#include <QDateTime> -#include <QFrame> -#include <QHBoxLayout> -#include <QLabel> -#include <QListWidget> -#include <QVBoxLayout> - -class Avatar; - -namespace dialogs { - -class ReceiptItem : public QWidget -{ - Q_OBJECT - -public: - ReceiptItem(QWidget *parent, - const QString &user_id, - uint64_t timestamp, - const QString &room_id); - -private: - QString dateFormat(const QDateTime &then) const; - - QHBoxLayout *topLayout_; - QVBoxLayout *textLayout_; - - Avatar *avatar_; - - QLabel *userName_; - QLabel *timestamp_; -}; - -class ReadReceipts : public QFrame -{ - Q_OBJECT -public: - explicit ReadReceipts(QWidget *parent = nullptr); - -public slots: - void addUsers(const std::multimap<uint64_t, std::string, std::greater<uint64_t>> &users); - -protected: - void paintEvent(QPaintEvent *event) override; - void hideEvent(QHideEvent *event) override - { - userList_->clear(); - QFrame::hideEvent(event); - } - -private: - QLabel *topLabel_; - - QListWidget *userList_; -}; -} // dialogs 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 <QFrame> -#include <QImage> - -#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 T> -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