forked from lubuwest/Friendiqa
v0.1
This commit is contained in:
parent
8d99b55818
commit
7e37546ae9
108 changed files with 6063 additions and 1450 deletions
|
@ -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,13 +41,9 @@ 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"}
|
||||
onStatusChanged: if (profileImage.status == Image.Error) {print("Image Failed "+"file://"+newsitemobject.user.profile_image);source="qrc:/images/defaultcontact.jpg"}
|
||||
}
|
||||
Label {
|
||||
id:user_name
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -372,7 +331,13 @@ Item {
|
|||
}
|
||||
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 +363,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
|
||||
//}
|
||||
}
|
||||
}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue