From ed91fe6cddd689382f23167c1136e3a8386df0b5 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 27 Oct 2017 11:19:44 +0200 Subject: Handle host not found --- components/kube/contents/ui/Kube.qml | 5 ++++ components/kube/contents/ui/LogView.qml | 51 +++++++++++++++++++++++++++++++-- 2 files changed, 54 insertions(+), 2 deletions(-) (limited to 'components') diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml index a7451b13..008d4899 100644 --- a/components/kube/contents/ui/Kube.qml +++ b/components/kube/contents/ui/Kube.qml @@ -111,6 +111,11 @@ Controls2.ApplicationWindow { onMessageReceived: kubeViews.setLoginView() } + Kube.Listener { + filter: Kube.Messages.requestAccountsConfiguration + onMessageReceived: kubeViews.setAccountsView() + } + //BEGIN Shortcuts Shortcut { sequence: StandardKey.Quit diff --git a/components/kube/contents/ui/LogView.qml b/components/kube/contents/ui/LogView.qml index 24d42373..75e768d9 100644 --- a/components/kube/contents/ui/LogView.qml +++ b/components/kube/contents/ui/LogView.qml @@ -84,7 +84,9 @@ Controls.SplitView { } details.message = error.message + "\n" + error.details details.timestamp = error.timestamp - details.subtype = currentItem.currentData.subtype + if (!!currentItem.currentData.subtype) { + details.subtype = currentItem.currentData.subtype + } } delegate: Kube.ListDelegate { @@ -163,7 +165,17 @@ Controls.SplitView { property string accountId: retriever.currentData ? retriever.currentData.accountId : "" property string accountName: retriever.currentData ? retriever.currentData.name : "" - sourceComponent: details.subtype == Kube.Notifications.loginError ? loginErrorComponent : detailsComponent + function getComponent(subtype) { + if (subtype == Kube.Notifications.loginError) { + return loginErrorComponent + } + if (subtype == Kube.Notifications.hostNotFoundError) { + return hostNotFoundErrorComponent + } + return detailsComponent + } + + sourceComponent: getComponent(details.subtype) } } @@ -274,4 +286,39 @@ Controls.SplitView { } } } + + Component { + id: hostNotFoundErrorComponent + Item { + Column { + anchors { + top: parent.top + left: parent.left + right: parent.right + } + spacing: Kube.Units.largeSpacing + Column { + Kube.Heading { + id: heading + text: qsTr("Host not found") + color: Kube.Colors.warningColor + } + + Kube.Label { + id: subHeadline + text: accountName + ": " + qsTr("Please check your network connection and settings.") + color: Kube.Colors.disabledTextColor + wrapMode: Text.Wrap + } + } + Kube.Button { + text: qsTr("Account settings") + onClicked: { + Kube.Fabric.postMessage(Kube.Messages.componentDone, {}) + Kube.Fabric.postMessage(Kube.Messages.requestAccountsConfiguration, {}) + } + } + } + } + } } -- cgit v1.2.3