Implement basic placeholder and disable unimplemented event types

This commit is contained in:
Nicolas Werner 2019-09-18 21:09:46 +02:00
parent d1fffd6617
commit 5200db17e9
3 changed files with 23 additions and 12 deletions

View file

@ -95,21 +95,21 @@ Rectangle {
height: item.height height: item.height
source: switch(model.type) { source: switch(model.type) {
case MtxEvent.Aliases: return "delegates/Aliases.qml" //case MtxEvent.Aliases: return "delegates/Aliases.qml"
case MtxEvent.Avatar: return "delegates/Avatar.qml" //case MtxEvent.Avatar: return "delegates/Avatar.qml"
case MtxEvent.CanonicalAlias: return "delegates/CanonicalAlias.qml" //case MtxEvent.CanonicalAlias: return "delegates/CanonicalAlias.qml"
case MtxEvent.Create: return "delegates/Create.qml" //case MtxEvent.Create: return "delegates/Create.qml"
case MtxEvent.GuestAccess: return "delegates/GuestAccess.qml" //case MtxEvent.GuestAccess: return "delegates/GuestAccess.qml"
case MtxEvent.HistoryVisibility: return "delegates/HistoryVisibility.qml" //case MtxEvent.HistoryVisibility: return "delegates/HistoryVisibility.qml"
case MtxEvent.JoinRules: return "delegates/JoinRules.qml" //case MtxEvent.JoinRules: return "delegates/JoinRules.qml"
case MtxEvent.Member: return "delegates/Member.qml" //case MtxEvent.Member: return "delegates/Member.qml"
case MtxEvent.Name: return "delegates/Name.qml" //case MtxEvent.Name: return "delegates/Name.qml"
case MtxEvent.PowerLevels: return "delegates/PowerLevels.qml" //case MtxEvent.PowerLevels: return "delegates/PowerLevels.qml"
case MtxEvent.Topic: return "delegates/Topic.qml" //case MtxEvent.Topic: return "delegates/Topic.qml"
case MtxEvent.NoticeMessage: return "delegates/NoticeMessage.qml" case MtxEvent.NoticeMessage: return "delegates/NoticeMessage.qml"
case MtxEvent.TextMessage: return "delegates/TextMessage.qml" case MtxEvent.TextMessage: return "delegates/TextMessage.qml"
case MtxEvent.ImageMessage: return "delegates/ImageMessage.qml" case MtxEvent.ImageMessage: return "delegates/ImageMessage.qml"
case MtxEvent.VideoMessage: return "delegates/VideoMessage.qml" //case MtxEvent.VideoMessage: return "delegates/VideoMessage.qml"
case MtxEvent.Redacted: return "delegates/Redacted.qml" case MtxEvent.Redacted: return "delegates/Redacted.qml"
default: return "delegates/placeholder.qml" default: return "delegates/placeholder.qml"
} }

View file

@ -0,0 +1,10 @@
import QtQuick 2.5
import QtQuick.Controls 2.5
Label {
text: qsTr("unimplemented event: ") + eventData.type
textFormat: Text.PlainText
wrapMode: Text.Wrap
width: parent.width
color: inactiveColors.text
}

View file

@ -121,5 +121,6 @@
<file>qml/delegates/NoticeMessage.qml</file> <file>qml/delegates/NoticeMessage.qml</file>
<file>qml/delegates/ImageMessage.qml</file> <file>qml/delegates/ImageMessage.qml</file>
<file>qml/delegates/Redacted.qml</file> <file>qml/delegates/Redacted.qml</file>
<file>qml/delegates/placeholder.qml</file>
</qresource> </qresource>
</RCC> </RCC>