forked from lubuwest/Friendiqa
Version 0.002 with working Favorite Combobox
This commit is contained in:
parent
42de63fe63
commit
571c9046d0
42 changed files with 1948 additions and 814 deletions
|
@ -3,15 +3,13 @@ import QtQuick.LocalStorage 2.0
|
|||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import "qrc:/js/news.js" as Newsjs
|
||||
import "qrc:/js/layout.js" as Layoutjs
|
||||
|
||||
|
||||
Item {
|
||||
id: newsitem
|
||||
width: newsView.width
|
||||
height:Math.max((itemMessage.height+createdAtLabel.height+friendicaActivities.height+4*mm),profileImage.height+user_name.height+mm)
|
||||
height:Math.max((itemMessage.height+topFlow.height+friendicaActivities.height+4*mm),profileImage.height+user_name.height+mm)
|
||||
|
||||
// property var friendica_activities
|
||||
property string conversation_id: ""
|
||||
property string attending: ""
|
||||
onAttendingChanged: {attendLabel.visible=true;
|
||||
|
@ -23,7 +21,7 @@ Item {
|
|||
Rectangle{
|
||||
width:newsitem.width
|
||||
height:newsitem.height-1
|
||||
color: (newsitemobject.directmessage)?"#ffe6e6" : "white"
|
||||
color: (newsitemobject.messagetype==1)?"#ffe6e6" : "white"
|
||||
|
||||
Column {
|
||||
id: authorcolumn
|
||||
|
@ -31,7 +29,7 @@ Item {
|
|||
|
||||
Image {
|
||||
id:profileImage
|
||||
source: "file://"+newsitemobject.user.profile_image
|
||||
source:(newsitemobject.user.isFriend==1)? "file://"+newsitemobject.user.profile_image : newsitemobject.user.profile_image_url
|
||||
x:1
|
||||
width: 7*mm
|
||||
height: 7*mm
|
||||
|
@ -53,10 +51,13 @@ Item {
|
|||
}
|
||||
Column {
|
||||
id:newscolumn
|
||||
width: newsitem.width-8*mm
|
||||
anchors.left: authorcolumn.right
|
||||
|
||||
Row{
|
||||
spacing: 5*mm
|
||||
Flow{
|
||||
id:topFlow
|
||||
spacing: 2*mm
|
||||
width:parent.width
|
||||
Label {
|
||||
color: "grey"
|
||||
text: if (newsitemobject.messagetype==0){qsTr("Source: ")+newsitemobject.source
|
||||
|
@ -66,9 +67,9 @@ Item {
|
|||
Label {
|
||||
id:createdAtLabel
|
||||
color: "grey"
|
||||
height:3.5*mm
|
||||
font.pixelSize: 1.5*mm
|
||||
horizontalAlignment: Label.AlignRight
|
||||
height:3.5*mm
|
||||
font.pixelSize: 1.5*mm
|
||||
horizontalAlignment: Label.AlignRight
|
||||
text: dateDiff
|
||||
}
|
||||
CheckBox {
|
||||
|
@ -104,8 +105,53 @@ Item {
|
|||
{Newsjs.favorite(login,false,newsitemobject.status_id,root)}
|
||||
}
|
||||
}
|
||||
Rectangle{
|
||||
width: 4*mm
|
||||
height: 3*mm
|
||||
Text{
|
||||
id:newsmenusymbol
|
||||
color: "grey"
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: 2*mm
|
||||
font.bold: true
|
||||
text: "\u22EE"
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill:parent
|
||||
onClicked: {newsmenu.popup()}}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle{
|
||||
width: 4*mm
|
||||
height: 3*mm
|
||||
Text{
|
||||
id:conversationsymbol
|
||||
color: "grey"
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: 2*mm
|
||||
text: "\u21C4"
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill:parent
|
||||
onClicked: {
|
||||
newsBusy.running=true;
|
||||
Newsjs.requestConversation(root.login,db,newsitemobject.status_id,root.contactlist,root,function(news,newContacts){
|
||||
for (var i=0;i<newContacts.length;i++){
|
||||
root.updateContactInDB(root.login,root.db,0,newContacts[i])
|
||||
}
|
||||
Newsjs.storeNews(root.login,root.db,news,root,function(){
|
||||
var currentTime= new Date();
|
||||
Newsjs.conversationfromdb(db,root.login.username,newsitemobject.statusnet_conversation_id, function(newsarray){
|
||||
newsModel.clear();
|
||||
var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsarray,'latestmessage':0};
|
||||
newsWorker.sendMessage(msg);
|
||||
newsBusy.running=false
|
||||
});
|
||||
}
|
||||
)})
|
||||
}}
|
||||
}}
|
||||
|
||||
Text {
|
||||
color: "#404040"
|
||||
|
@ -116,10 +162,10 @@ Item {
|
|||
width: newsitem.width-8*mm-2
|
||||
height: implicitHeight
|
||||
wrapMode: Text.Wrap
|
||||
onLinkActivated:{ print("link "+link);
|
||||
Qt.openUrlExternally(link)}
|
||||
onLinkActivated:{
|
||||
Qt.openUrlExternally(link)}
|
||||
}
|
||||
Row{id: friendicaActivities
|
||||
Row{id:friendicaActivities
|
||||
spacing:mm
|
||||
Label{color: "grey"
|
||||
font.pixelSize: 1.5*mm
|
||||
|
@ -141,13 +187,13 @@ Item {
|
|||
font.pixelSize: 1.5*mm
|
||||
text: friendica_activities.attendmaybeText
|
||||
}
|
||||
}
|
||||
Row {
|
||||
}
|
||||
Row {
|
||||
CheckBox{id:likeCheckbox
|
||||
height:3*mm
|
||||
width:8*mm
|
||||
checked:(newsitemobject.liked==1)?true:false
|
||||
style: CheckBoxStyle {
|
||||
checked:(friendica_activities.self.liked)?true:false
|
||||
style: CheckBoxStyle {
|
||||
background: Rectangle {
|
||||
implicitWidth: 7*mm
|
||||
implicitHeight: 3*mm
|
||||
|
@ -170,11 +216,11 @@ Row {
|
|||
else{Newsjs.like(root.login,root.db,0,"like",newsitemobject.status_id,root)}}
|
||||
}
|
||||
CheckBox{id: dislikeCheckbox
|
||||
height:3*mm
|
||||
width:8*mm
|
||||
checked: (newsitemobject.disliked==1)?true:false
|
||||
style: CheckBoxStyle {
|
||||
background: Rectangle {
|
||||
height:3*mm
|
||||
width:8*mm
|
||||
checked: (friendica_activities.self.disliked)?true:false
|
||||
style: CheckBoxStyle {
|
||||
background: Rectangle {
|
||||
implicitWidth: 7*mm
|
||||
implicitHeight:3*mm
|
||||
color:"white"
|
||||
|
@ -211,7 +257,7 @@ Row {
|
|||
height:3.5*mm
|
||||
font.pixelSize: 1.5*mm
|
||||
horizontalAlignment: Label.AlignRight
|
||||
text: qsTr("attending: ")+ qsTr(attending)
|
||||
text: (friendica_activities.self.attending)?qsTr("attending: ")+ qsTr(attending):""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -221,10 +267,10 @@ Row {
|
|||
MenuItem {
|
||||
text: qsTr("Reply")
|
||||
onTriggered: {
|
||||
newsStack.push({item:"qrc:/qml/MessageSend.qml",properties:{"reply_to_user": newsitemobject.user.screen_name,"parentId":newsitemobject.status_id}});
|
||||
newsStack.push({item:"qrc:/qml/MessageSend.qml",properties:{"reply_to_user": newsitemobject.user.screen_name,"parentId":newsitemobject.status_id,"login":root.login}});
|
||||
}
|
||||
}
|
||||
MenuItem {
|
||||
MenuItem {
|
||||
text: qsTr("DM")
|
||||
onTriggered: {
|
||||
root.directmessageSignal(newsitemobject.user.screen_name);
|
||||
|
@ -241,16 +287,20 @@ MenuItem {
|
|||
MenuItem {
|
||||
text: qsTr("Conversation")
|
||||
onTriggered: {
|
||||
Newsjs.requestConversation(root.login,db,newsitemobject.status_id,root,function(){
|
||||
var currentTime= new Date();
|
||||
Newsjs.conversationfromdb(db,root.login.username,newsitemobject.statusnet_conversation_id, function(newsarray){
|
||||
Newsjs.requestConversation(root.login,db,newsitemobject.status_id,root.contactlist,root,function(news,newContacts){
|
||||
for (var i=0;i<newContacts.length;i++){
|
||||
root.updateContactInDB(root.login,root.db,0,newContacts[i])
|
||||
}
|
||||
Newsjs.storeNews(root.login,root.db,news,root,function(){
|
||||
var currentTime= new Date();
|
||||
Newsjs.conversationfromdb(db,root.login.username,newsitemobject.statusnet_conversation_id, function(newsarray){
|
||||
newsModel.clear();
|
||||
var msg = {'currentTime': currentTime, 'model': newsModel,'news':newsarray,'latestmessage':0};
|
||||
newsWorker.sendMessage(msg);
|
||||
});
|
||||
}
|
||||
)}
|
||||
}
|
||||
)})
|
||||
}}
|
||||
|
||||
Menu{
|
||||
title: qsTr("Attending")
|
||||
|
@ -275,8 +325,8 @@ Menu{
|
|||
MenuItem {
|
||||
text: qsTr("Delete")
|
||||
onTriggered: {
|
||||
Newsjs.deleteNews(root.login,db,newsitemobject.status_id,root,function(reply){
|
||||
print(JSON.stringify(reply));
|
||||
Newsjs.deleteNews(root.login,root.db,newsitemobject.status_id,root,function(reply){
|
||||
print("Deleted "+reply);
|
||||
newsModel.remove(index);
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue