From 2b8b04a04bfc8b717f27979d943f158b1acb9330 Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Mon, 27 Jan 2020 23:28:11 -0500 Subject: Add initial QML Reply Popup --- src/timeline/TimelineViewManager.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/timeline/TimelineViewManager.h') diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h index 63075649..3db55366 100644 --- a/src/timeline/TimelineViewManager.h +++ b/src/timeline/TimelineViewManager.h @@ -24,6 +24,8 @@ class TimelineViewManager : public QObject TimelineModel *timeline MEMBER timeline_ READ activeTimeline NOTIFY activeTimelineChanged) Q_PROPERTY( bool isInitialSync MEMBER isInitialSync_ READ isInitialSync NOTIFY initialSyncChanged) + Q_PROPERTY(QString replyingEvent READ getReplyingEvent WRITE updateReplyingEvent NOTIFY + replyingEventChanged) public: TimelineViewManager(QWidget *parent = 0); @@ -43,8 +45,17 @@ signals: void updateRoomsLastMessage(QString roomid, const DescInfo &info); void activeTimelineChanged(TimelineModel *timeline); void initialSyncChanged(bool isInitialSync); + void replyingEventChanged(QString replyingEvent); public slots: + void updateReplyingEvent(const QString &replyingEvent) + { + if (this->replyingEvent_ != replyingEvent) { + this->replyingEvent_ = replyingEvent; + emit replyingEventChanged(replyingEvent_); + } + } + QString getReplyingEvent() const { return replyingEvent_; } void updateReadReceipts(const QString &room_id, const std::vector &event_ids); void initWithMessages(const std::map &msgs); @@ -97,4 +108,5 @@ private: QHash> models; TimelineModel *timeline_ = nullptr; bool isInitialSync_ = true; + QString replyingEvent_; }; -- cgit 1.5.1