mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 04:12:46 +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;
|
break;
|
||||||
case 'http.request':
|
case 'http.request':
|
||||||
break; // Handled elsewhere.
|
break; // Handled by request-service.
|
||||||
default:
|
default:
|
||||||
print('Unrecognized message from Pal.qml:', JSON.stringify(message));
|
print('Unrecognized message from Pal.qml:', JSON.stringify(message));
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,24 +41,6 @@
|
||||||
sortOrder: 8
|
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) {
|
function messagesWaiting(isWaiting) {
|
||||||
button.editProperties({
|
button.editProperties({
|
||||||
icon: isWaiting ? WAITING_ICON : NORMAL_ICON
|
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() {
|
function onClicked() {
|
||||||
if (onGotoScreen) {
|
if (onGotoScreen) {
|
||||||
// for toolbar-mode: go back to home screen, this will close the window.
|
// for toolbar-mode: go back to home screen, this will close the window.
|
||||||
|
@ -98,15 +65,11 @@
|
||||||
onGotoScreen = true;
|
onGotoScreen = true;
|
||||||
shouldActivateButton = true;
|
shouldActivateButton = true;
|
||||||
button.editProperties({isActive: shouldActivateButton});
|
button.editProperties({isActive: shouldActivateButton});
|
||||||
wireEventBridge(true);
|
|
||||||
messagesWaiting(false);
|
messagesWaiting(false);
|
||||||
tablet.sendToQml({ method: 'refreshFeeds', protocolSignature: Window.protocolSignature() })
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
shouldActivateButton = false;
|
shouldActivateButton = false;
|
||||||
onGotoScreen = false;
|
onGotoScreen = false;
|
||||||
button.editProperties({isActive: shouldActivateButton});
|
button.editProperties({isActive: shouldActivateButton});
|
||||||
wireEventBridge(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
button.clicked.connect(onClicked);
|
button.clicked.connect(onClicked);
|
||||||
|
|
Loading…
Reference in a new issue