From 3ca0db1022849c0b6991de323c16876c80a1ac87 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 10 May 2019 15:47:50 +0200 Subject: [PATCH] Reset ConnectionPopup before opening it --- qml/ConnectDialog.qml | 6 ++++++ qml/telephant.qml | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/qml/ConnectDialog.qml b/qml/ConnectDialog.qml index e79599c..8357de0 100644 --- a/qml/ConnectDialog.qml +++ b/qml/ConnectDialog.qml @@ -11,6 +11,12 @@ Popup { focus: true closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent + property var reset: function() { + connectSwipeView.currentIndex = 0 + instanceArea.text = "" + codeArea.text = "" + } + ColumnLayout { spacing: 16 anchors.fill: parent diff --git a/qml/telephant.qml b/qml/telephant.qml index 88f1272..f28b32c 100644 --- a/qml/telephant.qml +++ b/qml/telephant.qml @@ -209,7 +209,10 @@ ApplicationWindow { MenuItem { text: qsTr("Connect") - onTriggered: connectDialog.open() + onTriggered: function() { + connectDialog.reset() + connectDialog.open() + } } /* MenuItem {