Move LeaveRoom dialog to MainWindow (#87)
This commit is contained in:
parent
3fd257243c
commit
26f221ec23
8 changed files with 37 additions and 86 deletions
|
|
@ -66,6 +66,7 @@ public:
|
|||
void bootstrap(QString userid, QString homeserver, QString token);
|
||||
void showQuickSwitcher();
|
||||
void showReadReceipts(const QString &event_id);
|
||||
QString currentRoom() const { return current_room_; }
|
||||
|
||||
static ChatPage *instance() { return instance_; }
|
||||
|
||||
|
|
|
|||
|
|
@ -35,17 +35,22 @@ class SnackBar;
|
|||
class TrayIcon;
|
||||
class UserSettings;
|
||||
|
||||
namespace dialogs {
|
||||
class LeaveRoom;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
|
||||
static MainWindow *instance() { return instance_; };
|
||||
void saveCurrentWindowSize();
|
||||
|
||||
void openLeaveRoomDialog(const QString &room_id = "");
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
|
|
@ -78,31 +83,27 @@ private:
|
|||
|
||||
//! The initial welcome screen.
|
||||
WelcomePage *welcome_page_;
|
||||
|
||||
//! The login screen.
|
||||
LoginPage *login_page_;
|
||||
|
||||
//! The register page.
|
||||
RegisterPage *register_page_;
|
||||
|
||||
//! A stacked widget that handles the transitions between widgets.
|
||||
QStackedWidget *pageStack_;
|
||||
|
||||
//! The main chat area.
|
||||
ChatPage *chat_page_;
|
||||
UserSettingsPage *userSettingsPage_;
|
||||
QSharedPointer<UserSettings> userSettings_;
|
||||
|
||||
//! Used to hide undefined states between page transitions.
|
||||
QSharedPointer<OverlayModal> progressModal_;
|
||||
QSharedPointer<LoadingIndicator> spinner_;
|
||||
|
||||
//! Matrix Client API provider.
|
||||
QSharedPointer<MatrixClient> client_;
|
||||
|
||||
//! Tray icon that shows the unread message count.
|
||||
TrayIcon *trayIcon_;
|
||||
|
||||
//! Notifications display.
|
||||
QSharedPointer<SnackBar> snackBar_;
|
||||
//! Leave room modal.
|
||||
QSharedPointer<OverlayModal> leaveRoomModal_;
|
||||
//! Leave room dialog.
|
||||
QSharedPointer<dialogs::LeaveRoom> leaveRoomDialog_;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@
|
|||
|
||||
#include <mtx.hpp>
|
||||
|
||||
#include "dialogs/LeaveRoom.h"
|
||||
|
||||
class LeaveRoomDialog;
|
||||
class MatrixClient;
|
||||
class Cache;
|
||||
|
|
@ -79,8 +77,6 @@ public slots:
|
|||
void updateUnreadMessageCount(const QString &roomid, int count);
|
||||
void updateRoomDescription(const QString &roomid, const DescInfo &info);
|
||||
void closeJoinRoomDialog(bool isJoining, QString roomAlias);
|
||||
void openLeaveRoomDialog(const QString &room_id);
|
||||
void closeLeaveRoomDialog(bool leaving, const QString &room_id);
|
||||
void clearRoomMessageCount(const QString &room_id);
|
||||
|
||||
protected:
|
||||
|
|
@ -109,9 +105,6 @@ private:
|
|||
|
||||
OverlayModal *joinRoomModal_;
|
||||
|
||||
QSharedPointer<OverlayModal> leaveRoomModal_;
|
||||
QSharedPointer<dialogs::LeaveRoom> leaveRoomDialog_;
|
||||
|
||||
std::map<QString, QSharedPointer<RoomInfoListItem>> rooms_;
|
||||
QString selectedRoom_;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,16 +53,12 @@ public:
|
|||
void reset();
|
||||
|
||||
signals:
|
||||
void leaveRoom();
|
||||
void inviteUsers(QStringList users);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
|
||||
private slots:
|
||||
void closeLeaveRoomDialog(bool leaving);
|
||||
|
||||
private:
|
||||
QHBoxLayout *topLayout_;
|
||||
QVBoxLayout *textLayout_;
|
||||
|
|
@ -79,9 +75,6 @@ private:
|
|||
|
||||
FlatButton *settingsBtn_;
|
||||
|
||||
QSharedPointer<OverlayModal> leaveRoomModal_;
|
||||
QSharedPointer<dialogs::LeaveRoom> leaveRoomDialog_;
|
||||
|
||||
QSharedPointer<OverlayModal> inviteUsersModal_;
|
||||
QSharedPointer<dialogs::InviteUsers> inviteUsersDialog_;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue