touch: Prevent multiple page pushes at the same time
This commit is contained in:
parent
7165800c73
commit
7f620cb505
3 changed files with 20 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue