diff --git a/CMakeLists.txt b/CMakeLists.txt index 3987720..4bf43e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ) diff --git a/i18n/qml_de.ts b/i18n/qml_de.ts index dbb0c32..cd06fbe 100644 --- a/i18n/qml_de.ts +++ b/i18n/qml_de.ts @@ -858,10 +858,14 @@ Verbunden - - + + + %0W + %0W + + Category - Kategorie + Kategorie @@ -1631,6 +1635,21 @@ Kanal + + InformationsTabPage + + + + Informations + Informationen + + + + + Download informations + Informationen herunterladen + + KwhLimitPage diff --git a/qml/ApiSettingsPage.qml b/qml/ApiSettingsPage.qml index 610c706..e86d70b 100644 --- a/qml/ApiSettingsPage.qml +++ b/qml/ApiSettingsPage.qml @@ -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") } } } diff --git a/qml/BaseNavigationPage.qml b/qml/BaseNavigationPage.qml index 2e80e97..7f0a8b3 100644 --- a/qml/BaseNavigationPage.qml +++ b/qml/BaseNavigationPage.qml @@ -25,14 +25,10 @@ Item { onClicked: stackView.pop() } - Text { + TitleText { Layout.fillWidth: true id: titleText - - font.pixelSize: 30 - font.bold: true - wrapMode: Text.Wrap } } } diff --git a/qml/ControllerTabPage.qml b/qml/ControllerTabPage.qml index 00de53a..0df6505 100644 --- a/qml/ControllerTabPage.qml +++ b/qml/ControllerTabPage.qml @@ -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) : "" + } } } } diff --git a/qml/InformationsTabPage.qml b/qml/InformationsTabPage.qml index e000ec4..0cac569 100644 --- a/qml/InformationsTabPage.qml +++ b/qml/InformationsTabPage.qml @@ -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 + } } diff --git a/qml/MqttPage.qml b/qml/MqttPage.qml index 173922c..256fa98 100644 --- a/qml/MqttPage.qml +++ b/qml/MqttPage.qml @@ -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 { diff --git a/qml/OcppPage.qml b/qml/OcppPage.qml index 019224b..4a06bc8 100644 --- a/qml/OcppPage.qml +++ b/qml/OcppPage.qml @@ -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 { diff --git a/qml/OpenLinkButton.qml b/qml/OpenLinkButton.qml new file mode 100644 index 0000000..3dd6713 --- /dev/null +++ b/qml/OpenLinkButton.qml @@ -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) +} diff --git a/qml/TitleText.qml b/qml/TitleText.qml new file mode 100644 index 0000000..61544b2 --- /dev/null +++ b/qml/TitleText.qml @@ -0,0 +1,9 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +Text { + font.pixelSize: 30 + font.bold: true + wrapMode: Text.Wrap +} diff --git a/qml/material-icons/open_in_new.svg b/qml/material-icons/open_in_new.svg new file mode 100644 index 0000000..ef3fe20 --- /dev/null +++ b/qml/material-icons/open_in_new.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/qml/qmldir b/qml/qmldir index 5cd9771..8355f42 100644 --- a/qml/qmldir +++ b/qml/qmldir @@ -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 diff --git a/update_qmldir.sh b/qml/update_qmldir.sh similarity index 100% rename from update_qmldir.sh rename to qml/update_qmldir.sh