From 473b14ed0f8053348000db370451cfff3ce3ac13 Mon Sep 17 00:00:00 2001 From: Jedi18 Date: Thu, 11 Feb 2021 21:23:33 +0530 Subject: [PATCH] added roomversion, roomid etc --- resources/qml/RoomSettings.qml | 9 ++++----- src/ui/RoomSettings.cpp | 18 ++++++++++++++++++ src/ui/RoomSettings.h | 6 ++++++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/resources/qml/RoomSettings.qml b/resources/qml/RoomSettings.qml index 4b03e08b..ee824ba0 100644 --- a/resources/qml/RoomSettings.qml +++ b/resources/qml/RoomSettings.qml @@ -17,7 +17,6 @@ ApplicationWindow { minimumHeight: 420 palette: colors color: colors.window - title: roomSettings.roomName modality: Qt.WindowModal flags: Qt.WindowStaysOnTopHint @@ -46,13 +45,13 @@ ApplicationWindow { Layout.alignment: Qt.AlignHCenter MatrixText { - text: "room name" + text: roomSettings.roomName font.pixelSize: 24 Layout.alignment: Qt.AlignHCenter } MatrixText { - text: "1 member" + text: "%1 member(s)".arg(roomSettings.memberCount) Layout.alignment: Qt.AlignHCenter } } @@ -185,7 +184,7 @@ ApplicationWindow { } MatrixText { - text: "asdajdhasjkdhaskjdhasjdks" + text: roomSettings.roomId font.pixelSize: 12 } } @@ -200,7 +199,7 @@ ApplicationWindow { } MatrixText { - text: "6" + text: roomSettings.roomVersion font.pixelSize: 12 } } diff --git a/src/ui/RoomSettings.cpp b/src/ui/RoomSettings.cpp index 785452d0..49e48e40 100644 --- a/src/ui/RoomSettings.cpp +++ b/src/ui/RoomSettings.cpp @@ -72,6 +72,24 @@ RoomSettings::roomName() const return QString(info_.name.c_str()); } +QString +RoomSettings::roomId() const +{ + return roomid_; +} + +QString +RoomSettings::roomVersion() const +{ + return QString::fromStdString(info_.version); +} + +int +RoomSettings::memberCount() const +{ + return info_.member_count; +} + void RoomSettings::retrieveRoomInfo() { diff --git a/src/ui/RoomSettings.h b/src/ui/RoomSettings.h index 098e27ba..f5cc043c 100644 --- a/src/ui/RoomSettings.h +++ b/src/ui/RoomSettings.h @@ -11,6 +11,9 @@ class RoomSettings : public QObject { Q_OBJECT Q_PROPERTY(QString roomName READ roomName CONSTANT) + Q_PROPERTY(QString roomId READ roomId CONSTANT) + Q_PROPERTY(QString roomVersion READ roomVersion CONSTANT) + Q_PROPERTY(int memberCount READ memberCount CONSTANT) Q_PROPERTY(int notifications READ notifications NOTIFY notificationsChanged) Q_PROPERTY(int accessJoinRules READ accessJoinRules NOTIFY accessJoinRulesChanged) Q_PROPERTY(bool canChangeJoinRules READ canChangeJoinRules CONSTANT) @@ -21,6 +24,9 @@ public: RoomSettings(QString roomid, QObject *parent = nullptr); QString roomName() const; + QString roomId() const; + QString roomVersion() const; + int memberCount() const; int notifications(); int accessJoinRules(); bool respondsToKeyRequests();