From 7c4a4f5ae0c02f57eb9073fa8f412a38b8f79363 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Tue, 4 Aug 2020 19:28:43 +0200 Subject: Quit if there was an initializaton error Let's close properly without segfaults :) --- gui/qml/main.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gui/qml/main.qml') diff --git a/gui/qml/main.qml b/gui/qml/main.qml index b4aa19a..09bbab5 100644 --- a/gui/qml/main.qml +++ b/gui/qml/main.qml @@ -20,12 +20,14 @@ ApplicationWindow { donate.visible = true } if (ctx.errors ) { - // TODO consider disabling on/off buttons, or quit after closing the dialog if ( ctx.errors == "nohelpers" ) { showInitFailure(qsTr("Could not find helpers. Check your installation")) } else if ( ctx.errors == "nopolkit" ) { showInitFailure(qsTr("Could not find polkit agent.")) } else { + //: %1 -> application name + //: %2 -> error string + showInitFailure(qsTr("Got an error starting %1: %2").arg(ctx.appName).arg(ctx.errors)) console.debug(ctx.errors) } } @@ -248,5 +250,7 @@ ApplicationWindow { title: qsTr("Initialization Error") text: "" visible: false + onAccepted: backend.quit() + onRejected: backend.quit() } } -- cgit v1.2.3