Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update device-type pages to provide their own titles #1809

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions components/widgets/DcInputWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ OverviewWidget {
onClicked: {
if (root.inputs.count === 1) {
Global.pageManager.pushPage(root.detailUrl, {
"title": root.inputs.firstObject.name,
"bindPrefix": root.inputs.firstObject.serviceUid
})
} else {
Expand Down Expand Up @@ -83,7 +82,6 @@ OverviewWidget {

onClicked: {
Global.pageManager.pushPage(root.detailUrl, {
"title": model.device.name,
"bindPrefix": model.device.serviceUid
})
}
Expand Down
4 changes: 2 additions & 2 deletions components/widgets/DcLoadsWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ OverviewWidget {
function _showSettingsPage(device) {
if (BackendConnection.serviceTypeFromUid(device.serviceUid) === "dcdc") {
Global.pageManager.pushPage("/pages/settings/devicelist/dc-in/PageDcDcConverter.qml",
{ "title": device.name, "bindPrefix": device.serviceUid })
{ "bindPrefix": device.serviceUid })
} else {
Global.pageManager.pushPage("/pages/settings/devicelist/dc-in/PageDcMeter.qml",
{ "title": device.name, "bindPrefix": device.serviceUid })
{ "bindPrefix": device.serviceUid })
}
}

Expand Down
4 changes: 2 additions & 2 deletions components/widgets/InverterChargerWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ OverviewWidget {
if (Global.inverterChargers.chargerDevices.count) {
const charger = Global.inverterChargers.chargerDevices.firstObject
Global.pageManager.pushPage("/pages/settings/devicelist/PageAcCharger.qml",
{ "bindPrefix": charger.serviceUid, "title": charger.name })
{ "bindPrefix": charger.serviceUid })
} else {
// Show page for inverter, vebus and acsystem services
const device = Global.inverterChargers.firstObject
Global.pageManager.pushPage("/pages/invertercharger/OverviewInverterChargerPage.qml",
{ "serviceUid": device.serviceUid, "title": device.name })
{ "serviceUid": device.serviceUid })
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions pages/battery/BatteryListPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ Page {
})
} else if (batteryDelegate.serviceType === "genset") {
Global.pageManager.pushPage("/pages/settings/devicelist/ac-in/PageAcIn.qml", {
"title": genericDevice.customName,
"bindPrefix": batteryDelegate.device.serviceUid
})
} else {
Expand All @@ -149,11 +148,6 @@ Page {
}
}
}

Device {
id: genericDevice
serviceUid: batteryDelegate.device.instance >= 0 ? batteryDelegate.device.serviceUid : ""
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions pages/invertercharger/InverterChargerListPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Page {
// Show page for chargers
if (model.device.serviceUid.indexOf('charger') >= 0) {
Global.pageManager.pushPage("/pages/settings/devicelist/PageAcCharger.qml",
{ "bindPrefix": model.device.serviceUid, "title": model.device.name })
{ "bindPrefix": model.device.serviceUid })
} else {
// Show page for inverter, vebus and acsystem services
Global.pageManager.pushPage("/pages/invertercharger/OverviewInverterChargerPage.qml",
{ "serviceUid": model.device.serviceUid, "title": model.device.name })
{ "serviceUid": model.device.serviceUid })
}
}

