This commit is contained in:
LubuWest 2018-10-01 21:17:54 +02:00
commit 09e8b8d097
49 changed files with 1720 additions and 825 deletions

View file

@ -34,55 +34,58 @@ import QtQuick.Controls 1.3
import "qrc:/qml/genericqml"
Item {
id: contactComponent
property var createdAtDate: new Date(contact.created_at)
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend==1)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
id: contactComponent
height: 8*mm
width: parent.width
property var createdAtDate: new Date(contact.created_at)
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend==1)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
Rectangle {
id: wrapper
width: 16*mm
height: 15*mm
border.color: "grey"
color:"white"
Image {
id: photoImage
x:1
y:1
width: 10*mm
height:10*mm
source:((contact.profile_image!="") && (typeof(contact.profile_image)=="string"))? "file://"+contact.profile_image : contact.profile_image_url
onStatusChanged: {if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}}
}
Rectangle {
id: wrapper
width:parent.width
height: 8*mm
border.color: "grey"
color:"white"
Image {
id: photoImage
x:0.5*mm
y:0.5*mm
width: 7*mm
height:7*mm
source:((contact.profile_image!="") && (typeof(contact.profile_image)=="string"))? "file://"+contact.profile_image : contact.profile_image_url
onStatusChanged: {if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}}
}
Label {
id: namelabel
x: 1
width: wrapper.width-4
height: 3*mm
text: contact.screen_name
elide:Text.ElideRight
anchors.topMargin: 0
anchors.left: photoImage.left
color: "#303030"
font.pixelSize: 3*mm
anchors.top: photoImage.bottom
}
BlueButton{
id:infobutton
width: 5*mm
height: 5*mm
color:"transparent"
text:"?"
anchors.left: photoImage.right
anchors.leftMargin: 0.5*mm
anchors.topMargin: mm
anchors.top: parent.top
onClicked:{
var component = Qt.createComponent("qrc:/qml/contactqml/ContactDetailsComponent.qml");
if (component.status== Component.Ready){
var contactDetails = component.createObject(friendstab,{"contact": contact})}
Column{
width: wrapper.width-8*mm
anchors.left: photoImage.right
anchors.margins: 1*mm
spacing: mm
Label {
id: namelabel
width: wrapper.width-4
height: 3*mm
text: contact.name
elide:Text.ElideRight
color: "#303030"
font.pixelSize: 3*mm
}
Label {
id: screennamelabel
width: wrapper.width-8*mm
height: 2.5*mm
text: "@"+contact.screen_name
elide:Text.ElideRight
color: "#303030"
font.pixelSize: 2.5*mm
}
}
}
MouseArea{
anchors.fill: parent
onClicked:{
root.currentIndex=0;
root.contactdetailsSignal(contact)
}
}
}
}

View file

@ -153,7 +153,7 @@ Rectangle {
anchors.right: parent.right
onClicked: {
try {friendsModel.clear()} catch(e){print(e)};
root.contactLoadType="friends";
//root.contactLoadType="friends";
Newsjs.requestFriends(root.login,db,root,function(nc){
root.newContacts=nc
})
@ -171,15 +171,15 @@ Rectangle {
value: currentContact/root.newContacts.length
}
GridView {
//GridView {
ListView{
id: friendsView
x:mm
y:updateFriendsButton.height+2*mm
width:friendsGridTab.width-2*mm
height:friendsGridTab.height-updateFriendsButton.height-2*mm
clip: true
cellHeight: 16*mm
cellWidth: 17*mm
spacing: 2
//add: Transition {
// NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
// }
@ -233,15 +233,13 @@ Rectangle {
})
}
}
GridView {
ListView {
id: contactsView
x:mm
y:cleanButton.height+2*mm
width:contactsGridTab.width-2*mm
height:contactsGridTab.height-cleanButton.height-2*mm
clip: true
cellHeight: 16*mm
cellWidth: 17*mm
//add: Transition {
// NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
// }

View file

@ -93,7 +93,11 @@ Item {
groupmembers=JSON.parse(groups);
for (var user in groupmembers){
Helperjs.readData(root.db,"contacts",root.login.username,function(userdata){
if (userdata[0]){groupModel.append({"groupmember":userdata[0]})}
if (userdata[0]){
userdata[0].name=Qt.atob(userdata[0].name);
userdata[0].description=Qt.atob(userdata[0].description)
groupModel.append({"groupmember":userdata[0]
})}
},"id",groupmembers[user])
} //catch(e){}
},"groupname",group.groupname);
@ -132,13 +136,15 @@ Item {
anchors.left: memberImage.right
anchors.margins: 1*mm
width:parent.width-1
text:Qt.atob(groupmember.name)
text:groupmember.name
}
MouseArea{
anchors.fill: parent
onClicked:{
root.currentIndex=1;
friendstab.active=true;
// root.currentIndex=1;
// friendstab.active=true;
// root.contactdetailsSignal(groupmember)
root.currentIndex=0;
root.contactdetailsSignal(groupmember)
}
}