Models registry was added
This commit is contained in:
@@ -26,13 +26,23 @@ Page {
|
||||
width: parent.width
|
||||
|
||||
text: model.title
|
||||
subtitle: settingsService[model.name]
|
||||
subtitle: model.subtitle || ""
|
||||
|
||||
function valueAccepted() {
|
||||
model.value = editor.value
|
||||
}
|
||||
|
||||
function disconnectDialog() {
|
||||
inputDialog.accepted.disconnect(valueAccepted)
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
inputDialog.title = model.title
|
||||
inputDialog.name = model.name
|
||||
inputDialog.control = controls[model.control]
|
||||
inputDialog.initialValue = model.value
|
||||
inputDialog.choiceModel = model.choiceModel
|
||||
inputDialog.accepted.connect(valueAccepted)
|
||||
inputDialog.closed.connect(disconnectDialog)
|
||||
inputDialog.open()
|
||||
}
|
||||
}
|
||||
@@ -41,8 +51,8 @@ Page {
|
||||
Dialog {
|
||||
id: inputDialog
|
||||
|
||||
property string name: ""
|
||||
property var choiceModel: undefined
|
||||
property var initialValue: undefined
|
||||
property alias control: editor.sourceComponent
|
||||
|
||||
width: root.width * 0.8
|
||||
@@ -60,10 +70,6 @@ Page {
|
||||
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
onAccepted: {
|
||||
settingsService[inputDialog.name] = editor.value
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
@@ -72,10 +78,10 @@ Page {
|
||||
TextField {
|
||||
id: textField
|
||||
|
||||
property alias value: textField.text
|
||||
property string value: text
|
||||
|
||||
inputMethodHints: Qt.ImhNoAutoUppercase
|
||||
text: settingsService[inputDialog.name] || ""
|
||||
text: inputDialog.initialValue || ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +103,7 @@ Page {
|
||||
property var valueId: modelData.id
|
||||
text: modelData.name
|
||||
width: parent.width
|
||||
checked: settingsService[inputDialog.name] === valueId
|
||||
checked: inputDialog.initialValue === valueId
|
||||
ButtonGroup.group: group
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user