touch: Prevent multiple page pushes at the same time

This commit is contained in:
Thomas Perl 2014-02-04 22:56:59 +01:00
parent 7165800c73
commit 7f620cb505
3 changed files with 20 additions and 4 deletions

View file

@ -45,17 +45,26 @@ Item {
children[index-1].opacity = x / width;
}
property bool loadPageInProgress: false
function loadPage(filename, properties) {
if (pgst.loadPageInProgress) {
console.log('ignoring loadPage request while load in progress');
return;
}
var component = Qt.createComponent(filename);
if (component.status != Component.Ready) {
console.log('Error loading ' + filename + ':' +
component.errorString());
}
if (properties === undefined) {
component.createObject(pgst);
} else {
component.createObject(pgst, properties);
properties = {};
}
pgst.loadPageInProgress = true;
component.createObject(pgst, properties);
}
PBusyIndicator {