Uses MatriqueRoom inherited from QMatrixClient::Room and rewrite related
objects.
This commit is contained in:
@@ -12,8 +12,6 @@ AvatarContainer {
|
||||
|
||||
id: messageRow
|
||||
|
||||
Audio { id: audioPlayer }
|
||||
|
||||
DownloadableContent {
|
||||
id: downloadable
|
||||
|
||||
@@ -37,7 +35,7 @@ AvatarContainer {
|
||||
|
||||
onClicked: {
|
||||
if (downloadable.downloaded)
|
||||
play()
|
||||
matriqueController.playAudio(progressInfo.localPath)
|
||||
else
|
||||
{
|
||||
playOnFinished = true
|
||||
@@ -46,11 +44,7 @@ AvatarContainer {
|
||||
}
|
||||
}
|
||||
}
|
||||
onDownloadedChanged: downloaded && playOnFinished ? play() : {}
|
||||
onDownloadedChanged: downloaded && playOnFinished ? matriqueController.playAudio(progressInfo.localPath) : {}
|
||||
}
|
||||
|
||||
function play() {
|
||||
audioPlayer.source = progressInfo.localPath
|
||||
audioPlayer.play()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ Item {
|
||||
onDownloadedChanged: downloaded && openOnFinished ? openSavedFile() : {}
|
||||
|
||||
function saveFileAs() {
|
||||
matriqueController.saveFileAs(currentRoom, eventId)
|
||||
currentRoom.saveFileAs(eventId)
|
||||
}
|
||||
|
||||
function downloadAndOpen()
|
||||
|
||||
@@ -303,20 +303,7 @@ Item {
|
||||
|
||||
contentItem: MaterialIcon { icon: "\ue226" }
|
||||
|
||||
onClicked: {
|
||||
var fileTransferProgressCallback = function(id, sent, total) {
|
||||
inputField.progress = sent / total
|
||||
}
|
||||
var completedCallback = function(id, localFile, mxcUrl) {
|
||||
inputField.progress = 0
|
||||
currentRoom.fileTransferCompleted.disconnect(fileTransferProgressCallback)
|
||||
currentRoom.fileTransferCompleted.disconnect(completedCallback)
|
||||
}
|
||||
|
||||
currentRoom.fileTransferProgress.connect(fileTransferProgressCallback)
|
||||
currentRoom.fileTransferCompleted.connect(completedCallback)
|
||||
matriqueController.uploadFile(currentRoom)
|
||||
}
|
||||
onClicked: currentRoom.chooseAndUploadFile()
|
||||
}
|
||||
|
||||
TextField {
|
||||
@@ -340,14 +327,6 @@ Item {
|
||||
|
||||
background: Rectangle {
|
||||
color: Material.theme == Material.Light ? "#eaeaea" : "#242424"
|
||||
|
||||
Rectangle {
|
||||
z: 5
|
||||
width: inputField.width * inputField.progress
|
||||
height: parent.height
|
||||
color: Material.accent
|
||||
opacity: 0.4
|
||||
}
|
||||
}
|
||||
|
||||
function postMessage(text) {
|
||||
|
||||
@@ -217,8 +217,8 @@ Item {
|
||||
|
||||
contentItem: Label { text: "Accept this invitation?" }
|
||||
|
||||
onAccepted: matriqueController.acceptRoom(currentRoom)
|
||||
onRejected: matriqueController.rejectRoom(currentRoom)
|
||||
onAccepted: currentRoom.acceptInvitation()
|
||||
onRejected: currentRoom.rejectInvitation()
|
||||
}
|
||||
|
||||
Menu {
|
||||
@@ -243,7 +243,7 @@ Item {
|
||||
}
|
||||
MenuItem {
|
||||
text: "Leave Room"
|
||||
onTriggered: matriqueController.forgetRoom(currentRoom.id)
|
||||
onTriggered: currentRoom.forget()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,10 +36,13 @@ Page {
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Logout"
|
||||
highlighted: true
|
||||
text: "Logout"
|
||||
highlighted: true
|
||||
|
||||
onClicked: matriqueController.logout()
|
||||
onClicked: {
|
||||
matriqueController.logout()
|
||||
Qt.quit()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user