Добавлены настройки login и password
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Controls 2.2
|
||||
|
||||
import ru.ded.noolight 1.0
|
||||
import ru.ded.components 1.0
|
||||
|
||||
Page {
|
||||
id: root
|
||||
|
||||
@@ -14,6 +17,16 @@ Page {
|
||||
title: qsTr("nooLite service URL")
|
||||
inputMethodHint: Qt.ImhUrlCharactersOnly
|
||||
}
|
||||
ListElement {
|
||||
name: "login"
|
||||
title: qsTr("Login")
|
||||
inputMethodHint: Qt.ImhLatinOnly
|
||||
}
|
||||
ListElement {
|
||||
name: "password"
|
||||
title: qsTr("Password")
|
||||
hideText: true
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
@@ -24,15 +37,14 @@ Page {
|
||||
delegate: SubtitledItemDelegate {
|
||||
width: parent.width
|
||||
text: model.title
|
||||
subtitle: settings[model.name]
|
||||
subtitle: model.hideText && Settings[model.name] ? qsTr("Hidden") : Settings[model.name]
|
||||
|
||||
onClicked: inputDialog.open()
|
||||
|
||||
Dialog {
|
||||
id: inputDialog
|
||||
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
anchors.centerIn: parent
|
||||
parent: ApplicationWindow.overlay
|
||||
|
||||
focus: true
|
||||
@@ -49,14 +61,15 @@ Page {
|
||||
|
||||
width: parent.width
|
||||
focus: true
|
||||
inputMethodHints: Qt.ImhNoAutoUppercase | model.inputMethodHint
|
||||
inputMethodHints: model.inputMethodHint
|
||||
echoMode: model.hideText ? TextInput.Password : TextInput.Normal
|
||||
placeholderText: model.title
|
||||
text: settings[model.name]
|
||||
text: Settings[model.name]
|
||||
}
|
||||
}
|
||||
|
||||
onAccepted: {
|
||||
settings[model.name] = textField.text
|
||||
Settings[model.name] = textField.text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user