This commit is contained in:
pankraz 2017-11-07 21:57:40 +01:00
commit 7e37546ae9
108 changed files with 6063 additions and 1450 deletions

View file

@ -1,74 +0,0 @@
import QtQuick 2.0
import Qt.labs.folderlistmodel 2.1
import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
Rectangle{
id:attachmentDialog
z:2
border.color: "grey"
width: parent.width-4*mm
height:parent.height-12*mm
x:2*mm
y:10*mm
property var parsedAttachments: JSON.parse(attachedobjects)
Text{
x:0.5*mm
y:0.5*mm
width: imageDialog-8*mm
elide:Text.ElideRight
text: "Attachments:"
}
BlueButton{
id:closeButton
anchors.top: parent.top
anchors.topMargin: 1*mm
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
onClicked:{attachmentDialog.destroy()}
}
ListView {
id: attachmentView
x:0.5*mm
y:5.5*mm
width: attachmentDialog.width-2*mm
height: attachmentDialog.height-14*mm
clip: true
spacing:0
model: attachmentModel
delegate: attachmentItem
}
ListModel{id: attachmentModel}
Component { id:attachmentItem
Rectangle{
border.color: "#EEEEEE"
border.width: 1
width:parent.width
height:6*mm
Text{
font.pixelSize: 3*mm
x: mm
text:attachment.name
}
MouseArea{
anchors.fill: parent
onClicked:{
Qt.openUrlExternally(attachment.url)
}
}
}}
}
Component.onCompleted: {
for (var a in parsedAttachments){
attachmentModel.append({"attachment":parsedAttachments[a]})
}
}
}

View file

@ -1,26 +1,18 @@
// ConversationView with button
import QtQuick 2.0
import QtQuick.Controls 1.2
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
Rectangle {
id:conversationList
property var news
//property var news
y:1
z:2
color: "white"
border.color: "grey"
width:root.width-5*mm
height: conversationView.height+10*mm
Connections{
target:newstab
onConversationChanged:{
if(newstab.conversation.length==0){
newsView.positionViewAtIndex(newsStack.conversationIndex,ListView.Beginning);
conversationList.destroy(); conversationsymbol.color="grey"
}
}
}
ListView {
id: conversationView
@ -34,6 +26,32 @@ Rectangle {
model: conversationModel
delegate: Newsitem{}
}
BusyIndicator{
id: conversationBusy
anchors.horizontalCenter: conversationView.horizontalCenter
anchors.top:conversationList.top
anchors.topMargin: 2*mm
width:10*mm
height: 10*mm
running: true
}
Connections{
target:newstab
onConversationChanged:{
if(newsitem.itemindex==newsStack.conversationIndex){
if(newstab.conversation.length==0){
newsView.positionViewAtIndex(newsStack.conversationIndex,ListView.Beginning);
conversationList.destroy(); conversationsymbol.color="grey"
} else { conversationBusy.running=false;
conversationModel.clear();
var currentTime= new Date();
var msg = {'currentTime': currentTime, 'model': conversationModel,'news':newstab.conversation};
conversationWorker.sendMessage(msg)
conversationsymbol.color="grey"}
}
}
}
Component { id:footerReply
Rectangle{
@ -117,9 +135,9 @@ Rectangle {
}
}
Component.onCompleted: {
var currentTime= new Date();
var msg = {'currentTime': currentTime, 'model': conversationModel,'news':news};
conversationWorker.sendMessage(msg)
}
// Component.onCompleted: {
// if (news){var currentTime= new Date();
// var msg = {'currentTime': currentTime, 'model': conversationModel,'news':news};
// conversationWorker.sendMessage(msg)}
// }
}

View file

@ -1,4 +1,4 @@
// List if people from Friendica Activities
// List of people from Friendica Activities
import QtQuick 2.0
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
@ -51,11 +51,7 @@ Rectangle {
MouseArea{
anchors.fill: parent
onClicked:{
try {root.currentIndex=1;
friendstab.active=true;
root.contactdetailsSignal(contact)
} catch(e) {Helperjs.showMessage("Error",e,root)}}
onClicked:{showContact(contact)}
}
}}

View file

@ -1,121 +0,0 @@
import QtQuick 2.0
import QtQuick.Controls 1.2
import Qt.labs.folderlistmodel 2.1
import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
Rectangle{
id:imageDialog
z:2
border.color: "grey"
width: parent.width-4*mm
height:parent.height-12*mm
x:2*mm
y:10*mm
property string directory: ""
Text{
id:directoryText
x:0.5*mm
y:0.5*mm
width: imageDialog.width-15*mm
height:contentHeight
wrapMode: Text.Wrap
text: directory
}
BlueButton{
id:closeButton
anchors.top: parent.top
anchors.topMargin: 1*mm
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
onClicked:{imageDialog.destroy()}
}
ListView {
id: imageView
x:0.5*mm
y:directoryText.height+mm
width: imageDialog.width-2*mm
height: imageDialog.height-directoryText.height-4*mm
clip: true
model: imageModel
delegate: imageItem
}
FolderListModel{
id: imageModel
nameFilters: ["*.png", "*.jpg",".jpeg","*.JPG","*.gif"]
sortField: FolderListModel.Time
sortReversed:false
showDotAndDotDot: true
showDirs: true
showDirsFirst: true
folder:directory
}
BusyIndicator{
id: imageBusy
anchors.horizontalCenter: imageView.horizontalCenter
anchors.top:imageView.top
anchors.topMargin: 2*mm
width:10*mm
height: 10*mm
running:false
}
Component{
id:imageItem
Item{
width:imageView.width
height:folderImage.height+2*mm
Rectangle{
id:imagetextRectangle
color:"black"
x:mm
z:3
opacity: fileIsDir?0:0.5
width:imagetext.contentWidth
height: imagetext.contentHeight
anchors.bottom: folderImage.bottom
}
Text {
id:imagetext
x:fileIsDir?11*mm:mm
z:4
text: fileName
width: fileIsDir?parent.width - 12*mm :imageView.width-mm
anchors.bottom: folderImage.bottom
color: fileIsDir?"black":"white"
font.pixelSize: 3*mm
wrapMode:Text.Wrap
}
Image{id:folderImage
width: fileIsDir?10*mm: imageView.width-mm
fillMode:Image.PreserveAspectFit
source:fileIsDir?"qrc:/images/folder-blue.png":fileURL
}
MouseArea{
anchors.fill: parent
onClicked:{
if (fileName==".."){
imageModel.folder=imageModel.parentFolder;
directory=imageModel.parentFolder
}
else if (fileIsDir){
imageModel.folder=fileURL;
directory=fileURL
}
else{
attachImageURLs.push(fileURL);
attachImage(fileURL);
imageDialog.destroy()
}
}
}
}
}
}

View file

@ -26,10 +26,8 @@ Flickable{
property var group_deny:login.permissions[3]
function attachImage(url){
//onAttachImageURLsChanged: {if(attachImageURL!=""){
var imageAttachmentObject=Qt.createQmlObject('import QtQuick 2.0; Image {id:imageAttachment'+attachImageURLs.length+'; source:"'+
url.toString()+'"; width: 15*mm; height: 15*mm;fillMode: Image.PreserveAspectFit;MouseArea{anchors.fill:parent;onClicked:{attachImageURLs.splice(attachImageURLs.indexOf("'+url+'",1)); imageAttachment'+attachImageURLs.length+'.destroy()}}}',messageColumn,"attachedImage");
console.log("You chose: " + url)
var imageAttachmentObject=Qt.createQmlObject('import QtQuick 2.0; Image {id:imageAttachment'+attachImageURLs.length+'; source:"'+
url.toString()+'"; width: 15*mm; height: 15*mm;fillMode: Image.PreserveAspectFit;MouseArea{anchors.fill:parent;onClicked:{attachImageURLs.splice(attachImageURLs.indexOf("'+url+'"),1); imageAttachment'+attachImageURLs.length+'.destroy()}}}',messageColumn,"attachedImage");
}
function statusUpdate(title,status,in_reply_to_status_id,attachImageURL) {
@ -125,12 +123,21 @@ Flickable{
}
Row{
ImagePicker {
id: imagePicker;
multiple : false
onReady: {
attachImageURLs.push(imagePicker.imageUrl);
attachImage(imagePicker.imageUrl)
}
}
spacing:2
BlueButton{id:permButton
visible: (directmessage==1)?false:true
text: ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))?"\uf09c":"\uf023"
onClicked: {
var component = Qt.createComponent("qrc:/qml/newsqml/PermissionDialog.qml");
var component = Qt.createComponent("qrc:/qml/genericqml/PermissionDialog.qml");
var permissions = component.createObject(messageColumn);
}}
BlueButton {
@ -142,9 +149,10 @@ Flickable{
Helperjs.showMessage( qsTr("Error"),qsTr("Only one attachment supported at the moment.\n Remove other attachment first!"), messageColumn)
}
else{
var defaultDirectory="file://"+osSettings.attachImageDir;
var component = Qt.createComponent("qrc:/qml/newsqml/ImageDialog.qml");
var imagedialog = component.createObject(messageSend,{"directory": defaultDirectory});
//var defaultDirectory="file://"+osSettings.attachImageDir;
//var component = Qt.createComponent("qrc:/qml/genericqml/ImageDialog.qml");
//var imagedialog = component.createObject(messageSend,{"directory": defaultDirectory});
imagePicker.pickImage()
}
}
}
@ -159,7 +167,7 @@ Flickable{
if(Helperjs.getCount(db,login,"contacts","screen_name",contacts[i].screen_name)>1){
contacts[i].screen_name=contacts[i].screen_name+"+"+contacts[i].cid
}
contactitems=contactitems+"MenuItem{text:'"+contacts[i].screen_name+"';iconSource:'"+contacts[i].profile_image+"'; onTriggered: bodyField.insert(0,' @"+contacts[i].screen_name+"+"+contacts[i].cid+" ')}"
contactitems=contactitems+"MenuItem{text:'"+contacts[i].screen_name+"';iconSource:'"+contacts[i].profile_image+"'; onTriggered: bodyField.insert(0,' @"+contacts[i].screen_name+" ')}"
}}
var menuString="import QtQuick.Controls 1.4; Menu {"+contactitems+"}";
var contactlistObject=Qt.createQmlObject(menuString,messageSend,"contactmenuOutput")
@ -171,7 +179,6 @@ Flickable{
text: "\uf118"
onClicked: {
var smileyarray=Smileyjs.smileys
//print(JSON.stringify(smileyarray[0]))
var component = Qt.createComponent("qrc:/qml/newsqml/SmileyDialog.qml");
var smileydialog = component.createObject(messageColumn)
}}

