Fix most qml warnings in RoomContextMenu
This commit is contained in:
@@ -8,7 +8,6 @@ import QtQuick.Layouts
|
|||||||
|
|
||||||
import org.kde.kirigami as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
import org.kde.kirigamiaddons.components as KirigamiComponents
|
import org.kde.kirigamiaddons.components as KirigamiComponents
|
||||||
import org.kde.kirigamiaddons.delegates as Delegates
|
|
||||||
|
|
||||||
import Quotient
|
import Quotient
|
||||||
|
|
||||||
@@ -30,8 +29,8 @@ KirigamiComponents.ConvergentContextMenu {
|
|||||||
spacing: Kirigami.Units.largeSpacing
|
spacing: Kirigami.Units.largeSpacing
|
||||||
KirigamiComponents.Avatar {
|
KirigamiComponents.Avatar {
|
||||||
id: avatar
|
id: avatar
|
||||||
source: room.avatarMediaUrl
|
source: root.room.avatarMediaUrl
|
||||||
name: room.displayName
|
name: root.room.displayName
|
||||||
Layout.preferredWidth: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing * 2
|
Layout.preferredWidth: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing * 2
|
||||||
Layout.preferredHeight: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing * 2
|
Layout.preferredHeight: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing * 2
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
@@ -39,16 +38,16 @@ KirigamiComponents.ConvergentContextMenu {
|
|||||||
Kirigami.Heading {
|
Kirigami.Heading {
|
||||||
level: 5
|
level: 5
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: room.displayName
|
text: root.room.displayName
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QQC2.Action {
|
QQC2.Action {
|
||||||
text: i18n("Mark as Read")
|
text: i18nc("@action:inmenu", "Mark as Read")
|
||||||
icon.name: "checkmark"
|
icon.name: "checkmark"
|
||||||
enabled: room.notificationCount > 0
|
enabled: root.room.notificationCount > 0
|
||||||
onTriggered: room.markAllMessagesAsRead()
|
onTriggered: root.room.markAllMessagesAsRead()
|
||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
@@ -64,10 +63,10 @@ KirigamiComponents.ConvergentContextMenu {
|
|||||||
icon.name: "globe"
|
icon.name: "globe"
|
||||||
checkable: true
|
checkable: true
|
||||||
autoExclusive: true
|
autoExclusive: true
|
||||||
checked: room.pushNotificationState === PushNotificationState.Default
|
checked: root.room.pushNotificationState === PushNotificationState.Default
|
||||||
enabled: room.pushNotificationState != PushNotificationState.Unknown
|
enabled: root.room.pushNotificationState != PushNotificationState.Unknown
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
room.pushNotificationState = PushNotificationState.Default;
|
root.room.pushNotificationState = PushNotificationState.Default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,10 +75,10 @@ KirigamiComponents.ConvergentContextMenu {
|
|||||||
icon.name: "notifications"
|
icon.name: "notifications"
|
||||||
checkable: true
|
checkable: true
|
||||||
autoExclusive: true
|
autoExclusive: true
|
||||||
checked: room.pushNotificationState === PushNotificationState.All
|
checked: root.room.pushNotificationState === PushNotificationState.All
|
||||||
enabled: room.pushNotificationState != PushNotificationState.Unknown
|
enabled: root.room.pushNotificationState != PushNotificationState.Unknown
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
room.pushNotificationState = PushNotificationState.All;
|
root.room.pushNotificationState = PushNotificationState.All;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,10 +87,10 @@ KirigamiComponents.ConvergentContextMenu {
|
|||||||
icon.name: "im-user"
|
icon.name: "im-user"
|
||||||
checkable: true
|
checkable: true
|
||||||
autoExclusive: true
|
autoExclusive: true
|
||||||
checked: room.pushNotificationState === PushNotificationState.MentionKeyword
|
checked: root.room.pushNotificationState === PushNotificationState.MentionKeyword
|
||||||
enabled: room.pushNotificationState != PushNotificationState.Unknown
|
enabled: root.room.pushNotificationState != PushNotificationState.Unknown
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
room.pushNotificationState = PushNotificationState.MentionKeyword;
|
root.room.pushNotificationState = PushNotificationState.MentionKeyword;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,24 +99,24 @@ KirigamiComponents.ConvergentContextMenu {
|
|||||||
icon.name: "notifications-disabled"
|
icon.name: "notifications-disabled"
|
||||||
checkable: true
|
checkable: true
|
||||||
autoExclusive: true
|
autoExclusive: true
|
||||||
checked: room.pushNotificationState === PushNotificationState.Mute
|
checked: root.room.pushNotificationState === PushNotificationState.Mute
|
||||||
enabled: room.pushNotificationState != PushNotificationState.Unknown
|
enabled: root.room.pushNotificationState != PushNotificationState.Unknown
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
room.pushNotificationState = PushNotificationState.Mute;
|
root.room.pushNotificationState = PushNotificationState.Mute;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QQC2.Action {
|
QQC2.Action {
|
||||||
text: room.isFavourite ? i18n("Remove from Favorites") : i18n("Add to Favorites")
|
text: root.room.isFavourite ? i18nc("@action:inmenu", "Remove from Favorites") : i18nc("@action:inmenu", "Add to Favorites")
|
||||||
icon.name: room.isFavourite ? "rating" : "rating-unrated"
|
icon.name: root.room.isFavourite ? "rating" : "rating-unrated"
|
||||||
onTriggered: room.isFavourite ? room.removeTag("m.favourite") : room.addTag("m.favourite", 1.0)
|
onTriggered: root.room.isFavourite ? root.room.removeTag("m.favourite") : root.room.addTag("m.favourite", 1.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
QQC2.Action {
|
QQC2.Action {
|
||||||
text: room.isLowPriority ? i18n("Reprioritize") : i18n("Deprioritize")
|
text: root.room.isLowPriority ? i18nc("@action:inmenu", "Reprioritize") : i18nc("@action:inmenu", "Deprioritize")
|
||||||
icon.name: room.isLowPriority ? "arrow-up-symbolic" : "arrow-down-symbolic"
|
icon.name: root.room.isLowPriority ? "arrow-up-symbolic" : "arrow-down-symbolic"
|
||||||
onTriggered: room.isLowPriority ? room.removeTag("m.lowpriority") : room.addTag("m.lowpriority", 1.0)
|
onTriggered: root.room.isLowPriority ? root.room.removeTag("m.lowpriority") : root.room.addTag("m.lowpriority", 1.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
@@ -127,14 +126,14 @@ KirigamiComponents.ConvergentContextMenu {
|
|||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
text: i18nc("@action:inmenu", "Copy Room Link")
|
text: i18nc("@action:inmenu", "Copy Room Link")
|
||||||
icon.name: "edit-copy"
|
icon.name: "edit-copy"
|
||||||
visible: !room.isDirectChat() && room.joinRule !== JoinRule.Invite
|
visible: !root.room.isDirectChat() && root.room.joinRule !== JoinRule.Invite
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
// The canonical alias (if it exists) otherwise the first available alias
|
// The canonical alias (if it exists) otherwise the first available alias
|
||||||
const firstAlias = room.aliases[0];
|
const firstAlias = root.room.aliases[0];
|
||||||
if (firstAlias) {
|
if (firstAlias) {
|
||||||
Clipboard.saveText("https://matrix.to/#/" + firstAlias);
|
Clipboard.saveText("https://matrix.to/#/" + firstAlias);
|
||||||
} else {
|
} else {
|
||||||
Clipboard.saveText("https://matrix.to/#/" + room.id);
|
Clipboard.saveText("https://matrix.to/#/" + root.room.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -152,12 +151,12 @@ KirigamiComponents.ConvergentContextMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QQC2.Action {
|
QQC2.Action {
|
||||||
text: i18n("Leave Room…")
|
text: i18nc("@action:inmenu", "Leave Room…")
|
||||||
icon.name: "go-previous"
|
icon.name: "go-previous"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
Qt.createComponent('org.kde.neochat', 'ConfirmLeaveDialog').createObject(root.QQC2.ApplicationWindow.window, {
|
(Qt.createComponent('org.kde.neochat', 'ConfirmLeaveDialog').createObject(root.QQC2.ApplicationWindow.window, {
|
||||||
room: root.room
|
room: root.room
|
||||||
}).open();
|
}) as ConfirmLeaveDialog).open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user