Friendiqa/source-linux/qml/genericqml/IntentReceiver.qml

47 lines
1.6 KiB
QML
Raw Normal View History

2018-04-22 21:12:40 +02:00
import QtQuick 2.0
import AndroidNative 1.0
Item {
2018-08-25 16:17:09 +02:00
id:intent
2018-04-22 21:12:40 +02:00
/// The URL of the image chosen. If multiple images are picked, it will be equal to the first image.
property string imageUrl: ""
/// A list of images chosen
property var imageUrls: []
property string m_TEXT_MESSAGE: "androidnative.TextIntent.chosen";
property string m_IMAGE_MESSAGE: "androidnative.ImagePicker.chosen";
Connections {
target: SystemDispatcher
onDispatched: {
2018-08-25 16:17:09 +02:00
if ((type === m_IMAGE_MESSAGE)&& (root.imagePicking==false)) {
2018-04-22 21:12:40 +02:00
var h=[];
for (var n in message.imageUrls){
h.push("file://"+ decodeURIComponent(message.imageUrls[n]).substring(5))
}
imageUrls=h;
if(imageUrls.length==1){
2019-06-25 20:59:10 +02:00
rootstack.currentIndex=0;newstab.active=true;
2018-04-22 21:12:40 +02:00
root.uploadSignal(imageUrls)
} else{
2019-06-25 20:59:10 +02:00
rootstack.currentIndex=2;fotostab.active=true;
2018-04-22 21:12:40 +02:00
root.uploadSignal(imageUrls)
}
} else if (type==m_TEXT_MESSAGE){
2019-06-25 20:59:10 +02:00
rootstack.currentIndex=0;newstab.active=true;
2018-04-22 21:12:40 +02:00
root.sendtextSignal(message)
}
}
}
Component.onCompleted: {
SystemDispatcher.setInitialized();
2020-01-27 21:53:51 +01:00
// if (root.globaloptions.hasOwnProperty("syncinterval") && root.globaloptions.syncinterval !=null && root.globaloptions.syncinterval !=0){
// alarm.setAlarm(root.globaloptions.syncinterval);
// }
2018-04-22 21:12:40 +02:00
}
}