Version 0.003
This commit is contained in:
parent
9f9a9f618c
commit
10dccdcdbb
572 changed files with 3711 additions and 13631 deletions
44
source-linux/js/layout.js
Normal file
44
source-linux/js/layout.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
function showFriends(db) {
|
||||
Service.readActiveConfig(db,function(login){
|
||||
Service.requestFriends(login.url,login.user,login.password,displayFriends);
|
||||
});
|
||||
}
|
||||
function displayFriends(obj){
|
||||
for (var i=0; i<obj.length; i++){
|
||||
print(obj[i]);
|
||||
if (obj[i]) {friendsModel.append({"friendName": obj[i]});
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
function ensureVisibility(c,f)
|
||||
{
|
||||
if (f.contentX >= c.x)
|
||||
f.contentX = c.x;
|
||||
else if (f.contentX+f.width <= c.x+c.width)
|
||||
f.contentX = c.x+c.width-f.width;
|
||||
if (f.contentY >= c.y)
|
||||
f.contentY = c.y;
|
||||
else if (f.contentY+f.height <= c.y+c.height)
|
||||
f.contentY = c.y+c.height-f.height;
|
||||
}
|
||||
|
||||
function createObject(objectQml,qmlParameters,parentitem,callback) {
|
||||
var component = Qt.createComponent(objectQml);
|
||||
if (component.status === Component.Ready || component.status === Component.Error)
|
||||
finishCreation(component,qmlParameters,parentitem,callback);
|
||||
else
|
||||
component.statusChanged.connect(finishCreation(qmlParameters));
|
||||
}
|
||||
|
||||
function finishCreation(component,qmlParameters,parentitem,callback) {
|
||||
if (component.status === Component.Ready) {
|
||||
var createdObject = component.createObject(parentitem, qmlParameters);
|
||||
if (createdObject === null)
|
||||
print("Error creating image"); }
|
||||
else if (component.status === Component.Error)
|
||||
print("Error loading component:"+component.errorString());
|
||||
else {print("created")}
|
||||
//callback(createdObject);
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue