Version 0.004

This commit is contained in:
LubuWest 2017-05-11 22:15:34 +02:00
commit 438f8a4e4d
64 changed files with 2736 additions and 636 deletions

View file

@ -11,12 +11,13 @@ Rectangle {
color: "white"
function showContactdetails(contact){
var component = Qt.createComponent("qrc:/qml/contactqml/ContactDetailsComponent.qml");
if(contact.isFriend){
friendsTabView.currentIndex=0;
friendsTabView.contactsSignal(contact)
var contactDetails = component.createObject(friendstab,{"contact": contact})
}
else{friendsTabView.currentIndex=1;
friendsTabView.contactsSignal(contact)
var contactDetails = component.createObject(friendstab,{"contact": contact})
}
}
TabView{
@ -30,7 +31,7 @@ Rectangle {
signal contactsSignal(var contact)
signal groupsSignal(var username)
onCurrentIndexChanged:{
if (currentIndex==0){//print("currentindex 0");
if (currentIndex==0){
contactsSignal("")
}
else if (currentIndex==1){
@ -60,18 +61,14 @@ Rectangle {
title: qsTr("Friends")
Rectangle{
id: friendsGridTab
function makebig(friendindex){print("friendindex"+friendindex);if (friendindex){friendsModel.set(friendindex,{"status":"large"})}}
function showFriends(contact,callback){//print("contact"+JSON.stringify(contact));
function showFriends(contact){
try {friendsModel.clear()} catch(e){print(e)};
var friendindex;
Helperjs.readData(db,"contacts",root.login.username,function(friendsobject){
for (var i=0;i<friendsobject.length;i++){
var status="";
if(Helperjs.getCount(db,login,"contacts","screen_name",friendsobject[i].screen_name)>1){
if(Helperjs.getCount(db,login,"contacts","screen_name",friendsobject[i].screen_name)>1){
friendsobject[i].screen_name=friendsobject[i].screen_name+"+"+friendsobject[i].cid
}
if(contact){if (contact.cid==friendsobject[i].cid){status="large"}}
friendsModel.append({"contact":friendsobject[i],"status":status});
friendsModel.append({"contact":friendsobject[i]});
}
@ -113,12 +110,11 @@ Rectangle {
clip: true
cellHeight: 16*mm
cellWidth: 17*mm
add: Transition {
NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
}
//add: Transition {
// NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
// }
model: friendsModel
delegate: ContactComponent { }
Component.onCompleted: positionViewAtBeginning()
}
ListModel{id:friendsModel}
@ -132,7 +128,7 @@ Rectangle {
}
Tab{
title: qsTr("Other Contacts")
title: qsTr("Contacts")
Rectangle{
id: contactsGridTab
@ -140,9 +136,7 @@ Rectangle {
try {contactsModel.clear()} catch(e){print(e)};
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
for (var j=0;j<contactsobject.length;j++){
var status="";
if(contact){if (contact.id==contactsobject[j].id){status="large"}}
contactsModel.append({"contact":contactsobject[j],"status":status});
contactsModel.append({"contact":contactsobject[j]});
}
},"isFriend",0,"screen_name ASC");
}
@ -156,12 +150,11 @@ Rectangle {
clip: true
cellHeight: 16*mm
cellWidth: 17*mm
add: Transition {
NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
}
//add: Transition {
// NumberAnimation { properties: "x,y"; from: 300; duration: 1000 }
// }
model: contactsModel
delegate: ContactComponent { }
Component.onCompleted: positionViewAtBeginning()
}
ListModel{id: contactsModel}