Commit 498c7617 authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

kbd preview: add error description

previously we've only had the error details which is a raw dump of the
output from xkbcomp, give it some nice context so users know what's
going on
parent 3e49c920
......@@ -119,6 +119,7 @@ int main(int argc, char *argv[])
memset(&componentNames, 0, sizeof(XkbComponentNamesRec));
XkbRF_GetComponents(rules, &varDefs, &componentNames);
QString errorDescription;
QString errorDetails;
std::unique_ptr<Geometry> geometry;
......@@ -143,6 +144,11 @@ int main(int argc, char *argv[])
errorDescription = i18nc("@label",
"The keyboard geometry failed to load."
" This often indicates that the selected model does not support a specific layout"
" or layout variant."
" This problem will likely also present when you try to use this combination of model, layout and variant.");
errorDetails = xkbcomp.readAllStandardOutput();
} else {
......@@ -172,6 +178,7 @@ int main(int argc, char *argv[])
}, Qt::QueuedConnection);
engine.rootContext()->setContextProperty("geometry", geometry.get());
engine.rootContext()->setContextProperty("errorDescription", errorDescription);
engine.rootContext()->setContextProperty("errorDetails", errorDetails);
......@@ -62,6 +62,13 @@ Window {
visible: false
anchors.fill: parent
Label {
Layout.fillWidth: true
text: errorDescription
color: activePalette.text
wrapMode: Text.WordWrap
TextArea {
Layout.fillWidth: true
text: errorDetails
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment