This commit is contained in:
LubuWest 2019-06-25 20:59:10 +02:00
commit d48847d183
135 changed files with 8879 additions and 3693 deletions

View file

@ -30,8 +30,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls 2.4
//import QtQuick.Controls.Styles 1.4
import "qrc:/js/news.js" as Newsjs
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
@ -62,7 +62,7 @@ Item {
Rectangle{
width:newsitem.width
height:newsitem.height-1
color: (newsitemobject.messagetype==1)?"#ffe6e6" : "white"
color: "white"//(newsitemobject.messagetype==1)?"#ffe6e6" : "white"
Row{id:toprow
Column {
@ -102,8 +102,7 @@ Item {
Label {
id:messageTypeLabel
color: "grey"
text: if (newsitemobject.messagetype==0){qsTr("Source: ")+newsitemobject.source
} else if (newsitemobject.messagetype==1){ qsTr("Direct Message")} else {" Notification"}
text: if (newsitemobject.messagetype==1){ qsTr("Direct Message")} else if(newsitemobject.messagetype==2) {" Notification"} else {qsTr("Source: ")+newsitemobject.source}
font.pixelSize: 1.5*mm
}
Label {
@ -117,6 +116,7 @@ Item {
id:replytoLabel
color: "grey"
font.pixelSize: 1.5*mm
font.family: "Noto Sans"
horizontalAlignment: Label.AlignRight
text: try {qsTr("In reply to ")+newsitemobject.reply_user.screen_name
}catch(e){" "}
@ -160,6 +160,7 @@ Item {
linkColor: "light green"
id: itemMessage
textFormat: Text.RichText
font.family: "Noto Sans"
text: newsitemobject.statusnet_html//newsitemobject.attachmentList.length>0?newsitemobject.text : newsitemobject.statusnet_html
width: newsitem.width-8*mm-2
height: implicitHeight
@ -178,7 +179,6 @@ Item {
}}
if (newsitemobject.attachmentList.length>0){
for(var attachments in newsitemobject.attachmentList){// (newsitemobject.attachmentList[attachments].url);
if(newsitemobject.attachmentList[attachments].mimetype.substring(0,5)=="image"){
var component = Qt.createComponent("qrc:/qml/newsqml/NewsImage.qml");
@ -191,8 +191,7 @@ Item {
else {//print(newsitemobject.attachmentList[attachments].url+" Type: "+newsitemobject.attachmentList[attachments].mimetype)
var component = Qt.createComponent("qrc:/qml/newsqml/NewsVideo.qml");
var videoQml = component.createObject(messageColumn,{"source":newsitemobject.attachmentList[attachments].url,"mimetype":newsitemobject.attachmentList[attachments].mimetype});
}
}
}
}
}
@ -289,9 +288,9 @@ Item {
CheckBox{
id:likeCheckbox
width:10*mm
visible: (newsitemobject.messagetype==0)? true:false
visible: ((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))? true:false
checked:(friendica_activities.self.liked==1)?true:false
style: CheckBoxStyle {
//style: CheckBoxStyle {
indicator: Rectangle{
implicitWidth: 10*mm
implicitHeight:3*mm
@ -299,11 +298,11 @@ Item {
anchors.centerIn: parent
font.pixelSize: 2.5*mm
font.family:fontAwesome.name
color:control.checked?"black": "grey"
text:control.checked?"\uf118"+"!":"\uf118"
color:likeCheckbox.checked?"black": "grey"
text:likeCheckbox.checked?"\uf118"+"!":"\uf118"
}
}
}
//}
onClicked: {
if(likeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"like",newsitemobject.id,root);dislikeCheckbox.checked=false; model.friendica_activities.self.liked=0 }
else{Newsjs.like(root.login,root.db,0,"like",newsitemobject.id,root); model.friendica_activities.self.liked=1}}
@ -311,9 +310,9 @@ Item {
CheckBox{
id: dislikeCheckbox
width:10*mm
visible: (newsitemobject.messagetype==0)? true:false
visible: ((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))? true:false
checked: (friendica_activities.self.disliked==1)?true:false
style: CheckBoxStyle {
//style: CheckBoxStyle {
indicator: Rectangle{
implicitWidth: 10*mm
implicitHeight:3*mm
@ -321,11 +320,11 @@ Item {
anchors.centerIn: parent
font.pixelSize: 2.5*mm
font.family:fontAwesome.name
color:control.checked?"black": "grey"
text: control.checked?"\uf119"+"!":"\uf119"
color:dislikeCheckbox.checked?"black": "grey"
text: dislikeCheckbox.checked?"\uf119"+"!":"\uf119"
}
}
}
//}
onClicked: {
if (dislikeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"dislike",newsitemobject.id,root);likeCheckbox.checked=false; model.friendica_activities.self.disliked=0}
else {Newsjs.like(root.login,root.db,0,"dislike",newsitemobject.id,root); model.friendica_activities.self.disliked=1}}
@ -333,20 +332,20 @@ Item {
CheckBox {
id:favoritedCheckbox
visible:(newsitemobject.messagetype==0)
visible:((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))
width: 10*mm
style: CheckBoxStyle {
//style: CheckBoxStyle {
indicator:Rectangle{
x:4*mm
width: 3*mm
implicitHeight:4*mm
Text{
color: control.checked?"black":"grey"
color: favoritedCheckbox.checked?"black":"grey"
font.pixelSize: 2.5*mm
text:"\uf005"
}
}
}
//}
checked:(newsitemobject.favorited>0)
onClicked:{
if(favoritedCheckbox.checkedState==Qt.Checked){
@ -401,21 +400,29 @@ Item {
Menu {
id:newsmenu
MenuItem {
width: 30*mm
delegate: MenuItem{
contentItem: Text{
font.pixelSize: 3*mm
text: parent.text
}
}
Action{
text: qsTr("Reply")
onTriggered: {
var directmessage=0;
if (newsitemobject.messagetype==1){ directmessage=1}
newsStack.push("qrc:/qml/newsqml/MessageSend.qml",{"reply_to_user": newsitemobject.user.screen_name,"parentId":newsitemobject.id,"login":root.login,"directmessage":directmessage});
replySignal(newsitemobject)
//newsStack.push("qrc:/qml/newsqml/MessageSend.qml",{"reply_to_user": newsitemobject.user.screen_name,"parentId":newsitemobject.id,"login":root.login,"directmessage":directmessage});
}
}
MenuItem {
Action {
text: qsTr("DM")
onTriggered: {
root.directmessageSignal(newsitemobject.user.screen_name);
}
}
MenuItem {
Action {
text: qsTr("Repost")
onTriggered: {
Newsjs.retweetNews(root.login,db,newsitemobject.id,root,function(reply){
@ -423,7 +430,7 @@ Item {
})
}
}
MenuItem {
Action {
text: qsTr("Conversation")
onTriggered: {
conversationsymbol.color="black";
@ -435,24 +442,31 @@ Item {
Menu{
title: qsTr("Attending")
MenuItem{
width: 20*mm
delegate: MenuItem{
contentItem: Text{
font.pixelSize: 3*mm
text: parent.text
}
}
Action{
text:qsTr("yes")
onTriggered: {Newsjs.attend(root.login,db,"yes",newsitemobject.id,root,function(){
model.friendica_activities.self.attending="yes";attending="yes"})
}
}
MenuItem{text:qsTr("maybe")
Action{text:qsTr("maybe")
onTriggered: {Newsjs.attend(root.login,db,"maybe",newsitemobject.id,root,function(){
model.friendica_activities.self.attending="maybe";attending="maybe"})
}
}
MenuItem{text:qsTr("no")
Action{text:qsTr("no")
onTriggered: {Newsjs.attend(root.login,db,"no",newsitemobject.id,root,function(){
model.friendica_activities.self.attending="no";attending="no"})}
}
}
MenuItem {
Action {
text: qsTr("Delete")
onTriggered: {
Newsjs.deleteNews(root.login,root.db,newsitemobject.id,newsitemobject.messagetype,root,function(reply){