v0.6.4 contact search

This commit is contained in:
LubuWest 2022-03-01 21:59:21 +01:00
commit 5032c78de1
57 changed files with 2218 additions and 2252 deletions

View file

@ -58,23 +58,21 @@ Item {
function pushConversation(){
if (model.newsitemobject.hasOwnProperty("currentconversation")){
rootstackView.push("qrc:/qml/newsqml/Conversation.qml",{"news": model.newsitemobject.currentconversation})}
//newsStack.push("qrc:/qml/newsqml/Conversation.qml",{"news": model.newsitemobject.currentconversation})}
//else{newsStack.push("qrc:/qml/newsqml/Conversation.qml")};
else{rootstackView.push("qrc:/qml/newsqml/Conversation.qml")};
showConversation(index,newsitemobject)
}
Rectangle{width:newsitem.width; height: 1; anchors.bottom: newsitem.bottom;
color: Material.backgroundDimColor//"light grey"
color: Material.backgroundDimColor
}
Rectangle{
width:newsitem.width
height:newsitem.height-1
color: Material.background//"white"
color: Material.background
Column {
id:toprow //newscolumn
id:toprow
width: newsitemobject.hasOwnProperty("indent")?newsitem.width-(newsitem.width/20 *(newsitemobject.indent+1)):newsitem.width//-8*mm
x:newsitemobject.hasOwnProperty("indent")?newsitem.width/20*(newsitemobject.indent):0
height: newsitemobject.nsfw?5*mm:Math.min(implicitHeight,3/4*root.height)
@ -105,7 +103,6 @@ Item {
anchors.margins: mm
Label {
id:user_name
//color: "grey"
width:parent.width
font.bold: true
font.pointSize: osSettings.systemFontSize
@ -115,25 +112,24 @@ Item {
Label {
id:messageTypeLabel
color: Material.secondaryTextColor//"grey"
color: Material.secondaryTextColor
text: if (newsitemobject.messagetype==1){ qsTr("Direct Message")} else if(newsitemobject.messagetype==2) {" Notification"} else {qsTr("Source: ")+newsitemobject.source}
font.pointSize: 0.6*osSettings.systemFontSize
}
Label {
id:createdAtLabel
color: Material.secondaryTextColor//"grey"
color: Material.secondaryTextColor
font.pointSize: 0.6*osSettings.systemFontSize
horizontalAlignment: Label.AlignRight
text: " \u00B7 "+getDateDiffString(newsitemobject.dateDiff) + " " +qsTr("ago")
}
Label {
id:replytoLabel
color: Material.secondaryTextColor//"grey"
color: Material.secondaryTextColor
font.pointSize: 0.6*osSettings.systemFontSize
font.family: "Noto Sans"
horizontalAlignment: Label.AlignRight
text: try {" \u00B7 "+qsTr("In reply to ")+newsitemobject.reply_user.screen_name
}catch(e){" "}
text: (newsitemobject.in_reply_to_status_id!="null"&&newsitemobject.in_reply_to_status_id!=null)?" \u00B7 "+qsTr("In reply to ")+newsitemobject.reply_user.screen_name:" "
}
}
}
@ -141,32 +137,27 @@ Item {
MouseArea{id: itemBody
width: toprow.width-2
height: itemMessage.height
//onPressAndHold: {pushConversation()}
onClicked: {pushConversation()}
Text {
color: Material.primaryTextColor//"#404040"
linkColor: Material.accentColor//"light green"
color: Material.primaryTextColor
linkColor: Material.accentColor
id: itemMessage
textFormat: Text.RichText
font.family: "Noto Sans"
font.pointSize: osSettings.systemFontSize
text: newsitemobject.statusnet_html
width: toprow.width-2
//height:newsitemobject.nsfw?5*mm:Math.min(implicitHeight,3/4*root.height)
height: implicitHeight
wrapMode: Text.Wrap
clip:true
onLinkActivated:{Qt.openUrlExternally(link)}
Component.onCompleted:{
if (newsitemobject.messagetype==0){
var hashtags=[];
hashtags=Newsjs.findTags(newsitemobject.text);
var component = Qt.createComponent("qrc:/qml/newsqml/Hashtag.qml");
for (var tags in hashtags){
var hashtagQml = component.createObject(friendicaActivities,{"text":hashtags[tags].trim()});
}
onLinkActivated:{
if(link.startsWith(root.login.server+"\/search\?tag=")){
newstab.newstabstatus="Search";
root.searchSignal(link.substring(root.login.server.length+12,link.length))
}
else{Qt.openUrlExternally(link)}
}
Component.onCompleted:{
if (newsitemobject.imageAttachmentList.length>0){
if(newsitemobject.imageAttachmentList[0].mimetype.substring(0,5)=="image"){
var component = Qt.createComponent("qrc:/qml/newsqml/NewsImage.qml");
@ -195,16 +186,16 @@ Item {
BlueButton{
width: newsitem.width-2
height:5*mm
anchors.bottom: toprow.bottom//itemMessage.bottom
visible: toprow.implicitHeight>3/4*root.height || newsitemobject.nsfw//messageColumn.implicitHeight>3/4*root.height || newsitemobject.nsfw//itemMessage.implicitHeight>3/4*root.height
anchors.bottom: toprow.bottom
visible: toprow.implicitHeight>3/4*root.height || newsitemobject.nsfw
text:"\uf078"
fontColor: Material.secondaryTextColor//"grey"
fontColor: Material.secondaryTextColor
border.color: "transparent"
color: Material.backgroundColor//"white"
// gradient: Gradient {
// GradientStop { position: 0.0; color: "transparent" }
// GradientStop { position: 0.5; color: "white" }
// }
color: Material.backgroundColor
// gradient: Gradient {
// GradientStop { position: 0.0; color: "transparent" }
// GradientStop { position: 0.5; color: Material.backgroundDimColor}
// }
radius:0
onClicked: {
if (text=="\uf078"){
@ -224,45 +215,45 @@ Item {
width:parent.width
spacing:mm
Label{color: Material.secondaryTextColor//"grey"
Label{color: Material.secondaryTextColor
height:3.5*mm
font.pointSize: 0.75*osSettings.systemFontSize
text: friendica_activities_view.likeText
text: newsitemobject.hasOwnProperty("isLastComment")?"":friendica_activities_view.likeText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.like)}
}
}
Label{color: Material.secondaryTextColor//"grey"
Label{color: Material.secondaryTextColor
height:3.5*mm
font.pointSize: 0.75*osSettings.systemFontSize
text: friendica_activities_view.dislikeText
text: newsitemobject.hasOwnProperty("isLastComment")?"":friendica_activities_view.dislikeText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.dislike)}
}
}
Label{color: Material.secondaryTextColor//"grey"
Label{color: Material.secondaryTextColor
height:3.5*mm
font.pointSize: 0.75*osSettings.systemFontSize
text: friendica_activities_view.attendyesText
text: newsitemobject.hasOwnProperty("isLastComment")?"":friendica_activities_view.attendyesText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendyes)}
}}
Label{color: Material.secondaryTextColor//"grey"
Label{color: Material.secondaryTextColor
height:3.5*mm
font.pointSize: 0.75*osSettings.systemFontSize
text: friendica_activities_view.attendnoText
text: newsitemobject.hasOwnProperty("isLastComment")?"":friendica_activities_view.attendnoText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendno)}
}
}
Label{color: Material.secondaryTextColor//"grey"
Label{color: Material.secondaryTextColor
height:3.5*mm
font.pointSize: 0.75*osSettings.systemFontSize
text: friendica_activities_view.attendmaybeText
text: newsitemobject.hasOwnProperty("isLastComment")?"":friendica_activities_view.attendmaybeText
MouseArea{
anchors.fill: parent
onClicked: { showActivityContacts(newsitemobject.friendica_activities.attendmaybe)}
@ -270,7 +261,7 @@ Item {
}
Label{
id:attendLabel
color: Material.secondaryTextColor//"grey"
color: Material.secondaryTextColor
height:3.5*mm
font.pointSize: 0.75*osSettings.systemFontSize
horizontalAlignment: Label.AlignRight
@ -284,12 +275,12 @@ Item {
height: root.fontFactor*osSettings.bigFontSize
CheckBox{
id:likeCheckbox
width:newsitem.width/5 //10*mm
width:newsitem.width/5
height: parent.height
visible: ((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))? true:false
checked:(model.newsitemobject.friendica_activities_view.self.liked==1)?true:false
indicator: Rectangle{
implicitWidth: newsitem.width/5 //10*mm
implicitWidth: newsitem.width/5
implicitHeight:root.fontFactor*osSettings.bigFontSize
color:"transparent"
Text{
@ -312,12 +303,12 @@ Item {
}
CheckBox{
id: dislikeCheckbox
width:newsitem.width/5 //10*mm
width:newsitem.width/5
height: parent.height
visible: ((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))? true:false
checked: (newsitemobject.friendica_activities_view.self.disliked==1)?true:false
indicator: Rectangle{
implicitWidth: newsitem.width/5 //10*mm
implicitWidth: newsitem.width/5
implicitHeight:root.fontFactor*osSettings.bigFontSize
color:"transparent"
Text{
@ -339,39 +330,72 @@ Item {
}}
}
CheckBox {
id:favoritedCheckbox
visible:((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))
width: newsitem.width/5 // 10*mm
// CheckBox {
// id:favoritedCheckbox
// visible:((newsitemobject.messagetype==0)||(newsitemobject.messagetype==3))
// width: newsitem.width/5
// height: parent.height
// indicator:Rectangle{
// implicitWidth: newsitem.width/5
// implicitHeight:root.fontFactor*osSettings.bigFontSize
// color:"transparent"
// Text{
// anchors.centerIn: parent
// font.pointSize: osSettings.systemFontSize
// font.family:fontAwesome.name
// color: favoritedCheckbox.checked?Material.primaryTextColor: Material.secondaryTextColor
// text:"\uf005"
// }
// }
// checked:(newsitemobject.favorited>0)
// onClicked:{
// if(favoritedCheckbox.checkState==Qt.Checked){
// Newsjs.favorite(login,true,newsitemobject.id,root); model.newsitemobject.favorited=1}
// else if(favoritedCheckbox.checkState==Qt.Unchecked){
// Newsjs.favorite(login,false,newsitemobject.id,root);model.newsitemobject.favorited=0}
// }
// }
Rectangle{
width: newsitem.width/5
height: parent.height
indicator:Rectangle{
implicitWidth: newsitem.width/5 //10*mm
implicitHeight:root.fontFactor*osSettings.bigFontSize
color:"transparent"
Text{
anchors.centerIn: parent
font.pointSize: osSettings.systemFontSize
font.family:fontAwesome.name
color: favoritedCheckbox.checked?Material.primaryTextColor: Material.secondaryTextColor
text:"\uf005"
}
visible:(newsitemobject.messagetype!==2)
color:"transparent"
Text{
id:replysymbol
color: Material.secondaryTextColor
anchors.centerIn: parent
font.pointSize: osSettings.systemFontSize
font.family:fontAwesome.name
text: "\uf112"
}
checked:(newsitemobject.favorited>0)
onClicked:{
if(favoritedCheckbox.checkState==Qt.Checked){
Newsjs.favorite(login,true,newsitemobject.id,root); model.newsitemobject.favorited=1}
else if(favoritedCheckbox.checkState==Qt.Unchecked){
Newsjs.favorite(login,false,newsitemobject.id,root);model.newsitemobject.favorited=0}
MouseArea{
anchors.fill:parent
onClicked: {
var directmessage=0;
if (newsitemobject.messagetype==1){ directmessage=1}
var replycomp=Qt.createComponent("qrc:/qml/newsqml/MessageSend.qml");
var conversation;
if (newsitem.ListView.view==null){conversation=true}
else if (newsitem.ListView.view.viewtype=="conversation"){
conversation=true
newsitem.ListView.view.currentIndex=itemindex
}
else{
conversation=false;
newsitem.ListView.view.currentIndex=itemindex
};
var reply=replycomp.createObject(friendicaActivities,{parentId:newsitemobject.id,reply_to_user:newsitemobject.user.screen_name, state:"reply",conversation:conversation,textfocus:true})
}
}
}
Rectangle{
width: newsitem.width/5 //10*mm
width: newsitem.width/5
height: parent.height
visible:(newsitemobject.messagetype!==2)
color:"transparent"
Text{
id:newsmenusymbol
color: Material.secondaryTextColor//"grey"
color: Material.secondaryTextColor
anchors.centerIn: parent
font.pointSize: osSettings.systemFontSize
font.family:fontAwesome.name
@ -393,30 +417,8 @@ Item {
text: parent.text
}
}
Action{
text: qsTr("Reply")
onTriggered: {
var directmessage=0;
if (newsitemobject.messagetype==1){ directmessage=1}
var replycomp=Qt.createComponent("qrc:/qml/newsqml/MessageSend.qml");
var conversation;
if (newsitem.ListView.view==null){conversation=true}
else if (newsitem.ListView.view.viewtype=="conversation"){
conversation=true
newsitem.ListView.view.currentIndex=itemindex
}
else{
conversation=false;
newsitem.ListView.view.currentIndex=itemindex
};
var reply=replycomp.createObject(friendicaActivities,{parentId:newsitemobject.id,reply_to_user:newsitemobject.user.screen_name, state:"reply",conversation:conversation,textfocus:true})
}
}
Action {
text: qsTr("DM")
onTriggered: {
root.directmessageSignal(newsitemobject.user.screen_name);
}
onAboutToShow:{if(newsitemobject.hasOwnProperty("external_url")){
insertAction(4,externalAction)}
}
Action {
text: qsTr("Repost")
@ -432,7 +434,21 @@ Item {
pushConversation();
}
}
Action {
text: qsTr("DM")
onTriggered: {
root.directmessageSignal(newsitemobject.user.screen_name);
}
}
Action {
text: qsTr("Bookmark")
onTriggered: {
if(model.newsitemobject.favorited==0){
Newsjs.favorite(login,true,newsitemobject.id,root); model.newsitemobject.favorited=1}
else if(model.newsitemobject.favorited==1){
Newsjs.favorite(login,false,newsitemobject.id,root);model.newsitemobject.favorited=0}
}
}
Menu{
title: qsTr("Attending")
width: 10*root.fontFactor*osSettings.systemFontSize
@ -469,11 +485,6 @@ Item {
})
}
}
//MenuItem{
// text:qsTr("Show on website")
// onTriggered:Qt.openUrlExternally(login.server+"/display/"+newsitemobject
//}
}
Column{
id:conversationColumn
@ -481,4 +492,8 @@ Item {
width: newsitem.width
}
}
Action{id:externalAction
text: qsTr("External")
onTriggered: {Qt.openUrlExternally(newsitemobject.external_url)}
}
}