Add download button to informations tab

This commit is contained in:
2024-09-16 21:08:20 +02:00
parent ff013b8546
commit 90133dd7e0
13 changed files with 109 additions and 24 deletions

View File

@@ -113,6 +113,7 @@ qt_add_qml_module(evcharger-app
qml/NavigationPage.qml
qml/NotificationsPage.qml
qml/OcppPage.qml
qml/OpenLinkButton.qml
qml/PasswordPage.qml
qml/PvSurplusPage.qml
qml/RebootPage.qml
@@ -134,6 +135,7 @@ qt_add_qml_module(evcharger-app
qml/TimePickerDialog.qml
qml/TimePickerLabel.qml
qml/TimePicker.qml
qml/TitleText.qml
qml/VerticalTabButton.qml
qml/WhiteBox.qml
qml/WhiteCheckDelegate.qml
@@ -159,6 +161,7 @@ qt_add_qml_module(evcharger-app
qml/images/geminiFix.png
qml/material-icons/add.svg
qml/material-icons/grid_guides.svg
qml/material-icons/open_in_new.svg
qml/material-icons/settings.svg
qml/ui-icons/MaterialIcons-Regular.ttf
)

View File

@@ -858,10 +858,14 @@
<translation>Verbunden</translation>
</message>
<message>
<location filename="../qml/ControllerTabPage.qml" line="82"/>
<location filename="../build/Desktop-Debug/EVChargerApp/qml/ControllerTabPage.qml" line="82"/>
<location filename="../qml/ControllerTabPage.qml" line="107"/>
<location filename="../build/Desktop-Debug/EVChargerApp/qml/ControllerTabPage.qml" line="107"/>
<source>%0W</source>
<translation>%0W</translation>
</message>
<message>
<source>Category</source>
<translation>Kategorie</translation>
<translation type="vanished">Kategorie</translation>
</message>
</context>
<context>
@@ -1631,6 +1635,21 @@
<translation>Kanal</translation>
</message>
</context>
<context>
<name>InformationsTabPage</name>
<message>
<location filename="../qml/InformationsTabPage.qml" line="15"/>
<location filename="../build/Desktop-Debug/EVChargerApp/qml/InformationsTabPage.qml" line="15"/>
<source>Informations</source>
<translation>Informationen</translation>
</message>
<message>
<location filename="../qml/InformationsTabPage.qml" line="48"/>
<location filename="../build/Desktop-Debug/EVChargerApp/qml/InformationsTabPage.qml" line="48"/>
<source>Download informations</source>
<translation>Informationen herunterladen</translation>
</message>
</context>
<context>
<name>KwhLimitPage</name>
<message>

View File

@@ -19,9 +19,9 @@ NavigationPage {
text: qsTr("Allow access to local HTTP-Api v2")
}
Button {
OpenLinkButton {
text: qsTr("API documentation")
onClicked: Qt.openUrlExternally(qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/http-en.md"))
url: qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/http-en.md")
}
RowLayout {
@@ -115,9 +115,9 @@ NavigationPage {
text: qsTr("API key: %0").arg(cloudApiKey.value)
}
Button {
OpenLinkButton {
text: qsTr("API documentation")
onClicked: Qt.openUrlExternally(qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/cloudapi-en.md"))
url: qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/cloudapi-en.md")
}
}
}
@@ -148,9 +148,9 @@ NavigationPage {
text: qsTr("API key: %0").arg(gridApiKey.value)
}
Button {
OpenLinkButton {
text: qsTr("API documentation")
onClicked: Qt.openUrlExternally(qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/gridapi-en.md"))
url: qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/gridapi-en.md")
}
}
}
@@ -168,9 +168,9 @@ NavigationPage {
text: qsTr("Allow access to legacy HTTP-Api v1")
}
Button {
OpenLinkButton {
text: qsTr("API documentation")
onClicked: Qt.openUrlExternally(qsTr("https://github.com/goecharger/go-eCharger-API-v1/blob/master/go-eCharger%20API%20v1%20EN.md"))
url: qsTr("https://github.com/goecharger/go-eCharger-API-v1/blob/master/go-eCharger%20API%20v1%20EN.md")
}
}
}

View File

@@ -25,14 +25,10 @@ Item {
onClicked: stackView.pop()
}
Text {
TitleText {
Layout.fillWidth: true
id: titleText
font.pixelSize: 30
font.bold: true
wrapMode: Text.Wrap
}
}
}

View File

@@ -65,21 +65,47 @@ AnimatedStackView {
anchors.fill: parent
columns: 3
ApiKeyValueHelper {
id: categoryNames
deviceConnection: theDeviceConnection
apiKey: "ccn"
}
ApiKeyValueHelper {
id: categoryPowers
deviceConnection: theDeviceConnection
apiKey: "ccp"
}
Repeater {
model: 9
model: categoryNames.value
Pane {
property var power: categoryPowers.value[index]
visible: power !== null
Layout.fillWidth: true
Layout.preferredHeight: 50
Layout.preferredWidth: gridLayout.width / 3
Layout.preferredHeight: 75
Component.onCompleted: {
background.color = "grey"
background.radius = 5
}
Text {
ColumnLayout {
id: columnLayout
anchors.fill: parent
text: qsTr("Category")
Text {
Layout.fillWidth: true
text: modelData
}
Text {
Layout.fillWidth: true
text: power !== null ? qsTr("%0W").arg(power) : ""
}
}
}
}

View File

@@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtCharts
import EVChargerApp
ScrollableTabPage {
id: page
@@ -10,6 +11,10 @@ ScrollableTabPage {
return false
}
TitleText {
text: qsTr("Informations")
}
Repeater {
model: 5
@@ -31,4 +36,16 @@ ScrollableTabPage {
}
}
}
OpenLinkButton {
ApiKeyValueHelper {
id: downloadsLink
deviceConnection: theDeviceConnection
apiKey: "dll"
}
visible: downloadsLink.exists
text: qsTr("Download informations")
url: downloadsLink.value
}
}

View File

@@ -20,9 +20,9 @@ NavigationPage {
}
}
Button {
OpenLinkButton {
text: qsTr("API documentation")
onClicked: Qt.openUrlExternally(qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/mqtt-en.md"))
url: qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/mqtt-en.md")
}
WhiteBox {

View File

@@ -20,9 +20,9 @@ NavigationPage {
}
}
Button {
OpenLinkButton {
text: qsTr("API documentation")
onClicked: Qt.openUrlExternally(qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/ocpp-en.md"))
url: qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/ocpp-en.md")
}
WhiteBox {

12
qml/OpenLinkButton.qml Normal file
View File

@@ -0,0 +1,12 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Button {
required property string url
icon.name: "open-in-new"
icon.source: "material-icons/open_in_new.svg"
onClicked: Qt.openUrlExternally(url)
}

9
qml/TitleText.qml Normal file
View File

@@ -0,0 +1,9 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Text {
font.pixelSize: 30
font.bold: true
wrapMode: Text.Wrap
}

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"/></svg>

After

Width:  |  Height:  |  Size: 300 B

View File

@@ -58,6 +58,7 @@ EVChargerApp 1.0 NavigationItem.qml
EVChargerApp 1.0 NavigationPage.qml
EVChargerApp 1.0 NotificationsPage.qml
EVChargerApp 1.0 OcppPage.qml
EVChargerApp 1.0 OpenLinkButton.qml
EVChargerApp 1.0 PasswordPage.qml
EVChargerApp 1.0 PvSurplusPage.qml
EVChargerApp 1.0 RebootPage.qml
@@ -79,6 +80,7 @@ EVChargerApp 1.0 TimeComponentLabel.qml
EVChargerApp 1.0 TimePickerDialog.qml
EVChargerApp 1.0 TimePickerLabel.qml
EVChargerApp 1.0 TimePicker.qml
EVChargerApp 1.0 TitleText.qml
EVChargerApp 1.0 VerticalTabButton.qml
EVChargerApp 1.0 WhiteBox.qml
EVChargerApp 1.0 WhiteCheckDelegate.qml