Friendiqa v0.2.1

This commit is contained in:
LubuWest 2018-04-11 21:50:43 +02:00
commit ee50729e0d
45 changed files with 580 additions and 146 deletions

View file

@ -36,6 +36,8 @@ import "qrc:/js/news.js" as Newsjs
import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/service.js" as Service
//import AndroidNative 1.0
Item {
Connections{
target:newstab
@ -44,18 +46,6 @@ Item {
}
}
// Connections{
// target:root
// onCurrentContactChanged:{
// if (root.newContacts.length>0){
// if(root.currentContact<root.newContacts.length){
// downloadNotice.text= qsTr("Download profile image for ")+ root.newContacts[root.currentContact].name;
// //print(root.newContacts[root.currentContact].name)
// }
// }else{downloadNotice.text=""}
// }
// }
Connections{
target:xhr
// onError:{if (data=="contact"){downloadNotice.text=root.newContacts[root.currentContact].name+"... Error!"}}
@ -63,6 +53,8 @@ Item {
}
}
Timer {id:replytimer; interval: 1000; running: false; repeat: false
onTriggered: {
if(newstab.newstabstatus=="Conversation"){
@ -123,7 +115,11 @@ Item {
newsStack.push({item:"qrc:/qml/newsqml/MessageSend.qml",properties:{"reply_to_user": friend,"directmessage":1,"login":root.login}});
}
function sendUrls(urls){
if((urls.length==1)&&(newsStack.depth<2)){
newsStack.push([newslistRectangle,{item:"qrc:/qml/newsqml/MessageSend.qml",properties:{attachImageURLs:urls}}])
}
}
StackView{
id: newsStack
@ -131,6 +127,7 @@ Item {
property int conversationIndex: 0
initialItem:Rectangle {
id:newslistRectangle
y:1
color: "white"
@ -340,12 +337,23 @@ Item {
root.messageSignal.connect(onFriendsMessages);
root.directmessageSignal.connect(onDirectMessage);
root.newsSignal.connect(showNews);
root.uploadSignal.connect(sendUrls);
try{newsModel.clear()} catch(e){}
if(root.news.length>0){showNews(root.news)}
else{ newstab.newstabstatus=login.newsViewType;
if(login.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}
else{Newsjs.chatsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}
//print("imageUrls "+JSON.stringify(imageUrls)+" newsstack.depth:"+newsStack.depth);
//newsStack.push({item:"qrc:/qml/newsqml/MessageSend.qml",properties:{attachImageURLs:[imageUrl]}})
// var imagePicker = Qt.createQmlObject('import QtQuick 2.0; import "qrc:/qml/genericqml";'+
// osSettings.imagePickQml+'{multiple : true; onReady: {'+
// 'if(imageUrls.length==1){root.currentIndex=0;newstab.active=true;root.uploadSignal(imageUrls)} else{'+
// ' root.currentIndex=2;fotostab.active=true;'+
// 'root.uploadSignal(imageUrls)};}}',newstab,"imagePicker");
//SystemDispatcher.setInitialized();
if(root.news.length>0){showNews(root.news)}
else{ newstab.newstabstatus=login.newsViewType;
if(login.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}
else{Newsjs.chatsfromdb(db,login.username,function(dbnews){showNews(dbnews)})}
}
}
}}
}
}
}