@@ -605,6 +605,7 @@ ColumnLayout {
|
|||||||
source: root.jsonSource,
|
source: root.jsonSource,
|
||||||
eventType: root.delegateType,
|
eventType: root.delegateType,
|
||||||
plainText: root.plainText,
|
plainText: root.plainText,
|
||||||
|
htmlText: root.display,
|
||||||
});
|
});
|
||||||
contextMenu.open();
|
contextMenu.open();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ Loader {
|
|||||||
required property string source
|
required property string source
|
||||||
property string selectedText: ""
|
property string selectedText: ""
|
||||||
required property string plainText
|
required property string plainText
|
||||||
|
property string htmlText: undefined
|
||||||
|
|
||||||
property list<Kirigami.Action> nestedActions
|
property list<Kirigami.Action> nestedActions
|
||||||
|
|
||||||
@@ -40,6 +41,20 @@ Loader {
|
|||||||
currentRoom.chatBoxEditId = "";
|
currentRoom.chatBoxEditId = "";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Kirigami.Action {
|
||||||
|
text: i18nc("@action:inmenu As in 'Forward this message'", "Forward")
|
||||||
|
icon.name: "mail-forward-symbolic"
|
||||||
|
onTriggered: {
|
||||||
|
let page = applicationWindow().pageStack.pushDialogLayer("qrc:/ChooseRoomDialog.qml", {}, {
|
||||||
|
title: i18nc("@title", "Forward Message"),
|
||||||
|
width: Kirigami.Units.gridUnit * 25
|
||||||
|
})
|
||||||
|
page.chosen.connect(function(targetRoomId) {
|
||||||
|
Controller.activeConnection.room(targetRoomId).postHtmlMessage(loadRoot.plainText, loadRoot.htmlText ? loadRoot.htmlText : loadRoot.plainText)
|
||||||
|
page.closeDialog()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
visible: author.id === currentRoom.localUser.id || currentRoom.canSendState("redact")
|
visible: author.id === currentRoom.localUser.id || currentRoom.canSendState("redact")
|
||||||
text: i18n("Remove")
|
text: i18n("Remove")
|
||||||
|
|||||||
39
src/qml/Page/ChooseRoomDialog.qml
Normal file
39
src/qml/Page/ChooseRoomDialog.qml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Controls 2.15
|
||||||
|
|
||||||
|
import org.kde.kirigami 2.20 as Kirigami
|
||||||
|
|
||||||
|
import org.kde.neochat 1.0
|
||||||
|
|
||||||
|
import "./RoomList"
|
||||||
|
|
||||||
|
Kirigami.ScrollablePage {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
title: i18nc("@title", "Choose a Room")
|
||||||
|
|
||||||
|
signal chosen(string roomId)
|
||||||
|
|
||||||
|
header: Kirigami.SearchField {
|
||||||
|
onTextChanged: sortModel.filterText = text
|
||||||
|
}
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
model: SortFilterRoomListModel {
|
||||||
|
id: sortModel
|
||||||
|
sourceModel: RoomListModel {
|
||||||
|
connection: Controller.activeConnection
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delegate: RoomDelegate {
|
||||||
|
id: roomDelegate
|
||||||
|
filterText: ""
|
||||||
|
onClicked: {
|
||||||
|
root.chosen(roomDelegate.currentRoom.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -135,5 +135,6 @@
|
|||||||
<file alias="DirectChatDrawerHeader.qml">qml/RoomDrawer/DirectChatDrawerHeader.qml</file>
|
<file alias="DirectChatDrawerHeader.qml">qml/RoomDrawer/DirectChatDrawerHeader.qml</file>
|
||||||
<file alias="GroupChatDrawerHeader.qml">qml/RoomDrawer/GroupChatDrawerHeader.qml</file>
|
<file alias="GroupChatDrawerHeader.qml">qml/RoomDrawer/GroupChatDrawerHeader.qml</file>
|
||||||
<file alias="RoomInformation.qml">qml/RoomDrawer/RoomInformation.qml</file>
|
<file alias="RoomInformation.qml">qml/RoomDrawer/RoomInformation.qml</file>
|
||||||
|
<file alias="ChooseRoomDialog.qml">qml/Page/ChooseRoomDialog.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
Reference in New Issue
Block a user