Expand Down
7 changes: 7 additions & 0 deletions pages/invertercharger/OverviewInverterChargerPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ Page {
property string serviceUid
readonly property string serviceType: BackendConnection.serviceTypeFromUid(serviceUid)

title: device.name

Device {
id: device
serviceUid: root.serviceUid
}

VeQuickItem {
id: dcCurrent

Expand Down
7 changes: 7 additions & 0 deletions pages/settings/devicelist/PageAcCharger.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Page {

property string bindPrefix

title: device.name

Device {
id: device
serviceUid: root.bindPrefix
}

GradientListView {
model: ObjectModel {
ListSwitch {
Expand Down
7 changes: 7 additions & 0 deletions pages/settings/devicelist/PageGenset.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ Page {
}
}

title: device.name

Device {
id: device
serviceUid: root.bindPrefix
}

VeQuickItem {
id: productIdDataItem

Expand Down
7 changes: 7 additions & 0 deletions pages/settings/devicelist/PageMeteo.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ Page {
property string bindPrefix
readonly property string settingsPrefix: Global.systemSettings.serviceUid + "/Settings/Service/meteo/" + deviceInstance.value

title: device.name

Device {
id: device
serviceUid: root.bindPrefix
}

VeQuickItem {
id: deviceInstance
uid: bindPrefix + "/DeviceInstance"
Expand Down
7 changes: 7 additions & 0 deletions pages/settings/devicelist/PageMotorDrive.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Page {

property string bindPrefix

title: device.name

Device {
id: device
serviceUid: root.bindPrefix
}

GradientListView {
model: ObjectModel {
ListQuantity {
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/devicelist/ac-in/PageAcInModel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ ObjectModel {
ListNavigation {
text: CommonWords.device_info_title
onClicked: {
Global.pageManager.pushPage(deviceInfoComponent, { "title": text })
Global.pageManager.pushPage(deviceInfoComponent)
}

Component {
Expand Down
7 changes: 7 additions & 0 deletions pages/settings/devicelist/dc-in/PageAlternator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Page {

property string bindPrefix

title: device.name

Device {
id: device
serviceUid: root.bindPrefix
}

VeQuickItem {
id: productIdDataItem

Expand Down
7 changes: 7 additions & 0 deletions pages/settings/devicelist/dc-in/PageDcDcConverter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Page {

property string bindPrefix

title: device.name

Device {
id: device
serviceUid: root.bindPrefix
}

GradientListView {
model: ObjectModel {
ListSwitch {
Expand Down
7 changes: 7 additions & 0 deletions pages/settings/devicelist/dc-in/PageDcMeter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Page {

property alias bindPrefix: dcMeterMode.bindPrefix

title: device.name

Device {
id: device
serviceUid: root.bindPrefix
}

GradientListView {
model: PageDcMeterModel {
id: dcMeterMode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DeviceListDelegate {

onClicked: {
Global.pageManager.pushPage("/pages/settings/devicelist/dc-in/PageDcMeter.qml",
{ "title": text, bindPrefix : root.device.serviceUid })
{ bindPrefix : root.device.serviceUid })
}

VeQuickItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DeviceListDelegate {

onClicked: {
Global.pageManager.pushPage("/pages/settings/devicelist/dc-in/PageAlternator.qml",
{ "title": text, bindPrefix : root.device.serviceUid })
{ bindPrefix : root.device.serviceUid })
}

VeQuickItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DeviceListDelegate {

onClicked: {
Global.pageManager.pushPage("/pages/settings/devicelist/PageAcCharger.qml",
{ "title": text, bindPrefix : root.device.serviceUid })
{ bindPrefix : root.device.serviceUid })
}

VeQuickItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DeviceListDelegate {

onClicked: {
Global.pageManager.pushPage("/pages/settings/devicelist/PageDigitalInput.qml",
{ "title": text, bindPrefix : root.device.serviceUid })
{ bindPrefix : root.device.serviceUid })
}

VeQuickItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DeviceListDelegate {

onClicked: {
Global.pageManager.pushPage("/pages/settings/devicelist/PageMeteo.qml",
{ "title": text, bindPrefix : root.device.serviceUid })
{ bindPrefix : root.device.serviceUid })
}

VeQuickItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DeviceListDelegate {

onClicked: {
Global.pageManager.pushPage("/pages/settings/devicelist/PageMotorDrive.qml",
{ "title": text, bindPrefix : root.device.serviceUid })
{ bindPrefix : root.device.serviceUid })
}

VeQuickItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DeviceListDelegate {

onClicked: {
Global.pageManager.pushPage("/pages/settings/devicelist/pulsemeter/PagePulseCounter.qml",
{ "title": text, bindPrefix : root.device.serviceUid })
{ bindPrefix : root.device.serviceUid })
}

VeQuickItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ DeviceListDelegate {

onClicked: {
Global.pageManager.pushPage("/pages/settings/devicelist/tank/PageTankSensor.qml",
{ "title": text, bindPrefix : root.device.serviceUid })
{ bindPrefix : root.device.serviceUid })
}

VeQuickItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DeviceListDelegate {

onClicked: {
Global.pageManager.pushPage("/pages/settings/devicelist/temperature/PageTemperatureSensor.qml",
{ "title": text, bindPrefix : root.device.serviceUid })
{ bindPrefix : root.device.serviceUid })
}

VeQuickItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ DeviceListDelegate {

onClicked: {
Global.pageManager.pushPage("/pages/settings/devicelist/PageGenset.qml",
{ "title": text, bindPrefix : root.device.serviceUid })
{ bindPrefix : root.device.serviceUid })
}

VeQuickItem {
Expand Down
7 changes: 7 additions & 0 deletions pages/settings/devicelist/pulsemeter/PagePulseCounter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Page {

property string bindPrefix

title: device.name

Device {
id: device
serviceUid: root.bindPrefix
}

GradientListView {
model: ObjectModel {
ListQuantity {
Expand Down
7 changes: 7 additions & 0 deletions pages/settings/devicelist/rs/PageMultiRs.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ Page {
readonly property bool multiPhase: numberOfPhases.isValid && numberOfPhases.value >= 2 && !_phase.isValid
readonly property int trackerCount: numberOfTrackers.value || 0

title: device.name

Device {
id: device
serviceUid: root.bindPrefix
}

VeQuickItem {
id: numberOfPhases
uid: root.bindPrefix + "/Ac/NumberOfPhases"
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/devicelist/rs/PageRsSystemDevices.qml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Page {

onClicked: {
Global.pageManager.pushPage("/pages/settings/devicelist/rs/PageMultiRs.qml",
{ "title": text, "bindPrefix": device.serviceUid })
{ "bindPrefix": device.serviceUid })
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Page {

property string bindPrefix

title: device.name

Device {
id: device
serviceUid: root.bindPrefix
}

VeQuickItem {
id: temperatureType
uid: bindPrefix + "/TemperatureType"
Expand Down
Loading