1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

OP-1119 Added more gui elements. Fixed layouts and alignments.

This commit is contained in:
m_thread 2013-11-21 12:10:06 +01:00
parent 72d1744676
commit e693d94637

View File

@ -1,4 +1,4 @@
import QtQuick 2.0
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0
@ -12,30 +12,6 @@ Rectangle {
anchors.fill: parent
anchors.margins: 10
spacing: 10
RowLayout {
Layout.fillWidth: true
spacing: 10
ColumnLayout {
Layout.fillWidth: true
spacing: 10
height: 40
Text {
id: totalFlights
font.pixelSize: 12
text: "<b>" + qsTr("Flights recorded: ") + "</b>" + logStatus.Flight
}
Text {
id: totalEntries
font.pixelSize: 12
text: "<b>" + qsTr("Logs slots used: ") + "</b>" + logStatus.UsedSlots
}
Text {
id: freeEntries
font.pixelSize: 12
text: "<b>" + qsTr("Logs slots left: ") + "</b>" + logStatus.FreeSlots
}
}
}
ScrollView {
Layout.fillWidth: true
@ -54,6 +30,79 @@ Rectangle {
}
}
RowLayout {
Layout.fillWidth: true
spacing: 10
ColumnLayout {
spacing: 10
height: 40
Text {
id: totalFlights
font.pixelSize: 12
text: "<b>" + qsTr("Flights recorded: ") + "</b>" + (logStatus.Flight + 1)
}
Text {
id: totalEntries
font.pixelSize: 12
text: "<b>" + qsTr("Logs slots used: ") + "</b>" + logStatus.UsedSlots
}
Text {
id: freeEntries
font.pixelSize: 12
text: "<b>" + qsTr("Logs slots left: ") + "</b>" + logStatus.FreeSlots
}
}
Rectangle {
Layout.fillWidth: true
}
ColumnLayout {
spacing: 10
height: 40
RowLayout {
Rectangle {
Layout.fillWidth: true
}
Text {
font.pixelSize: 12
text: "<b>" + qsTr("Flight to download:") + "</b>"
}
ComboBox {
id: flightCombo
property ListModel dataModel: ListModel {}
model: dataModel
Component.onCompleted: {
dataModel.append({"value": "All"})
for (var a = 0; a <= logStatus.Flight ; a++) {
dataModel.append({"value": (a + 1).toString()})
}
}
}
}
RowLayout {
Layout.fillWidth: true
Layout.fillHeight: true
Rectangle {
Layout.fillWidth: true
}
Button {
text: qsTr("Download logs")
activeFocusOnPress: true
onClicked: logManager.retrieveLogs(flightCombo.currentIndex - 1)
}
}
}
}
Rectangle {
border.width: 1
height: 2
width: parent.width
anchors.margins: 20
anchors.horizontalCenter: parent.horizontalCenter
border.color: "#adadad"
}
RowLayout {
Layout.fillWidth: true
height: 40
@ -63,11 +112,9 @@ Rectangle {
activeFocusOnPress: true
onClicked: logManager.exportLogs()
}
Rectangle {
Layout.fillWidth: true
}
Button {
id: okButton
text: qsTr("OK")