diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-03-04 13:40:30 +0200 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-03-04 13:40:30 +0200 |
commit | b15a04b00a7e43301ce39fad58713920113efed0 (patch) | |
tree | b14067f11fc5b2f9b75905818a045e83134e4d03 /include | |
parent | Retry initial sync forever (#234) (diff) | |
download | nheko-b15a04b00a7e43301ce39fad58713920113efed0.tar.xz |
Don't open room switcher when another dialog is open
fixes #251
Diffstat (limited to 'include')
-rw-r--r-- | include/MainWindow.h | 31 | ||||
-rw-r--r-- | include/SideBarActions.h | 15 | ||||
-rw-r--r-- | include/TopRoomBar.h | 6 | ||||
-rw-r--r-- | include/UserInfoWidget.h | 8 |
4 files changed, 36 insertions, 24 deletions
diff --git a/include/MainWindow.h b/include/MainWindow.h index 3aba736e..0c2587e1 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -35,8 +35,18 @@ class SnackBar; class TrayIcon; class UserSettings; +namespace mtx { +namespace requests { +struct CreateRoom; +} +} + namespace dialogs { +class CreateRoom; +class InviteUsers; +class JoinRoom; class LeaveRoom; +class Logout; } class MainWindow : public QMainWindow @@ -50,6 +60,11 @@ public: void saveCurrentWindowSize(); void openLeaveRoomDialog(const QString &room_id = ""); + void openInviteUsersDialog(std::function<void(const QStringList &invitees)> callback); + void openCreateRoomDialog( + std::function<void(const mtx::requests::CreateRoom &request)> callback); + void openJoinRoomDialog(std::function<void(const QString &room_id)> callback); + void openLogoutDialog(std::function<void()> callback); protected: void closeEvent(QCloseEvent *event); @@ -113,4 +128,20 @@ private: QSharedPointer<OverlayModal> leaveRoomModal_; //! Leave room dialog. QSharedPointer<dialogs::LeaveRoom> leaveRoomDialog_; + //! Invite users modal. + QSharedPointer<OverlayModal> inviteUsersModal_; + //! Invite users dialog. + QSharedPointer<dialogs::InviteUsers> inviteUsersDialog_; + //! Join room modal. + QSharedPointer<OverlayModal> joinRoomModal_; + //! Join room dialog. + QSharedPointer<dialogs::JoinRoom> joinRoomDialog_; + //! Create room modal. + QSharedPointer<OverlayModal> createRoomModal_; + //! Create room dialog. + QSharedPointer<dialogs::CreateRoom> createRoomDialog_; + //! Logout modal. + QSharedPointer<OverlayModal> logoutModal_; + //! Logout dialog. + QSharedPointer<dialogs::Logout> logoutDialog_; }; diff --git a/include/SideBarActions.h b/include/SideBarActions.h index 4b3be213..763f3b2d 100644 --- a/include/SideBarActions.h +++ b/include/SideBarActions.h @@ -8,10 +8,11 @@ #include "FlatButton.h" #include "Menu.h" -#include "dialogs/CreateRoom.h" -#include "dialogs/JoinRoom.h" - -class OverlayModal; +namespace mtx { +namespace requests { +struct CreateRoom; +} +} class SideBarActions : public QWidget { @@ -36,12 +37,6 @@ private: QAction *createRoomAction_; QAction *joinRoomAction_; - QSharedPointer<OverlayModal> joinRoomModal_; - QSharedPointer<dialogs::JoinRoom> joinRoomDialog_; - - QSharedPointer<OverlayModal> createRoomModal_; - QSharedPointer<dialogs::CreateRoom> createRoomDialog_; - FlatButton *settingsBtn_; FlatButton *createRoomBtn_; FlatButton *joinRoomBtn_; diff --git a/include/TopRoomBar.h b/include/TopRoomBar.h index 5b9c58e9..5b2ee506 100644 --- a/include/TopRoomBar.h +++ b/include/TopRoomBar.h @@ -26,9 +26,6 @@ #include <QSharedPointer> #include <QVBoxLayout> -#include "dialogs/InviteUsers.h" -#include "dialogs/LeaveRoom.h" - class Avatar; class FlatButton; class Label; @@ -74,9 +71,6 @@ private: FlatButton *settingsBtn_; - QSharedPointer<OverlayModal> inviteUsersModal_; - QSharedPointer<dialogs::InviteUsers> inviteUsersDialog_; - Avatar *avatar_; int buttonSize_; diff --git a/include/UserInfoWidget.h b/include/UserInfoWidget.h index cae9d5b9..5e0ed85b 100644 --- a/include/UserInfoWidget.h +++ b/include/UserInfoWidget.h @@ -20,8 +20,6 @@ #include <QLabel> #include <QLayout> -#include "dialogs/Logout.h" - class Avatar; class FlatButton; class OverlayModal; @@ -46,9 +44,6 @@ protected: void resizeEvent(QResizeEvent *event) override; void paintEvent(QPaintEvent *event) override; -private slots: - void closeLogoutDialog(bool isLoggingOut); - private: Avatar *userAvatar_; @@ -67,8 +62,5 @@ private: QImage avatar_image_; - QSharedPointer<OverlayModal> logoutModal_; - QSharedPointer<dialogs::Logout> logoutDialog_; - int logoutButtonSize_; }; |