69 lines
2.0 KiB
QML
69 lines
2.0 KiB
QML
import QtQuick 2.12
|
|
import QtQuick.Controls 2.12
|
|
import QtQuick.Layouts 1.12
|
|
import "settings"
|
|
|
|
Dialog {
|
|
id: dlg
|
|
modal: true
|
|
title: "Настройки"
|
|
width: Math.min(720, parent ? parent.width * 0.95 : 720)
|
|
height: Math.min(560, parent ? parent.height * 0.95 : 560)
|
|
anchors.centerIn: parent
|
|
standardButtons: Dialog.Close
|
|
|
|
StackView {
|
|
id: stack
|
|
anchors.fill: parent
|
|
initialItem: mainPageComp
|
|
}
|
|
|
|
Component {
|
|
id: mainPageComp
|
|
MainPage {
|
|
onOpenButtons: stack.push(buttonsPageComp)
|
|
onOpenLayout: stack.push(layoutPageComp)
|
|
onOpenBackground: stack.push(backgroundPageComp)
|
|
onOpenFeedback: stack.push(feedbackPageComp)
|
|
onOpenNetwork: stack.push(networkPageComp)
|
|
onOpenUpdate: stack.push(updatePageComp)
|
|
onChangePassword: changePwdDialog.open()
|
|
}
|
|
}
|
|
|
|
Component {
|
|
id: buttonsPageComp
|
|
ButtonsPage {
|
|
onCreateRequested: editorDialog.openForCreate()
|
|
onEditRequested: function(data) { editorDialog.openForEdit(data) }
|
|
}
|
|
}
|
|
|
|
Component { id: layoutPageComp; LayoutPage {} }
|
|
Component { id: backgroundPageComp; BackgroundPage {} }
|
|
Component { id: feedbackPageComp; FeedbackPage {} }
|
|
Component { id: networkPageComp; NetworkInfoPage {} }
|
|
Component { id: updatePageComp; UpdatePage {} }
|
|
|
|
ButtonEditorDialog { id: editorDialog }
|
|
|
|
Dialog {
|
|
id: changePwdDialog
|
|
modal: true
|
|
title: "Сменить пароль"
|
|
anchors.centerIn: parent
|
|
standardButtons: Dialog.Ok | Dialog.Cancel
|
|
TextField {
|
|
id: newPwdField
|
|
anchors.fill: parent
|
|
placeholderText: "Новый пароль"
|
|
echoMode: TextInput.Password
|
|
}
|
|
onAccepted: {
|
|
if (newPwdField.text.length > 0)
|
|
btnController.setPassword(newPwdField.text)
|
|
newPwdField.text = ""
|
|
}
|
|
}
|
|
}
|