moment/src/qml/Pages/RememberAccount.qml

50 lines
1.2 KiB
QML
Raw Normal View History

2019-07-07 23:52:41 -04:00
// Copyright 2019 miruka
// This file is part of harmonyqml, licensed under LGPLv3.
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": function(button) {
py.callCoro("save_account", [userId])
pageStack.showPage("Default")
},
"no": function(button) {
py.callCoro("forget_account", [userId])
2019-04-27 21:07:20 -04:00
pageStack.showPage("Default")
},
}
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
}
}