Build system, messages support and more

This commit is contained in:
miruka
2019-07-02 13:59:52 -04:00
parent 933341b7e6
commit 06c823aa67
53 changed files with 2264 additions and 446 deletions

View File

@@ -4,7 +4,7 @@ import "../Base"
Item {
property string loginWith: "username"
property var client: null
property string userId: ""
HInterfaceBox {
id: rememberBox
@@ -20,10 +20,13 @@ Item {
buttonCallbacks: {
"yes": function(button) {
Backend.clients.remember(client)
py.callCoro("save_account", [userId])
pageStack.showPage("Default")
},
"no": function(button) {
py.callCoro("forget_account", [userId])
pageStack.showPage("Default")
},
"no": function(button) { pageStack.showPage("Default") },
}
HLabel {

View File

@@ -4,7 +4,7 @@ import "../Base"
Item {
property string loginWith: "username"
onFocusChanged: identifierField.forceActiveFocus()
onFocusChanged: idField.forceActiveFocus()
HInterfaceBox {
id: signInBox
@@ -23,15 +23,15 @@ Item {
"register": function(button) {},
"login": function(button) {
var future = Backend.clients.new(
"matrix.org", identifierField.text, passwordField.text
)
button.loadingUntilFutureDone(future)
future.onGotResult.connect(function(client) {
button.loading = true
var args = [idField.text, passwordField.text]
py.callCoro("login_client", args, {}, function(user_id) {
pageStack.showPage(
"RememberAccount",
{"loginWith": loginWith, "client": client}
{"loginWith": loginWith, "userId": user_id}
)
button.loading = false
})
},
@@ -58,7 +58,7 @@ Item {
}
HTextField {
id: identifierField
id: idField
placeholderText: qsTr(
loginWith === "email" ? "Email" :
loginWith === "phone" ? "Phone" :