From bc9ffbfc8b0edea54e29ae965e9c8eb7a2ff9633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sawicz?= Date: Sun, 31 Jan 2021 12:08:37 +0100 Subject: [PATCH 1/2] Only open Plugin parameters page if it has any --- nymea-app/ui/system/PluginsPage.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nymea-app/ui/system/PluginsPage.qml b/nymea-app/ui/system/PluginsPage.qml index 42b2c33c..1cb7f0ec 100644 --- a/nymea-app/ui/system/PluginsPage.qml +++ b/nymea-app/ui/system/PluginsPage.qml @@ -1,6 +1,6 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* Copyright 2013 - 2020, nymea GmbH +* Copyright 2013 - 2021, nymea GmbH * Contact: contact@nymea.io * * This file is part of nymea. @@ -70,7 +70,7 @@ SettingsPageBase { iconName: "../images/plugin.svg" text: model.name progressive: plugin.paramTypes.count > 0 - onClicked: pageStack.push(Qt.resolvedUrl("PluginParamsPage.qml"), {plugin: plugin}) + onClicked: if (progressive) { pageStack.push(Qt.resolvedUrl("PluginParamsPage.qml"), {plugin: plugin}) } } } } From 756e308598ddf8c5097eee80de151ece1cd19c68 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 31 Jan 2021 15:20:18 +0100 Subject: [PATCH 2/2] Tweak plugin settings pages Fixes: #524 --- nymea-app/ui/system/PluginParamsPage.qml | 28 ++++++++++-------------- nymea-app/ui/system/PluginsPage.qml | 9 +++----- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/nymea-app/ui/system/PluginParamsPage.qml b/nymea-app/ui/system/PluginParamsPage.qml index c9cc74a0..8a2ca538 100644 --- a/nymea-app/ui/system/PluginParamsPage.qml +++ b/nymea-app/ui/system/PluginParamsPage.qml @@ -36,12 +36,12 @@ import "../components" import "../delegates" import Nymea 1.0 -Page { +SettingsPageBase { id: root property var plugin: null header: NymeaHeader { - text: qsTr("%1 settings").arg(plugin.name) + text: plugin.name backButtonVisible: true onBackPressed: pageStack.pop() @@ -66,23 +66,17 @@ Page { } } - Flickable { - anchors.fill: parent - contentHeight: column.implicitHeight + SettingsPageSectionHeader { + text: qsTr("Settings") + } - ColumnLayout { - id: column - width: parent.width + Repeater { + model: plugin.paramTypes - Repeater { - model: plugin.paramTypes - - delegate: ParamDelegate { - Layout.fillWidth: true - paramType: root.plugin.paramTypes.get(index) - param: root.plugin.params.getParam(model.id) - } - } + delegate: ParamDelegate { + Layout.fillWidth: true + paramType: root.plugin.paramTypes.get(index) + param: root.plugin.params.getParam(model.id) } } diff --git a/nymea-app/ui/system/PluginsPage.qml b/nymea-app/ui/system/PluginsPage.qml index 1cb7f0ec..b1669ced 100644 --- a/nymea-app/ui/system/PluginsPage.qml +++ b/nymea-app/ui/system/PluginsPage.qml @@ -51,11 +51,8 @@ SettingsPageBase { } } - Label { - Layout.fillWidth: true - Layout.margins: app.margins - wrapMode: Text.WordWrap - text: qsTr("This list shows the list of installed plugins on this %1 system.").arg(app.systemName) + SettingsPageSectionHeader { + text: qsTr("Installed integration plugins") } Repeater { @@ -66,7 +63,7 @@ SettingsPageBase { delegate: NymeaSwipeDelegate { Layout.fillWidth: true - property var plugin: pluginsProxy.get(index) + property Plugin plugin: pluginsProxy.get(index) iconName: "../images/plugin.svg" text: model.name progressive: plugin.paramTypes.count > 0