summaryrefslogtreecommitdiff
path: root/gui/qml
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-06-17 21:14:35 +0200
committerkali kaneko (leap communications) <kali@leap.se>2020-06-26 12:13:44 +0200
commit20266b063c1be8818d4582bff7b59486551ee447 (patch)
tree2f7bd97624104e7defecd6d29fff8dad2446c0ce /gui/qml
parent9b8009cfaf6707d23a20494cd5467aed9c98513b (diff)
[feat] pass initialization errors to gui
Diffstat (limited to 'gui/qml')
-rw-r--r--gui/qml/main.qml22
1 files changed, 15 insertions, 7 deletions
diff --git a/gui/qml/main.qml b/gui/qml/main.qml
index 8d756c6..efcfef2 100644
--- a/gui/qml/main.qml
+++ b/gui/qml/main.qml
@@ -11,7 +11,6 @@ ApplicationWindow {
property var ctx
-
Connections {
target: jsonModel
onDataChanged: {
@@ -20,9 +19,24 @@ ApplicationWindow {
console.debug(jsonModel.getJson())
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 {
+ console.debug(ctx.errors)
+ }
+ }
}
}
+ function showInitFailure(msg) {
+ initFailure.text = msg
+ initFailure.visible = true
+ }
+
Component.onCompleted: {
/* stupid as it sounds, windows doesn't like to have the systray icon
not being attached to an actual application window.
@@ -210,9 +224,6 @@ ApplicationWindow {
text: ""
detailedText: ""
visible: false
- //text: ctx ? qsTr("Can't connect to %1").arg(ctx.appName) : ""
- //detailedText: ctx ? ctx.errorStartingMsg : ""
- //visible: ctx.errorStartingMsg != ""
}
MessageDialog {
@@ -222,7 +233,6 @@ ApplicationWindow {
title: qsTr("Missing authentication agent")
text: qsTr("Could not find a polkit authentication agent. Please run one and try again.")
visible: false
- //visible: ctx.missingAuthAgent == "true"
}
MessageDialog {
@@ -232,7 +242,5 @@ ApplicationWindow {
title: qsTr("Initialization Error")
text: ""
visible: false
- //text: ctx ? ctx.errorInitMsg : ""
- //visible: ctx.errorInitMsg != ""
}
}