fix: settings gpu enum
This commit is contained in:
@@ -25,18 +25,6 @@ PageBase {
|
|||||||
text: qsTr("None")
|
text: qsTr("None")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
readonly property list<string> gpuValues: ["", "NVIDIA", "GENERIC", "None"]
|
|
||||||
|
|
||||||
function gpuKeyToIndex(key: string): int {
|
|
||||||
const u = (key ?? "").trim().toUpperCase();
|
|
||||||
if (u === "")
|
|
||||||
return 0; // Auto
|
|
||||||
if (u === "NVIDIA")
|
|
||||||
return 1;
|
|
||||||
if (u === "GENERIC")
|
|
||||||
return 2;
|
|
||||||
return 3; // None
|
|
||||||
}
|
|
||||||
|
|
||||||
title: qsTr("Services")
|
title: qsTr("Services")
|
||||||
|
|
||||||
@@ -211,7 +199,7 @@ PageBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SelectRow {
|
SelectRow {
|
||||||
active: root.gpuItems[root.gpuKeyToIndex(Config.services.gpuType)]
|
active: root.gpuItems[Config.services.gpuType]
|
||||||
last: true
|
last: true
|
||||||
menuItems: root.gpuItems
|
menuItems: root.gpuItems
|
||||||
menuOnTop: true
|
menuOnTop: true
|
||||||
@@ -219,7 +207,7 @@ PageBase {
|
|||||||
subtext: Gpu.name ? qsTr("Monitoring: %1").arg(Gpu.name) : qsTr("Override for GPU type")
|
subtext: Gpu.name ? qsTr("Monitoring: %1").arg(Gpu.name) : qsTr("Override for GPU type")
|
||||||
text: qsTr("GPU")
|
text: qsTr("GPU")
|
||||||
|
|
||||||
onSelected: item => Config.services.gpuType = root.gpuValues[root.gpuItems.indexOf(item)]
|
onSelected: item => Config.services.gpuType = root.gpuItems.indexOf(item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user