From 14488a8fe78f829dadf3899a1c50ab389d05dbe9 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Thu, 23 Sep 2021 21:18:48 -0400 Subject: Use the same leave room dialog everywhere This ports the leave room dialog to QML, everywhere. There are now no differences between the various leave dialogs. --- src/timeline/InputBar.cpp | 2 +- src/timeline/TimelineViewManager.cpp | 6 ------ src/timeline/TimelineViewManager.h | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) (limited to 'src/timeline') diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index f518248b..f33d1dfd 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp @@ -577,7 +577,7 @@ InputBar::command(QString command, QString args) } else if (command == "join") { ChatPage::instance()->joinRoom(args); } else if (command == "part" || command == "leave") { - MainWindow::instance()->openLeaveRoomDialog(room->roomId()); + ChatPage::instance()->timelineManager()->openLeaveRoomDialog(room->roomId()); } else if (command == "invite") { ChatPage::instance()->inviteUser(args.section(' ', 0, 0), args.section(' ', 1, -1)); } else if (command == "kick") { diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp index df8210d3..a30a145d 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp @@ -475,12 +475,6 @@ TimelineViewManager::openImageOverlayInternal(QString eventId, QImage img) }); } -void -TimelineViewManager::openLeaveRoomDialog(QString roomid) const -{ - MainWindow::instance()->openLeaveRoomDialog(roomid); -} - void TimelineViewManager::verifyUser(QString userid) { diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h index f7b01315..ab078aa7 100644 --- a/src/timeline/TimelineViewManager.h +++ b/src/timeline/TimelineViewManager.h @@ -73,7 +73,6 @@ public: Q_INVOKABLE void openGlobalUserProfile(QString userId); Q_INVOKABLE void focusMessageInput(); - Q_INVOKABLE void openLeaveRoomDialog(QString roomid) const; Q_INVOKABLE void removeVerificationFlow(DeviceVerificationFlow *flow); Q_INVOKABLE void fixImageRendering(QQuickTextDocument *t, QQuickItem *i); @@ -98,6 +97,7 @@ signals: void openInviteUsersDialog(InviteesModel *invitees); void openProfile(UserProfile *profile); void showImagePackSettings(ImagePackListModel *packlist); + void openLeaveRoomDialog(QString roomid); public slots: void updateReadReceipts(const QString &room_id, const std::vector &event_ids); -- cgit 1.5.1