Testing upload file && minor UI tweaks.

This commit is contained in:
Black Hat
2018-07-15 16:02:26 +08:00
parent 965dbeff83
commit 4ef063ea82
5 changed files with 24 additions and 22 deletions

View File

@@ -137,7 +137,12 @@ Page {
text: "LOGIN"
highlighted: true
onClicked: controller.loginWithCredentials(serverField.text, usernameField.text, passwordField.text)
onClicked: {
matriqueController.isLoginChanged.connect( function() {
if (matriqueController.isLogin) stackView.replace(roomPage)
})
controller.loginWithCredentials(serverField.text, usernameField.text, passwordField.text)
}
}
}
}

View File

@@ -148,9 +148,13 @@ Item {
id: fileDialog
title: "Please choose a file"
folder: shortcuts.home
selectMultiple: false
onAccepted: {
console.log("You chose: " + fileDialog.fileUrls)
currentRoom.uploadFile(fileDialog.fileUrls)
console.log("You chose: " + fileDialog.fileUrl)
currentRoom.uploadFile(fileDialog.fileUrl, fileDialog.fileUrl)
currentRoom.fileTransferCompleted.connect(function(id, localFile, mxcUrl) {
console.log("File transferred: " + id + ":" + mxcUrl)
})
}
}
}

View File

@@ -146,7 +146,6 @@ Item {
source: avatar ? "image://mxc/" + avatar : ""
displayText: name
opaqueBackground: true
}
ColumnLayout {
@@ -160,15 +159,7 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true
text: {
if (name) {
return name;
}
if (alias) {
return alias;
}
return id
}
text: name ? name : alias ? alias : id
font.pointSize: 16
elide: Text.ElideRight
wrapMode: Text.NoWrap