View file

@ -33,13 +33,16 @@ Item {
}
Timer {id:replytimer; interval: 1000; running: false; repeat: false
onTriggered: {if(newstab.newstabstatus=="Conversation"){
showConversation(newsStack.timelineIndex-1,newsModel.get(0).newsitemobject)} else{
onTriggered: {
if(newstab.newstabstatus=="Conversation"){
showConversation(newsStack.timelineIndex-1,newsModel.get(0).newsitemobject)}
else{
var onlynew=true;
Newsjs.getFriendsTimeline(login,db,contactlist,onlynew,newstab,function(rns,rnc){
root.contactLoadType="news";
root.news=rns;root.newContacts=rnc;root.currentContact=0})
}}
}
}
}
@ -53,7 +56,7 @@ Item {
}
function showConversation(conversationIndex,newsitemobject){
newsBusy.running=true;
//newsBusy.running=true;
root.contactLoadType="conversation";
newsStack.conversationIndex= conversationIndex;
if(newsitemobject.messagetype==0){
@ -65,6 +68,13 @@ Item {
})}
}
function showContact(contact){
var component = Qt.createComponent("qrc:/qml/contactqml/ContactDetailsComponent.qml");
if (component.status== Component.Ready){
var contactDetails = component.createObject(newstab,{"contact": contact})
}
}
function onFriendsMessages(friend){
newstab.newstabstatus="Contact"
Newsjs.newsfromdb(db,root.login.username, function(dbnews){showNews(dbnews)},friend)
@ -75,6 +85,8 @@ Item {
newsStack.push({item:"qrc:/qml/newsqml/MessageSend.qml",properties:{"reply_to_user": friend,"directmessage":1,"login":root.login}});
}
StackView{
id: newsStack
anchors.fill:parent
@ -100,7 +112,6 @@ Item {
BlueButton {
id: newMessageButton
width:10*mm
text: "\uf040"
onClicked: {
var groups=[];
@ -115,7 +126,6 @@ Item {
}
BlueButton {
id: quitButton
width:10*mm
text: "\uf08b"
onClicked: {Service.cleanNews(root.db,function(){Qt.quit() })}
}
@ -127,6 +137,7 @@ Item {
newstab.newstabstatus=login.newsViewType;
root.contactLoadType="news";
var onlynew=true;
//print("newstab "+ JSON.stringify(contactlist));
Newsjs.getFriendsTimeline(login,db,contactlist,onlynew,newstab,function(ns,nc){
root.news=ns;root.newContacts=nc;root.currentContact=0;
if (ns.length==0){// update last 20 existing news for changes and likes
@ -153,29 +164,29 @@ Item {
}
MouseArea{anchors.fill:parent
onClicked:{
var currentTime= new Date();
if(newstab.newstabstatus=="Timeline"){
var lastnews_id=newsModel.get(newsModel.count-1).newsitemobject.created_at;
var currentTime= new Date();
var lastnews_id=newsModel.get(newsModel.count-1).newsitemobject.created_at;
print("Lastnews ID "+lastnews_id+Qt.atob(newsModel.get(newsModel.count-1).newsitemobject.statusnet_html))
if(newstab.newstabstatus=="Timeline"){
Newsjs.newsfromdb(root.db,root.login.username, function(news){
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
newsWorker.sendMessage(msg);
},false,lastnews_id)}
if(newstab.newstabstatus=="Conversations"){
var lastnews_id=newsModel.get(newsModel.count-1).newsitemobject.created_at;
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
newsWorker.sendMessage(msg);
},false,lastnews_id)}
if(newstab.newstabstatus=="Conversations"){
Newsjs.chatsfromdb(root.db,root.login.username, function(news){
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
newsWorker.sendMessage(msg);
},lastnews_id)}
else if(newstab.newstabstatus=="Contact"){
Newsjs.newsfromdb(root.db,root.login.username, function(news){
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
newsWorker.sendMessage(msg);
},newsModel.get(newsModel.count-1).newsitemobject.uid,newsModel.get(newsModel.count-1).newsitemobject.created_at)}
}}
}
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
newsWorker.sendMessage(msg);
},lastnews_id)}
else if(newstab.newstabstatus=="Contact"){
Newsjs.newsfromdb(root.db,root.login.username, function(news){
var msg = {'currentTime': currentTime, 'model': newsModel,'news':news,'appendnews':true};
newsWorker.sendMessage(msg);
},newsModel.get(newsModel.count-1).newsitemobject.uid,lastnews_id)}
}
}
}
}
ListView {
id: newsView
anchors.fill: parent
@ -187,8 +198,8 @@ Item {
footer: footerComponent
model: newsModel
delegate: Newsitem{}
//onContentYChanged:{if(contentY<-15*mm&&contentY>(-15*mm-1)){print("refreshing");
onDragEnded:{if(contentY<-8*mm){//print("refreshing");
//onContentYChanged:{if(contentY<-8*mm&&contentY>(-8*mm-1)){print("refreshing");
onDragEnded:{if(contentY<-5*mm){//print("refreshing");
newsBusy.running=true;
newstab.newstabstatus=login.newsViewType;
root.contactLoadType="news";

View file

@ -10,21 +10,8 @@ Item {
width: parent.width
height:toprow.height+friendicaActivities.height+controlrow.height+1//Math.max((itemMessage.height+topFlow.height+friendicaActivities.height+4*mm),profileImage.height+user_name.height+mm)
Connections{
target:newstab
onConversationChanged:{
newsBusy.running=false;
if(index==newsStack.conversationIndex){
if(newstab.conversation.length>0){
var component = Qt.createComponent("qrc:/qml/newsqml/Conversation.qml");
var conversation = component.createObject(friendicaActivities,{"news":newstab.conversation});
}
else{conversationsymbol.color="grey"}
}
}
}
property string attending: ""
property int itemindex: index
onAttendingChanged: {attendLabel.visible=true;
attendLabel.text= qsTr("attending: ")+ qsTr(attending)}
@ -54,11 +41,7 @@ Item {
height: 7*mm
MouseArea{
anchors.fill: parent
onClicked:{
try{root.currentIndex=1;
friendstab.active=true;
root.contactdetailsSignal(newsitemobject.user)} catch (e){Helperjs.showMessage("Error",e,root)}
}
onClicked:{showContact(newsitemobject.user)}
}
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
}
@ -68,13 +51,12 @@ Item {
width:parent.width
font.pixelSize: 1.5*mm
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: Qt.atob(newsitemobject.user.name)//+forumname
text: Qt.atob(newsitemobject.user.name)+forumname
}
}
Column {
id:newscolumn
width: newsitem.width-8*mm
//anchors.left: authorcolumn.right
Flow{
id:topFlow
@ -114,7 +96,13 @@ Item {
text: try {(newsitemobject.newscount-1)+qsTr(" comments") }catch(e){" "}
MouseArea{
anchors.fill:parent
onClicked: {conversationsymbol.color="black";showConversation(index,newsitemobject)}
onClicked: {
conversationsymbol.color="black";
newsView.contentY+=newsitem.height;
var component = Qt.createComponent("qrc:/qml/newsqml/Conversation.qml");
var conversationItem = component.createObject(friendicaActivities,{"news":newsitemobject.chatArray});
showConversation(index,newsitemobject);
}
}
}
}
@ -150,6 +138,7 @@ Item {
spacing:mm
Label{color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
text: friendica_activities.likeText
MouseArea{
@ -158,6 +147,7 @@ Item {
}
}
Label{color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
text: friendica_activities.dislikeText
MouseArea{
@ -166,6 +156,7 @@ Item {
}
}
Label{color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
text: friendica_activities.attendyesText
MouseArea{
@ -173,6 +164,7 @@ Item {
onClicked: { showActivityContacts(newsitemobject.attendyes)}
}}
Label{color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
text: friendica_activities.attendnoText
MouseArea{
@ -181,6 +173,7 @@ Item {
}
}
Label{color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
text: friendica_activities.attendmaybeText
MouseArea{
@ -190,7 +183,6 @@ Item {
}
Label{
id:attendLabel
//visible: false
color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
@ -203,28 +195,21 @@ Item {
CheckBox{
id:likeCheckbox
//height:3*mm
width:8*mm
width:10*mm
visible: (newsitemobject.messagetype==0)? true:false
checked:(friendica_activities.self.liked==1)?true:false
style: CheckBoxStyle {
background: Rectangle {
implicitWidth: 6*mm
implicitHeight: 3*mm
color:"white"
}
indicator: Rectangle{
implicitWidth: 3*mm
implicitHeight:3*mm
color:control.checked?"yellow":"white"
x: 4*mm
Text{
anchors.centerIn: parent
font.pixelSize: 2.5*mm
font.family:fontAwesome.name
color:control.checked?"black": "grey"
text:"\uf118"
}}
indicator: Rectangle{
implicitWidth: 10*mm
implicitHeight:3*mm
Text{
anchors.centerIn: parent
font.pixelSize: 2.5*mm
font.family:fontAwesome.name
color:control.checked?"black": "grey"
text:"\uf118"
}
}
}
onClicked: {
if(likeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"like",newsitemobject.status_id,root);dislikeCheckbox.checked=false; model.friendica_activities.self.liked=0 }
@ -232,73 +217,43 @@ Item {
}
CheckBox{
id: dislikeCheckbox
//height:3*mm
width:8*mm
width:10*mm
visible: (newsitemobject.messagetype==0)? true:false
checked: (friendica_activities.self.disliked==1)?true:false
style: CheckBoxStyle {
background: Rectangle {
implicitWidth: 6*mm
implicitHeight:3*mm
color:"white"
}
indicator: Rectangle{
implicitWidth: 3*mm
implicitWidth: 10*mm
implicitHeight:3*mm
color:control.checked?"yellow":"white"
x:4*mm
Text{
anchors.centerIn: parent
font.pixelSize: 2.5*mm
font.family:fontAwesome.name
color:control.checked?"black": "grey"
text: "\uf119"
}}
}
}
}
onClicked: {
if (dislikeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"dislike",newsitemobject.status_id,root);likeCheckbox.checked=false; model.friendica_activities.self.disliked=0}
else {Newsjs.like(root.login,root.db,0,"dislike",newsitemobject.status_id,root); model.friendica_activities.self.disliked=1}}
}
// Rectangle{
// width: 8*mm
// height: 3*mm
// color:"transparent"
// Text{
// id:trashsymbol
// color: "grey"
// anchors.centerIn: parent
// font.pixelSize: 2*mm
// font.bold: true
// text: "\uf1f8"
// }
// MouseArea{
// anchors.fill:parent
// onClicked: {
// Newsjs.deleteNews(root.login,root.db,newsitemobject.status_id,newsitemobject.messagetype,root,function(reply){
// newsModel.remove(index)})
// }}
// }
CheckBox {
id:favoritedCheckbox
visible:(newsitemobject.messagetype==0)
width: 8*mm
width: 10*mm
style: CheckBoxStyle {
background: Rectangle {
implicitWidth: 6*mm
implicitHeight:3*mm
color:"transparent"
indicator:Rectangle{
x:4*mm
width: 3*mm
implicitHeight:4*mm
Text{
color: control.checked?"black":"grey"
font.pixelSize: 2.5*mm
text:"\uf005"
}
}
indicator:Rectangle{
x:3*mm
width: 3*mm
implicitHeight:3*mm
Text{
color: control.checked?"black":"grey"
font.pixelSize: 2.5*mm
text:"\uf005"
}}
}
}
checked:(newsitemobject.favorited>0)
onClicked:{
if(favoritedCheckbox.checkedState==Qt.Checked){
@ -308,8 +263,8 @@ Item {
}
}
Rectangle{
width: 8*mm
height: 3*mm
width: 10*mm
height: 4*mm
color:"transparent"
Text{
id:newsmenusymbol
@ -324,8 +279,8 @@ Item {
onClicked: {newsmenu.popup()}}
}
Rectangle{
width: 8*mm
height: 3*mm
width: 10*mm
height: 4*mm
visible:newstab.newstabstatus!="Conversation"
color:"transparent"
Text{
@ -340,7 +295,11 @@ Item {
anchors.fill:parent
onClicked:{
conversationsymbol.color="black";
showConversation(index,newsitemobject)
//Newsjs.conversationfromdb(db,login.username,newsitemobject.conversation_id,function(conversation){
var component = Qt.createComponent("qrc:/qml/newsqml/Conversation.qml");
// var conversationItem = component.createObject(friendicaActivities,{"news":newsitemobject.chatArray});
var conversationItem = component.createObject(friendicaActivities); showConversation(index,newsitemobject)
}
}
}
@ -367,12 +326,19 @@ Item {
text: qsTr("Repost")
onTriggered: {
Newsjs.retweetNews(root.login,db,newsitemobject.status_id,root,function(reply){
print(reply)})
Helperjs.showMessage("Repost",qsTr("Success!"),root)
})
}
}
MenuItem {
text: qsTr("Conversation")
onTriggered: showConversation(index,newsitemobject)
onTriggered: {
conversationsymbol.color="black";
//Newsjs.conversationfromdb(db,login.username,newsitemobject.conversation_id,function(conversation){
var component = Qt.createComponent("qrc:/qml/newsqml/Conversation.qml");
var conversationItem = component.createObject(friendicaActivities,{"news":newsitemobject.chatArray});
showConversation(index,newsitemobject)
}
}
Menu{
@ -398,8 +364,15 @@ Item {
text: qsTr("Delete")
onTriggered: {
Newsjs.deleteNews(root.login,root.db,newsitemobject.status_id,newsitemobject.messagetype,root,function(reply){
newsModel.remove(index)})
// newsModel.remove(index)
var msg = {'deleteId': index, 'model': newsModel};
newsWorker.sendMessage(msg);
})
}
}
//MenuItem{
// text:qsTr("Show on website")
// onTriggered:Qt.openUrlExternally(login.server+"/display/"+newsitemobject
//}
}
}}

View file

@ -173,7 +173,7 @@ Rectangle{
Helperjs.readData(db,"contacts",login.username,function(contacts){
for (var name in contacts){
var contactstatus="neutral";
if (contact_allow.indexOf(contacts[name].cid)>-1){contactstatus="positive";print(contacts[name].cid+" pos")}
if (contact_allow.indexOf(contacts[name].cid)>-1){contactstatus="positive"}
else if (contact_deny.indexOf(contacts[name].cid)>-1){contactstatus="negative"}
contactModel.append({"contact":contacts[name],"contactstatus":contactstatus})
}},"isFriend",1);