Uses MatriqueRoom inherited from QMatrixClient::Room and rewrite related

objects.
This commit is contained in:
Black Hat
2018-08-18 16:02:47 +08:00
parent 6640b172d5
commit 3a7f182c52
16 changed files with 202 additions and 177 deletions

View File

@@ -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) {

View File

@@ -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()
}
}
}

View File

@@ -36,10 +36,13 @@ Page {
}
Button {
text: "Logout"
highlighted: true
text: "Logout"
highlighted: true
onClicked: matriqueController.logout()
onClicked: {
matriqueController.logout()
Qt.quit()
}
}
}
}