2019-07-07 23:52:41 -04:00
|
|
|
// Copyright 2019 miruka
|
|
|
|
// This file is part of harmonyqml, licensed under LGPLv3.
|
|
|
|
|
2019-07-13 05:39:01 -04:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
2019-04-28 15:18:36 -04:00
|
|
|
import "../Base"
|
2019-04-27 21:07:20 -04:00
|
|
|
|
|
|
|
Item {
|
|
|
|
property string loginWith: "username"
|
2019-07-02 13:59:52 -04:00
|
|
|
property string userId: ""
|
2019-04-27 21:07:20 -04:00
|
|
|
|
2019-04-28 15:18:36 -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) {
|
2019-07-02 13:59:52 -04:00
|
|
|
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")
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2019-04-28 15:18:36 -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.maximumWidth: rememberBox.width - Layout.margins * 2
|
|
|
|
}
|
|
|
|
|
2019-04-28 15:22:53 -04:00
|
|
|
HSpacer {}
|
2019-04-27 21:07:20 -04:00
|
|
|
}
|
|
|
|
}
|