From 12b6b748819994caac539d95cbbcfa2a926532d5 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 10 Jul 2020 12:49:55 -0400 Subject: [PATCH] Disable room context menu entries while offline Except "Copy room ID" --- src/gui/MainPane/RoomDelegate.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/MainPane/RoomDelegate.qml b/src/gui/MainPane/RoomDelegate.qml index 645dd269..705b1cc2 100644 --- a/src/gui/MainPane/RoomDelegate.qml +++ b/src/gui/MainPane/RoomDelegate.qml @@ -115,7 +115,7 @@ HTile { contextMenu: HMenu { HMenuItemPopupSpawner { visible: joined - enabled: model.can_invite + enabled: model.can_invite && accountModel.presence !== "offline" icon.name: "room-send-invite" text: qsTr("Invite members") @@ -142,6 +142,7 @@ HTile { model.inviter_name, model.inviter_id )) label.textFormat: Text.StyledText + enabled: accountModel.presence !== "offline" onTriggered: py.callClientCoro( model.for_account, "join", [model.id] @@ -153,6 +154,7 @@ HTile { icon.name: invited ? "invite-decline" : "room-leave" icon.color: theme.colors.negativeBackground text: invited ? qsTr("Decline invite") : qsTr("Leave") + enabled: accountModel.presence !== "offline" popup: "Popups/LeaveRoomPopup.qml" properties: ({ @@ -166,6 +168,7 @@ HTile { icon.name: "room-forget" icon.color: theme.colors.negativeBackground text: qsTr("Forget") + enabled: accountModel.presence !== "offline" popup: "Popups/ForgetRoomPopup.qml" autoDestruct: false