2024-08-20 16:54:05 +07:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
|
|
|
|
|
import PageEnum 1.0
|
|
|
|
|
import Style 1.0
|
|
|
|
|
|
|
|
|
|
import "./"
|
|
|
|
|
import "../Controls2"
|
|
|
|
|
import "../Controls2/TextTypes"
|
|
|
|
|
import "../Config"
|
|
|
|
|
import "../Components"
|
|
|
|
|
|
|
|
|
|
PageType {
|
|
|
|
|
id: root
|
|
|
|
|
|
2024-12-31 04:16:52 +01:00
|
|
|
BackButtonType {
|
|
|
|
|
id: backButton
|
2024-08-20 16:54:05 +07:00
|
|
|
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
2025-11-11 17:03:27 +03:00
|
|
|
anchors.topMargin: 20 + SettingsController.safeAreaTopMargin
|
2024-08-20 16:54:05 +07:00
|
|
|
}
|
|
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
ListViewType {
|
2024-12-31 04:16:52 +01:00
|
|
|
id: listView
|
|
|
|
|
anchors.top: backButton.bottom
|
2024-08-20 16:54:05 +07:00
|
|
|
anchors.bottom: parent.bottom
|
2024-12-31 04:16:52 +01:00
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
|
|
|
|
|
header: ColumnLayout {
|
|
|
|
|
width: listView.width
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-05-02 23:54:36 -07:00
|
|
|
BaseHeaderType {
|
2024-08-20 16:54:05 +07:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
|
|
|
|
|
headerText: "Dev menu"
|
|
|
|
|
}
|
2024-12-31 04:16:52 +01:00
|
|
|
}
|
|
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
model: 1 // fake model to force the ListView to be created without a model
|
|
|
|
|
|
2024-12-31 04:16:52 +01:00
|
|
|
spacing: 16
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2024-12-31 04:16:52 +01:00
|
|
|
delegate: ColumnLayout {
|
|
|
|
|
width: listView.width
|
2024-08-20 16:54:05 +07:00
|
|
|
|
|
|
|
|
TextFieldWithHeaderType {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: 16
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
|
|
|
|
|
headerText: qsTr("Gateway endpoint")
|
2025-01-24 23:27:01 +07:00
|
|
|
textField.text: SettingsController.gatewayEndpoint
|
2024-08-20 16:54:05 +07:00
|
|
|
|
2025-01-24 23:27:01 +07:00
|
|
|
buttonImageSource: textField.text !== "" ? "qrc:/images/controls/refresh-cw.svg" : ""
|
2024-08-20 16:54:05 +07:00
|
|
|
|
|
|
|
|
clickedFunc: function() {
|
|
|
|
|
SettingsController.resetGatewayEndpoint()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
textField.onEditingFinished: {
|
2025-01-24 23:27:01 +07:00
|
|
|
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
|
|
|
|
|
if (textField.text !== SettingsController.gatewayEndpoint) {
|
|
|
|
|
SettingsController.gatewayEndpoint = textField.text
|
2024-08-20 16:54:05 +07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-31 04:16:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
footer: ColumnLayout {
|
|
|
|
|
width: listView.width
|
2024-09-09 16:27:29 +04:00
|
|
|
|
|
|
|
|
SwitcherType {
|
|
|
|
|
Layout.fillWidth: true
|
2024-12-31 04:16:52 +01:00
|
|
|
Layout.topMargin: 24
|
2024-09-09 16:27:29 +04:00
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
|
|
|
|
|
text: qsTr("Dev gateway environment")
|
|
|
|
|
checked: SettingsController.isDevGatewayEnv
|
|
|
|
|
onToggled: function() {
|
|
|
|
|
SettingsController.isDevGatewayEnv = checked
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-08-20 16:54:05 +07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|