mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-08 21:12:44 +02:00
more for the previous
This commit is contained in:
parent
5a1b56d573
commit
5257a254cb
2 changed files with 1 additions and 38 deletions
|
@ -318,7 +318,7 @@ function fromQml(message) { // messages are {method, params}, like json-rpc. See
|
|||
);
|
||||
break;
|
||||
case 'http.request':
|
||||
break; // Handled elsewhere.
|
||||
break; // Handled by request-service.
|
||||
default:
|
||||
print('Unrecognized message from Pal.qml:', JSON.stringify(message));
|
||||
}
|
||||
|
|
|
@ -41,24 +41,6 @@
|
|||
sortOrder: 8
|
||||
});
|
||||
|
||||
function fromQml(message) {
|
||||
console.debug('tablet-goto::fromQml: message = ', JSON.stringify(message));
|
||||
|
||||
var response = {id: message.id, jsonrpc: "2.0"};
|
||||
switch (message.method) {
|
||||
case 'request':
|
||||
request(message.params, function (error, data) {
|
||||
debug('rpc', request, 'error:', error, 'data:', data);
|
||||
response.error = error;
|
||||
response.result = data;
|
||||
tablet.sendToQml(response);
|
||||
});
|
||||
return;
|
||||
default:
|
||||
response.error = {message: 'Unrecognized message', data: message};
|
||||
}
|
||||
tablet.sendToQml(response);
|
||||
}
|
||||
function messagesWaiting(isWaiting) {
|
||||
button.editProperties({
|
||||
icon: isWaiting ? WAITING_ICON : NORMAL_ICON
|
||||
|
@ -66,21 +48,6 @@
|
|||
});
|
||||
}
|
||||
|
||||
var hasEventBridge = false;
|
||||
function wireEventBridge(on) {
|
||||
if (on) {
|
||||
if (!hasEventBridge) {
|
||||
tablet.fromQml.connect(fromQml);
|
||||
hasEventBridge = true;
|
||||
}
|
||||
} else {
|
||||
if (hasEventBridge) {
|
||||
tablet.fromQml.disconnect(fromQml);
|
||||
hasEventBridge = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onClicked() {
|
||||
if (onGotoScreen) {
|
||||
// for toolbar-mode: go back to home screen, this will close the window.
|
||||
|
@ -98,15 +65,11 @@
|
|||
onGotoScreen = true;
|
||||
shouldActivateButton = true;
|
||||
button.editProperties({isActive: shouldActivateButton});
|
||||
wireEventBridge(true);
|
||||
messagesWaiting(false);
|
||||
tablet.sendToQml({ method: 'refreshFeeds', protocolSignature: Window.protocolSignature() })
|
||||
|
||||
} else {
|
||||
shouldActivateButton = false;
|
||||
onGotoScreen = false;
|
||||
button.editProperties({isActive: shouldActivateButton});
|
||||
wireEventBridge(false);
|
||||
}
|
||||
}
|
||||
button.clicked.connect(onClicked);
|
||||
|
|
Loading…
Reference in a new issue