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

@ -18,17 +18,42 @@ Rectangle {
// photoWorker.sendMessage(msg);
//}
onNewImagesChanged:{
Helperjs.readField("album",root.db,"imageData",root.login.username,function(albums){
//print("albums"+JSON.stringify(albums)+JSON.stringify(newImages[currentImageNo]));
if(albums.indexOf(newImages[currentImageNo].album)==-1){
filesystem.Directory=root.login.imagestore+"/albums";
filesystem.makeDir(newImages[currentImageNo].album);}
});
if(newImages.length>0){
print("Current image number"+currentImageNo)
Service.dataRequest(root.login,newImages[currentImageNo].id,root.db,fotorectangle);
newImagesProgress.visible=true //download first image
}}
onCurrentImageNoChanged:{
if(currentImageNo<newImages.length){Service.dataRequest(root.login,newImages[currentImageNo].id,root.db,fotorectangle)};
if(currentImageNo==newImages.length){newImagesProgress.visible=false;showOwnFotos();
newImages=[];currentImageNo=0}
// download next image if photoplaceholder is finished saving
// download next image if photoplaceholder is finished saving
}
function showOwnFotos(){
try {photogroupModel.clear()}catch (e){print(e)}
Helperjs.readField("album",root.db, "imageData",root.login.username,function(albums){
if (albums[0]) {
var msg = { 'model': photogroupModel,'albums':albums,'firstalbum':0,'foreignPicture': false};
photoWorker.sendMessage(msg);
};
})
}
function onFriendsFotos(friend){print("Friend "+friend.url);
try {photogroupModel.clear()}catch (e){print(e)}
Service.requestFriendsAlbumPictures(friend,fotostab,function(albums){
var msg = {'model': photogroupModel,'albums':albums,'firstalbum':0,'foreignPicture':true};
photoWorker.sendMessage(msg);
})
}
ProgressBar{
id: newImagesProgress
@ -118,23 +143,5 @@ Button {
ListView {anchors.fill: parent; model: visualphotoModel.parts.fullscreen; interactive: false }
WorkerScript{id: photoWorker;source: "qrc:/js/photoworker.js"}
function showOwnFotos(){
try {photogroupModel.clear()}catch (e){print(e)}
Helperjs.readField("album",root.db, "imageData",root.login.username,function(albums){
if (albums[0]) {
var msg = { 'model': photogroupModel,'albums':albums,'firstalbum':0,'foreignPicture': false};
photoWorker.sendMessage(msg);
};
})
}
function onFriendsFotos(friend){print("Friend "+friend.url);
try {photogroupModel.clear()}catch (e){print(e)}
Service.requestFriendsAlbumPictures(friend,fotostab,function(albums){
var msg = {'model': photogroupModel,'albums':albums,'firstalbum':0,'foreignPicture':true};
photoWorker.sendMessage(msg);
})
}
Component.onCompleted: { root.fotoSignal.connect(onFriendsFotos);}
Component.onCompleted: { root.fotoSignal.connect(onFriendsFotos);}
}