moment/src/qml/Pages/RememberAccount.qml

47 lines
1.2 KiB
QML
Raw Normal View History

import QtQuick 2.12
import QtQuick.Layouts 1.12
import "../Base"
2019-04-27 21:07:20 -04:00
Item {
property string loginWith: "username"
property string userId: ""
2019-04-27 21:07:20 -04:00
HInterfaceBox {
2019-04-27 21:07:20 -04:00
id: rememberBox
title: "Sign in"
anchors.centerIn: parent
enterButtonTarget: "yes"
buttonModel: [
{ name: "yes", text: qsTr("Yes") },
{ name: "no", text: qsTr("No") },
]
buttonCallbacks: ({
yes: button => {
py.callCoro("saved_accounts.add", [userId])
pageStack.showPage("EditAccount/EditAccount", {userId})
},
no: button => {
py.callCoro("saved_accounts.delete", [userId])
pageStack.showPage("EditAccount/EditAccount", {userId})
2019-04-27 21:07:20 -04:00
},
})
2019-04-27 21:07:20 -04:00
HLabel {
2019-04-27 21:07:20 -04:00
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.fillWidth: true
2019-04-27 21:07:20 -04:00
}
2019-04-28 15:22:53 -04:00
HSpacer {}
2019-04-27 21:07:20 -04:00
}
}