From 240469600391b63b32df40d31cc85f4581fe458c Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 11 Jul 2017 19:17:47 +0200 Subject: [PATCH] Handle signal when file is choosed --- retroshare-qml-app/src/ContactDetails.qml | 4 ++++ retroshare-qml-app/src/components/CustomFileChooser.qml | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/retroshare-qml-app/src/ContactDetails.qml b/retroshare-qml-app/src/ContactDetails.qml index fdcdca391..07c591ee4 100644 --- a/retroshare-qml-app/src/ContactDetails.qml +++ b/retroshare-qml-app/src/ContactDetails.qml @@ -38,6 +38,10 @@ Item CustomFileChooser { id: fileChooser + onResultFileChanged: + { + console.log("Result file changed! " , resultFile) + } } } diff --git a/retroshare-qml-app/src/components/CustomFileChooser.qml b/retroshare-qml-app/src/components/CustomFileChooser.qml index 5fd75a972..299d7d11f 100644 --- a/retroshare-qml-app/src/components/CustomFileChooser.qml +++ b/retroshare-qml-app/src/components/CustomFileChooser.qml @@ -5,6 +5,8 @@ Item { id: compRoot + property var resultFile + FileDialog { id: fileDialog @@ -14,6 +16,7 @@ Item visible: false onAccepted: { console.log("You chose: " + fileDialog.fileUrls) + resultFile = fileDialog.fileUrls } onRejected: { console.log("Canceled") @@ -26,7 +29,7 @@ Item if (Qt.platform.os === "android") { console.log("ImagePicker Android platform detected") - mainWindow.addUriHandler("/media", androidResult) + mainWindow.addUriHandler("media", androidResult) androidImagePicker.openPicker() } else @@ -38,7 +41,8 @@ Item function androidResult (uri) { console.log("Android image uri found" , uri) - + resultFile = uri + mainWindow.delUriHandler("media", androidResult) }