2015-12-03 22:06:52 +00:00
|
|
|
import QtQuick 2.3
|
|
|
|
import QtQuick.Controls 1.2
|
|
|
|
import QtQuick.Window 2.2
|
|
|
|
import QtQuick.Dialogs 1.2
|
|
|
|
import QtQuick.Layouts 1.1
|
2016-03-08 20:26:54 +00:00
|
|
|
import org.kde.kirigami 1.0 as Kirigami
|
2015-12-03 22:06:52 +00:00
|
|
|
import org.subsurfacedivelog.mobile 1.0
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: loginWindow
|
2016-03-08 20:26:54 +00:00
|
|
|
height: outerLayout.height + 2 * Kirigami.Units.gridUnit
|
2015-12-03 22:06:52 +00:00
|
|
|
|
|
|
|
property string username: login.text;
|
|
|
|
property string password: password.text;
|
|
|
|
|
2016-02-14 05:09:33 +00:00
|
|
|
function saveCredentials() {
|
|
|
|
manager.cloudUserName = login.text
|
|
|
|
manager.cloudPassword = password.text
|
|
|
|
manager.saveCloudCredentials()
|
|
|
|
}
|
|
|
|
|
2015-12-03 22:06:52 +00:00
|
|
|
ColumnLayout {
|
2016-02-11 15:01:24 +00:00
|
|
|
id: outerLayout
|
2016-04-07 19:12:01 +00:00
|
|
|
width: loginWindow.width - loginWindow.leftPadding - loginWindow.rightPadding - 2 * Kirigami.Units.gridUnit
|
2016-03-27 04:27:48 +00:00
|
|
|
|
|
|
|
onVisibleChanged: {
|
2016-04-04 00:00:49 +00:00
|
|
|
if (visible && manager.accessingCloud < 0) {
|
2016-03-27 04:35:35 +00:00
|
|
|
manager.appendTextToLog("Credential scrn: show kbd was: " + (Qt.inputMethod.isVisible ? "visible" : "invisible"))
|
2016-03-27 04:27:48 +00:00
|
|
|
Qt.inputMethod.show()
|
|
|
|
login.forceActiveFocus()
|
|
|
|
} else {
|
2016-03-27 04:35:35 +00:00
|
|
|
manager.appendTextToLog("Credential scrn: hide kbd was: " + (Qt.inputMethod.isVisible ? "visible" : "invisible"))
|
2016-03-27 04:27:48 +00:00
|
|
|
Qt.inputMethod.hide()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Heading {
|
2015-12-03 22:06:52 +00:00
|
|
|
text: "Cloud credentials"
|
2016-02-10 12:53:55 +00:00
|
|
|
level: headingLevel
|
2016-03-08 20:26:54 +00:00
|
|
|
Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
|
2015-12-03 22:06:52 +00:00
|
|
|
}
|
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2015-12-03 22:06:52 +00:00
|
|
|
text: "Email"
|
|
|
|
}
|
|
|
|
|
2016-04-08 14:30:08 +00:00
|
|
|
StyledTextField {
|
2015-12-03 22:06:52 +00:00
|
|
|
id: login
|
|
|
|
text: manager.cloudUserName
|
|
|
|
Layout.fillWidth: true
|
2015-12-27 20:19:51 +00:00
|
|
|
inputMethodHints: Qt.ImhEmailCharactersOnly |
|
|
|
|
Qt.ImhNoAutoUppercase
|
2015-12-03 22:06:52 +00:00
|
|
|
}
|
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2015-12-03 22:06:52 +00:00
|
|
|
text: "Password"
|
|
|
|
}
|
|
|
|
|
2016-04-08 14:30:08 +00:00
|
|
|
StyledTextField {
|
2015-12-03 22:06:52 +00:00
|
|
|
id: password
|
|
|
|
text: manager.cloudPassword
|
|
|
|
echoMode: TextInput.Password
|
2015-12-30 10:46:28 +00:00
|
|
|
inputMethodHints: Qt.ImhSensitiveData |
|
2015-12-27 20:19:51 +00:00
|
|
|
Qt.ImhHiddenText |
|
|
|
|
Qt.ImhNoAutoUppercase
|
2015-12-03 22:06:52 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2015-12-04 01:57:25 +00:00
|
|
|
GridLayout {
|
|
|
|
columns: 2
|
2015-12-03 22:06:52 +00:00
|
|
|
|
2015-12-04 01:57:25 +00:00
|
|
|
CheckBox {
|
|
|
|
checked: false
|
|
|
|
id: showPassword
|
|
|
|
onCheckedChanged: {
|
|
|
|
password.echoMode = checked ? TextInput.Normal : TextInput.Password
|
|
|
|
}
|
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2015-12-04 01:57:25 +00:00
|
|
|
text: "Show password"
|
2015-12-03 22:06:52 +00:00
|
|
|
}
|
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Item { width: Kirigami.Units.gridUnit; height: width }
|
2015-12-03 22:06:52 +00:00
|
|
|
}
|
|
|
|
}
|