From bc0646ef90892fc0ee5b32acada6444486e0e850 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 28 Feb 2021 14:37:36 -0400 Subject: [PATCH] Better indicate when a pushrule is disabled --- .../PushRuleSettingsPopup/PushRuleSettingsPopup.qml | 8 ++++---- src/gui/Utils.qml | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/Popups/PushRuleSettingsPopup/PushRuleSettingsPopup.qml b/src/gui/Popups/PushRuleSettingsPopup/PushRuleSettingsPopup.qml index f88df795..881110b3 100644 --- a/src/gui/Popups/PushRuleSettingsPopup/PushRuleSettingsPopup.qml +++ b/src/gui/Popups/PushRuleSettingsPopup/PushRuleSettingsPopup.qml @@ -55,7 +55,7 @@ HFlickableColumnPopup { rule.rule_id, isBefore && position ? position : undefined, ! isBefore && position ? position : undefined, - enableCheck.checked, + ! disableCheck.checked, generalChecked ? details.matrixConditions : undefined, contentRadio.checked ? details.idField.text : undefined, actions, @@ -321,9 +321,9 @@ HFlickableColumnPopup { } HCheckBox { - id: enableCheck - text: qsTr("Enable this rule") - defaultChecked: root.rule.enabled + id: disableCheck + text: qsTr("Disable this rule") + defaultChecked: ! root.rule.enabled Layout.fillWidth: true } } diff --git a/src/gui/Utils.qml b/src/gui/Utils.qml index 83a750ae..eb8caf24 100644 --- a/src/gui/Utils.qml +++ b/src/gui/Utils.qml @@ -566,7 +566,7 @@ QtObject { const roomColor = theme.colors.accentText const room = ModelStore.get(userId, "rooms").find(rule.rule_id) - return ( + const text = rule.rule_id === ".m.rule.master" ? qsTr("Any message") : @@ -631,6 +631,7 @@ QtObject { escapeHtml(room.display_name) : escapeHtml(rule.rule_id) - ) + + return rule.enabled ? text : qsTr("%1 (disabled rule)").arg(text) } }