Version 0.002 with working Favorite Combobox

This commit is contained in:
LubuWest 2016-11-14 13:28:23 +01:00
commit 571c9046d0
42 changed files with 1948 additions and 814 deletions

View file

@ -21,6 +21,7 @@ Item {
}
function onDirectMessage(friend){
print(root.login.server);
newsStack.push({item:"qrc:/qml/MessageSend.qml",properties:{"reply_to_user": friend,"directmessage":1,"login":root.login}});
}
@ -51,13 +52,43 @@ Item {
width:root.width-2*mm
height:root.height-8*mm
ComboBox{
y:mm
width: 8*mm
model: ListModel{
id: cbModel
ListElement{text: qsTr("News")}
ListElement{text: qsTr("Favorites")}
}
onCurrentIndexChanged:{
if (currentIndex==0){newsModel.clear();
Newsjs.newsfromdb(root.db,root.login.username, function(dbnews){
showNews(dbnews)
})}
else if (currentIndex==1){
newsBusy.running=true;
Newsjs.requestFavorites(root.login,db,root,function(news){
JSON.stringify("Favorites: "+news);
Newsjs.storeNews(root.login,root.db,news,root,function(){
Newsjs.favoritesfromdb(db,root.login.username,function(newsarray){
JSON.stringify("FavoritesArray: "+newsarray);showNews(newsarray)
});
}
)})
}
}}
Button {
id: newMessageButton
text: qsTr("+")
anchors.top: parent.top
anchors.right: parent.right
onClicked: {
Helperjs.readField("screen_name",root.db,"contacts",root.login.username,function(friends){
var groups=[];
Helperjs.readData(root.db,"groups",root.login.username,function(groupobject){
groups=groupobject});
Helperjs.readData(root.db,"contacts",root.login.username,function(friends){
newsStack.push({item:"qrc:/qml/MessageSend.qml",properties:{"contacts": friends,"login":root.login}})
},"isFriend",1);
}
@ -150,6 +181,6 @@ Item {
showNews(dbnews)
})
}
}
}
}
}