diff --git a/libnymea-app/types/interfaces.cpp b/libnymea-app/types/interfaces.cpp index a6147d45..9132ae15 100644 --- a/libnymea-app/types/interfaces.cpp +++ b/libnymea-app/types/interfaces.cpp @@ -130,7 +130,7 @@ Interfaces::Interfaces(QObject *parent) : QAbstractListModel(parent) addInterface("extendedevcharger", tr("EV chargers"), {"evcharger"}); addStateType("extendedevcharger", "maxChargingCurrent", QVariant::UInt, true, tr("Maximum charging current"), tr("Maximum charging current changed"), tr("Set maximum charging current")); - addInterface("heating", tr("Heatings")); + addInterface("heating", tr("Heating")); addStateType("heating", "power", QVariant::Bool, true, tr("Heating enabled"), tr("Heating enabled changed"), tr("Enable heating")); addInterface("extendedheating", tr("Heatings"), {"heating"}); diff --git a/nymea-app/platformhelper.cpp b/nymea-app/platformhelper.cpp index e4e283a3..27a97d4d 100644 --- a/nymea-app/platformhelper.cpp +++ b/nymea-app/platformhelper.cpp @@ -30,6 +30,9 @@ #include "platformhelper.h" +#include +#include + PlatformHelper::PlatformHelper(QObject *parent) : QObject(parent) { @@ -85,3 +88,13 @@ void PlatformHelper::setBottomPanelColor(const QColor &color) emit bottomPanelColorChanged(); } } + +void PlatformHelper::toClipBoard(const QString &text) +{ + QApplication::clipboard()->setText(text); +} + +QString PlatformHelper::fromClipBoard() +{ + return QApplication::clipboard()->text(); +} diff --git a/nymea-app/platformhelper.h b/nymea-app/platformhelper.h index 86703b54..d0074ef7 100644 --- a/nymea-app/platformhelper.h +++ b/nymea-app/platformhelper.h @@ -85,6 +85,9 @@ public: Q_INVOKABLE virtual void vibrate(HapticsFeedback feedbackType) = 0; + Q_INVOKABLE virtual void toClipBoard(const QString &text); + Q_INVOKABLE virtual QString fromClipBoard(); + signals: void permissionsRequestFinished(); void screenTimeoutChanged(); diff --git a/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml b/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml index 0c5b7399..b7119a30 100644 --- a/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml +++ b/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml @@ -110,42 +110,36 @@ SettingsPageBase { } } - - Label { - Layout.fillWidth: true - Layout.margins: app.margins + SettingsPageSectionHeader { text: qsTr("Information") - color: app.accentColor } - RowLayout { - Layout.leftMargin: app.margins; Layout.rightMargin: app.margins - Label { - text: qsTr("Vendor:") - Layout.fillWidth: true - } - Label { - text: engine.deviceManager.vendors.getVendor(root.deviceClass.vendorId).displayName - } + + NymeaListItemDelegate { + Layout.fillWidth: true + text: qsTr("Vendor:") + subText: engine.deviceManager.vendors.getVendor(root.deviceClass.vendorId).displayName + progressive: false } - RowLayout { - Layout.leftMargin: app.margins; Layout.rightMargin: app.margins - Label { - text: qsTr("Type:") - Layout.fillWidth: true - } - Label { - text: root.deviceClass.displayName + NymeaListItemDelegate { + Layout.fillWidth: true + text: qsTr("Type:") + subText: root.deviceClass.displayName + progressive: false + } + NymeaListItemDelegate { + Layout.fillWidth: true + text: qsTr("ID:") + subText: root.device.id.toString().replace(/[{}]/g, "") + progressive: false + onClicked: { + PlatformHelper.toClipBoard(root.device.id.toString().replace(/[{}]/g, "")); + ToolTip.show(qsTr("ID copied to clipboard"), 500); } } - Label { - Layout.fillWidth: true - Layout.leftMargin: app.margins - Layout.rightMargin: app.margins - Layout.topMargin: app.margins + SettingsPageSectionHeader { text: qsTr("Parameters") - color: app.accentColor - visible: root.deviceClass.paramTypes.count > 0 + visible: root.device.params.count > 0 } Repeater { @@ -158,13 +152,8 @@ SettingsPageBase { } } - Label { - Layout.fillWidth: true - Layout.leftMargin: app.margins - Layout.rightMargin: app.margins - Layout.topMargin: app.margins + SettingsPageSectionHeader { text: qsTr("Input/Output Connections") - color: app.accentColor visible: ioModel.count > 0 } @@ -224,13 +213,8 @@ SettingsPageBase { } - Label { - Layout.fillWidth: true - Layout.leftMargin: app.margins - Layout.rightMargin: app.margins - Layout.topMargin: app.margins + SettingsPageSectionHeader { text: qsTr("Settings") - color: app.accentColor visible: root.deviceClass.settingsTypes.count > 0 }