Commit da7b1977 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Show a full error page to indicate that the resource wasn't found

BUG: 391756
parent 1e76a2f2
......@@ -229,7 +229,7 @@ void DiscoverObject::openApplication(const QUrl& url)
emit openApplicationInternal(res.first());
} else {
rootObject()->setProperty("defaultStartup", true);
showPassiveNotification(i18n("Couldn't open %1", url.toDisplayString()));
Q_EMIT openErrorPage(i18n("Couldn't open %1", url.toDisplayString()));
}
});
}
......
......@@ -81,6 +81,7 @@ class DiscoverObject : public QObject
void compactModeChanged(CompactMode compactMode);
void preventedClose();
void unableToFind(const QString &resid);
void openErrorPage(const QString &errorMessage);
private:
void integrateObject(QObject* object);
......
......@@ -117,6 +117,12 @@ Kirigami.ApplicationWindow
Navigation.openApplicationList({search: search})
}
onOpenErrorPage: {
Navigation.clearStack()
console.warn("error", errorMessage)
window.stack.push(errorPageComponent, { error: errorMessage, title: i18n("Sorry...") })
}
onPreventedClose: showPassiveNotification(i18n("Could not close the application, there are tasks that need to be done."))
onUnableToFind: {
showPassiveNotification(i18n("Unable to find resource: %1", resid));
......@@ -132,6 +138,20 @@ Kirigami.ApplicationWindow
}
}
Component {
id: errorPageComponent
Kirigami.Page {
id: page
property string error: ""
Kirigami.Heading {
text: page.error
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
}
Component {
id: proceedDialog
Kirigami.OverlaySheet {
......
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