moment/harmonyqml/components/Pages/RememberAccount.qml
miruka 51386821bc Make clientManager easier to use
- Backend.clientManager renamed to Backend.clients
- clientManager is now a Mapping subclass

Before/After from Python:
backend.clientManager.clients[thing] → backend.clients[thing]

From QML:
Backend.clientManager.clients[thing] → Backend.clients.get(thing)
2019-05-02 14:58:42 -04:00

44 lines
1.1 KiB
QML

import QtQuick 2.7
import QtQuick.Layouts 1.3
import "../Base"
Item {
property string loginWith: "username"
property var client: null
HInterfaceBox {
id: rememberBox
title: "Sign in"
anchors.centerIn: parent
enterButtonTarget: "yes"
buttonModel: [
{ name: "yes", text: qsTr("Yes") },
{ name: "no", text: qsTr("No") },
]
buttonCallbacks: {
"yes": function(button) {
Backend.clients.remember(client)
pageStack.showPage("Default")
},
"no": function(button) { pageStack.showPage("Default") },
}
HLabel {
text: qsTr(
"Do you want to remember this account?\n\n" +
"If yes, the " + loginWith + " and an access token will be " +
"stored to automatically sign in on this device."
)
wrapMode: Text.Wrap
Layout.margins: rememberBox.margins
Layout.maximumWidth: rememberBox.width - Layout.margins * 2
}
HSpacer {}
}
}