v0.6.2 Follow and Unfollow contacts, Systray on Linux

This commit is contained in:
LubuWest 2021-08-03 21:19:53 +02:00
commit baccd64303
37 changed files with 724 additions and 636 deletions

View file

@ -257,6 +257,42 @@ Page {
rootstackView.pop()
}
}
BlueButton{
id:followbutton
visible:(contact.isFriend==0)
height: 6*mm
//width: implicitContentWidth+2*mm//8*mm
text:qsTr("Follow")
onClicked:{
contactBusy.running=true;
Helperjs.friendicaPostRequest(login,"/api/v1/accounts/" + contact.id + "/follow",'',"POST",root,function(returnvalue){
Helperjs.updateData(db,"contacts",login.username,"isFriend",1,function(){},"id",contact.id)
root.friendsSignal(login.username);
rootstackView.pop()
// var username=login.username
//
});
}
}
BlueButton{
id:unfollowbutton
visible:(contact.isFriend==1)
height: 6*mm
//width: implicitContentWidth+2*mm//8*mm
text:qsTr("Unfollow")
onClicked:{
Helperjs.friendicaPostRequest(login,"/api/v1/accounts/" + contact.id + "/unfollow",'',"POST",root,function(returnvalue){
contactBusy.running=true;
Helperjs.updateData(db,"contacts",login.username,"isFriend",0,function(){},"id",contact.id)
root.friendsSignal(login.username);
rootstackView.pop()
});
}
}
}//Flow end
Label {
id: namelabel
@ -284,7 +320,7 @@ Page {
font.family: "Noto Sans"
textFormat:Text.RichText
wrapMode: Text.Wrap
text:"<b>"+qsTr("Description")+": </b> "+contact.description+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+
text:"<b>"+qsTr("Description")+": </b> "+(Qt.atob(contact.description)!=""?contact.description:"")+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+
"<br> <b>"+qsTr("URL")+":</b> <a href='"+ contact.url+"'>"+contact.url+"</a><br>"+
connectUrl+ "<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())
onLinkActivated: {
@ -312,7 +348,7 @@ Page {
Connections{
target:root
function onContactpostsChanged(){
if (root.contactposts.length>0&&root.contactposts[0]!=null){profileimagesource=root.contactposts[0].user.profile_image_url_large}
if (root.contactposts.length>0&&root.contactposts[0]!=null){profileimagesource=root.contactposts[0].friendica_author.profile_image_url_large}
contactBusy.running=false;
contactModel.clear();
var currentTime= new Date();

View file

@ -1,67 +0,0 @@
// This file is part of Friendiqa
// https://git.friendi.ca/lubuwest/Friendiqa
// Copyright (C) 2020 Marco R. <thomasschmidt45@gmx.net>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// In addition, as a special exception, the copyright holders give
// permission to link the code of portions of this program with the
// OpenSSL library under certain conditions as described in each
// individual source file, and distribute linked combinations including
// the two.
//
// You must obey the GNU General Public License in all respects for all
// of the code used other than OpenSSL. If you modify file(s) with this
// exception, you may extend this exception to your version of the
// file(s), but you are not obligated to do so. If you do not wish to do
// so, delete this exception statement from your version. If you delete
// this exception statement from all source files in the program, then
// also delete it here.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.9
import "qrc:/js/helper.js" as Helperjs
//import QtWebView 1.1
Rectangle{
color:"transparent"
width:newscolumn.width;
height:newscolumn.width/4*3
property string url:""//htmlview.text
Text{id:htmlview
textFormat:Text.RichText
}
// WebView {id:htmlview;
// anchors.fill: parent
// }
Component.onCompleted:{
// Helperjs.friendicaWebRequest(url,parent,function(document){
// print(document);
//// var metas = document.getElementsByTagName('meta'); //get all the meta tag elements
//// //iterate through them
//// for (i=0; i<metas.length; i++) {
//// if (metas[i].getAttribute("name") == "keywords") {
//// print(metas[i].getAttribute("content"));
//// }
//// else if (metas[i].getAttribute("name") == "description") {
//// console.log(metas[i].getAttribute("content"));
//// }
//// }
// //print(html);
// htmlview.text=""
// })
}
}

View file

@ -133,7 +133,6 @@ Item {
}catch(e){" "}
}
}
//Component.onCompleted:print("Newsitemwidth "+newsitem.width+ " Indent "+newsitemobject.indent)
}
MouseArea{id: itemBody