From 0ca3e35e33d847361257d7cdfa451876a1eb169a Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 21 Jul 2017 18:48:23 +0200 Subject: [PATCH] Set a button to open chat from contact details --- retroshare-qml-app/src/ContactDetails.qml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/retroshare-qml-app/src/ContactDetails.qml b/retroshare-qml-app/src/ContactDetails.qml index 5f384eb2e..e7eea713b 100644 --- a/retroshare-qml-app/src/ContactDetails.qml +++ b/retroshare-qml-app/src/ContactDetails.qml @@ -33,15 +33,25 @@ Item { id: avatarPicker - text: "Change your Avatar" - visible: isOwn + text: (isOwn)? qsTr("Change your Avatar") : qsTr("Start Chat!") anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter onClicked: { - fileChooser.open() + if (isOwn) fileChooser.open() + else startDistantChat () + } + function startDistantChat () + { + ChatCache.chatHelper.startDistantChat(ChatCache.contactsCache.own.gxs_id, + cntDt.md.gxs_id, + cntDt.md.name, + function (chatId) + { + stackView.push("qrc:/ChatView.qml", {'chatId': chatId}) + }) } CustomFileChooser { @@ -73,7 +83,7 @@ Item gxs_id: cntDt.md.gxs_id - anchors.top: (isOwn)? avatarPicker.bottom : parent.top + anchors.top: avatarPicker.bottom anchors.topMargin: 6 anchors.horizontalCenter: parent.horizontalCenter }