From 4216a4a6ee879406bffe6cc005a8f37cc1914dda Mon Sep 17 00:00:00 2001 From: Kimmo Lindholm Date: Sat, 29 Apr 2017 21:25:21 +0300 Subject: [PATCH] wait until textEntry is available before opening connections --- qml/main.qml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/qml/main.qml b/qml/main.qml index 52055a2..9a261fb 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -258,12 +258,26 @@ ApplicationWindow { id: welcomeDialog WelcomeDialog { property bool __isWelcomeDialog: true - onAccepted: window.openConnections() + onAccepted: openConnectionsTimer.start() Component.onCompleted: NetworkSession.enabled = false Component.onDestruction: NetworkSession.enabled = true } } + Timer { + // If connection gets connected faster than page is loading + // command sending will fail. So we wait a bit. + id: openConnectionsTimer + interval: 100 + onTriggered: { + if (typeof currentPage.textEntry === "undefined") { + openConnectionsTimer.start() + } else { + window.openConnections() + } + } + } + PanelView { id: viewer