This commit is contained in:
LubuWest 2019-12-10 21:12:32 +01:00
commit 7119d5bdf4
292 changed files with 790 additions and 16347 deletions

View file

@ -44,15 +44,21 @@ Rectangle {
y:1
color: "white"
// function showContactdetails(contact){
// var component = Qt.createComponent("qrc:/qml/contactqml/ContactDetailsComponent.qml");
// if(contact.isFriend){
// friendsTabView.currentIndex=1;
// var contactDetails = component.createObject(friendstab,{"contact": contact})
// }
// else{friendsTabView.currentIndex=2;
// var contactDetails = component.createObject(friendstab,{"contact": contact})
// }
// }
function showContactdetails(contact){
var component = Qt.createComponent("qrc:/qml/contactqml/ContactDetailsComponent.qml");
if(contact.isFriend){
friendsTabView.currentIndex=1;
var contactDetails = component.createObject(friendstab,{"contact": contact})
}
else{friendsTabView.currentIndex=2;
var contactDetails = component.createObject(friendstab,{"contact": contact})
}
rootstack.currentIndex=0;
bar.currentIndex=0;
root.contactdetailsSignal(contact)
}
function showProfile(callback){
@ -103,6 +109,7 @@ Rectangle {
currentIndex: friendsbar.currentIndex
signal contactsSignal(var contact)
signal groupsSignal(var username)
onCurrentIndexChanged:{
if (currentIndex==1){
contactsSignal("")
@ -147,6 +154,7 @@ Rectangle {
Layout.fillWidth:true
Layout.fillHeight: true
property int currentContact: 0
function showFriends(contact){
try {friendsModel.clear()} catch(e){print(e)};
Helperjs.readData(root.db,"contacts",login.username,function(friendsobject){
@ -209,6 +217,7 @@ Rectangle {
height:friendsGridTab.height-updateFriendsButton.height-2*mm
clip: true
spacing: 2
function processContactSelection(contactobject){showContactdetails(contactobject)}
//add: Transition {
// NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
// }
@ -269,6 +278,7 @@ Rectangle {
width:contactsGridTab.width-2*mm
height:contactsGridTab.height-cleanButton.height-2*mm
clip: true
function processContactSelection(contactobject){showContactdetails(contactobject)}
//add: Transition {
// NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
// }
@ -315,7 +325,7 @@ Rectangle {
Connections{
target:xhr
onError:{print(data)}//if (data=="image"){Helperjs.showMessage()}}
onSuccess:{print("gruppe "+data);
onSuccess:{
Newsjs.requestGroups(root.login,root.db,root,function(){
showGroups(root.login.username)});
}

View file

@ -116,7 +116,8 @@ Item {
if (userdata[0]){
userdata[0].name=Qt.atob(userdata[0].name);
userdata[0].description=Qt.atob(userdata[0].description)
groupModel.append({"groupmember":userdata[0]
//groupModel.append({"groupmember":userdata[0]
groupModel.append({"contact":userdata[0]
})}
},"id",groupmembers[user])
} //catch(e){}
@ -132,53 +133,53 @@ Item {
anchors.topMargin: mm
opacity: 0
Component {
id:groupMember
Rectangle{
width:parent.width
height:6*mm
Rectangle{id:memberrectangle
border.color: "#EEEEEE"
border.width: 1
width:parent.width-12*mm
height:6*mm
Image {
id: memberImage
x:1
y:1
width: 5*mm
height:5*mm
source:(groupmember.isFriend==1)? "file://"+groupmember.profile_image :groupmember.profile_image_url
onStatusChanged: if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
}
Text{
font.pixelSize: 3*mm
anchors.left: memberImage.right
anchors.margins: 1*mm
width:parent.width-1
text:groupmember.name
}
MouseArea{
anchors.fill: parent
onClicked:{
// root.currentIndex=1;
// friendstab.active=true;
// Component {
// id:groupMember
// Rectangle{
// width:parent.width
// height:6*mm
// Rectangle{id:memberrectangle
// border.color: "#EEEEEE"
// border.width: 1
// width:parent.width-12*mm
// height:6*mm
// Image {
// id: memberImage
// x:1
// y:1
// width: 5*mm
// height:5*mm
// source:(groupmember.isFriend==1)? "file://"+groupmember.profile_image :groupmember.profile_image_url
// onStatusChanged: if (photoImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
// }
// Text{
// font.pixelSize: 3*mm
// anchors.left: memberImage.right
// anchors.margins: 1*mm
// width:parent.width-1
// text:groupmember.name
// }
// MouseArea{
// anchors.fill: parent
// onClicked:{
//// root.currentIndex=1;
//// friendstab.active=true;
//// root.contactdetailsSignal(groupmember)
// root.currentIndex=0;
// root.contactdetailsSignal(groupmember)
root.currentIndex=0;
root.contactdetailsSignal(groupmember)
}
}
// BlueButton{
// anchors.left: memberrectangle.right
// anchors.margins: 1*mm
// text: "\uf056"
// onClicked:{
// groupModel.remove(index)
// }
// }
}
}
}
// }
// }
// // BlueButton{
// // anchors.left: memberrectangle.right
// // anchors.margins: 1*mm
// // text: "\uf056"
// // onClicked:{
// // groupModel.remove(index)
// // }
// // }
// }
// }
// }
ListView{
id: groupListView
@ -189,7 +190,8 @@ Item {
clip: true
spacing: 2
model: groupModel
delegate: groupMember
delegate: ContactComponent { }// groupMember
function processContactSelection(contactobject){showContactdetails(contactobject)}
}
ListModel{id: groupModel}