Use nio.PushRuleKind instead of own enum

This commit is contained in:
miruka
2020-11-03 06:36:31 -04:00
parent 8748c6445f
commit 35a8c0aec4
5 changed files with 38 additions and 51 deletions

View File

@@ -13,7 +13,7 @@ HTile {
property Item page
readonly property QtObject matchingRoom:
model.kind === "Room" ?
model.kind === "room" ?
ModelStore.get(page.userId, "rooms").find(model.rule_id) :
null
@@ -32,7 +32,7 @@ HTile {
textFormat:
model.rule_id === ".m.rule.contains_user_name" ||
model.rule_id === ".m.rule.roomnotif" ||
model.kind === "Sender" ?
model.kind === "sender" ?
HLabel.StyledText :
HLabel.PlainText
@@ -83,10 +83,10 @@ HTile {
model.rule_id === ".m.rule.encrypted" ?
qsTr("Encrypted group messages") :
model.kind === "Content" ?
model.kind === "content" ?
qsTr('Contains "%1"').arg(model.pattern) :
model.kind === "Sender" ?
model.kind === "sender" ?
utils.coloredNameHtml("", model.rule_id) :
matchingRoom && matchingRoom.display_name ?

View File

@@ -54,14 +54,14 @@ HListView {
section.property: "kind"
section.delegate: HLabel {
width: root.width
topPadding: padding * (section === "Override" ? 1 : 1.5)
topPadding: padding * (section === "override" ? 1 : 1.5)
padding: theme.spacing
font.pixelSize: theme.fontSize.big
text:
section === "Override" ? qsTr("High-priority general rules") :
section === "Content" ? qsTr("Message text rules") :
section === "Room" ? qsTr("Room rules") :
section === "Sender" ? qsTr("Sender rules") :
section === "override" ? qsTr("High-priority general rules") :
section === "content" ? qsTr("Message text rules") :
section === "room" ? qsTr("Room rules") :
section === "sender" ? qsTr("Sender rules") :
qsTr("General rules")
}