Added scrollbars for lists and text fields. Added saving to the path settings for configuration files and the current language. Various UI improvements
This commit is contained in:
@@ -2,6 +2,7 @@ import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Dialogs 1.2
|
||||
import Qt.labs.settings 1.1
|
||||
|
||||
import Controls 1.0 as Controls
|
||||
import Cubo 1.0
|
||||
@@ -20,6 +21,7 @@ RowLayout {
|
||||
id: settingsFlickable
|
||||
clip: true
|
||||
contentHeight: configLayout.height
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
ColumnLayout {
|
||||
id: configLayout
|
||||
@@ -587,9 +589,17 @@ RowLayout {
|
||||
folder: shortcuts.documents
|
||||
nameFilters: [ qsTr("Configuration files (*.xml)"), qsTr("All files (*)") ]
|
||||
onAccepted: {
|
||||
BmsInterface.bmsConfig().loadXml(loadFileDialog.fileUrl.toString().replace(/^(file:\/{3})/, ""), "bmsConfiguration")
|
||||
let result = BmsInterface.bmsConfig().loadXml(loadFileDialog.fileUrl.toString().replace(/^(file:\/{3})/, ""), "bmsConfiguration")
|
||||
if (!result) {
|
||||
BmsInterface.emitStatusMessage(BmsInterface.bmsConfig().xmlStatus(), false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Settings {
|
||||
category: "loadConfiguration"
|
||||
property alias folder: loadFileDialog.folder
|
||||
}
|
||||
}
|
||||
|
||||
Controls.OutlineButton {
|
||||
@@ -604,15 +614,23 @@ RowLayout {
|
||||
folder: shortcuts.documents
|
||||
nameFilters: [ qsTr("Configuration files (*.xml)"), qsTr("All files (*)") ]
|
||||
onAccepted: {
|
||||
BmsInterface.bmsConfig().saveXml(saveFileDialog.fileUrl.toString().replace(/^(file:\/{3})/, ""), "bmsConfiguration")
|
||||
let result = BmsInterface.bmsConfig().saveXml(saveFileDialog.fileUrl.toString().replace(/^(file:\/{3})/, ""), "bmsConfiguration")
|
||||
if (!result) {
|
||||
BmsInterface.emitStatusMessage(BmsInterface.bmsConfig().xmlStatus(), false)
|
||||
} else {
|
||||
BmsInterface.emitStatusMessage(qsTr("BMS configuration saved to file"), true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Settings {
|
||||
category: "saveConfiguration"
|
||||
property alias folder: saveFileDialog.folder
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ScrollBar.vertical: Controls.ScrollBar {
|
||||
// policy: ScrollBar.AlwaysOn
|
||||
}
|
||||
ScrollBar.vertical: Controls.ScrollBar {}
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
@@ -658,7 +676,10 @@ RowLayout {
|
||||
|
||||
Controls.LinkLabel {
|
||||
text: qsTr("Current sensor value \"0\"")
|
||||
onClicked: settingsFlickable.contentY = zeroSensorSettingsFrame.mapToItem(settingsFlickable.contentItem, 0, 0).y
|
||||
onClicked: {
|
||||
settingsFlickable.contentY = zeroSensorSettingsFrame.mapToItem(settingsFlickable.contentItem, 0, 0).y
|
||||
settingsFlickable.returnToBounds()
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
|
||||
Reference in New Issue
Block a user