Skip to content
Snippets Groups Projects
Commit daa227af authored by Sergey Linev's avatar Sergey Linev
Browse files

[rbrowser] show warning dialog when dblclick processing takes longer

In this time server will not react on any other user actions,
therefore just block UI with modal message
parent c6e0123e
No related branches found
No related tags found
No related merge requests found
...@@ -533,8 +533,10 @@ void RBrowser::ProcessMsg(unsigned connid, const std::string &arg0) ...@@ -533,8 +533,10 @@ void RBrowser::ProcessMsg(unsigned connid, const std::string &arg0)
if (arr && (arr->size() > 2)) if (arr && (arr->size() > 2))
reply = ProcessDblClick(*arr); reply = ProcessDblClick(*arr);
if (!reply.empty()) if (reply.empty())
fWebWindow->Send(connid, reply); reply = "NOPE";
fWebWindow->Send(connid, reply);
} else if (kind == "WIDGET_SELECTED") { } else if (kind == "WIDGET_SELECTED") {
fActiveWidgetName = msg; fActiveWidgetName = msg;
......
...@@ -14,6 +14,10 @@ sap.ui.define(['sap/ui/core/mvc/Controller', ...@@ -14,6 +14,10 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
'sap/ui/core/mvc/XMLView', 'sap/ui/core/mvc/XMLView',
'sap/ui/core/Icon', 'sap/ui/core/Icon',
'sap/m/Button', 'sap/m/Button',
'sap/m/ButtonType',
'sap/ui/core/ValueState',
'sap/m/Dialog',
'sap/m/DialogType',
'sap/ui/codeeditor/CodeEditor', 'sap/ui/codeeditor/CodeEditor',
'sap/m/Image', 'sap/m/Image',
'sap/tnt/ToolHeader', 'sap/tnt/ToolHeader',
...@@ -36,6 +40,10 @@ sap.ui.define(['sap/ui/core/mvc/Controller', ...@@ -36,6 +40,10 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
XMLView, XMLView,
CoreIcon, CoreIcon,
Button, Button,
ButtonType,
ValueState,
Dialog,
DialogType,
CodeEditor, CodeEditor,
Image, Image,
ToolHeader, ToolHeader,
...@@ -757,6 +765,45 @@ sap.ui.define(['sap/ui/core/mvc/Controller', ...@@ -757,6 +765,45 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
args.push(opt, exec); args.push(opt, exec);
this.websocket.send("DBLCLK:" + JSON.stringify(args)); this.websocket.send("DBLCLK:" + JSON.stringify(args));
this.invokeWarning("Processing double click on: " + prop.name, 200);
},
invokeWarning: function(msg, tmout) {
this.cancelWarning();
this.warn_timeout = setTimeout(() => {
if (!this.warn_timeout) return;
delete this.warn_timeout;
this.oWarningDialog = new Dialog({
type: DialogType.Message,
title: "Warning",
state: ValueState.Warning,
content: new mText({ text: msg }),
beginButton: new Button({
type: ButtonType.Emphasized,
text: "OK",
press: () => this.cancelWarning()
})
});
this.oWarningDialog.open();
}, tmout);
},
cancelWarning: function() {
if (this.warn_timeout) {
clearTimeout(this.warn_timeout);
delete this.warn_timeout;
}
if (this.oWarningDialog) {
this.oWarningDialog.close();
delete this.oWarningDialog;
}
}, },
getBaseClass: function(className) { getBaseClass: function(className) {
...@@ -789,16 +836,24 @@ sap.ui.define(['sap/ui/core/mvc/Controller', ...@@ -789,16 +836,24 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
/** @summary Entry point for all data from server */ /** @summary Entry point for all data from server */
onWebsocketMsg: function(handle, msg, offset) { onWebsocketMsg: function(handle, msg, offset) {
// any message from server clear all warnings
this.cancelWarning();
if (typeof msg != "string") if (typeof msg != "string")
return console.error("Browser do not uses binary messages len = " + mgs.byteLength); return console.error("Browser do not uses binary messages len = " + mgs.byteLength);
// console.log('MSG', msg.substr(0,20));
let mhdr = msg.split(":")[0]; let mhdr = msg.split(":")[0];
msg = msg.substr(mhdr.length+1); msg = msg.substr(mhdr.length+1);
switch (mhdr) { switch (mhdr) {
case "INMSG": case "INMSG":
this.processInitMsg(msg); this.processInitMsg(msg);
break; break;
case "NOPE":
break;
case "EDITOR": { // update code editor case "EDITOR": { // update code editor
let arr = JSON.parse(msg); let arr = JSON.parse(msg);
let tab = this.findTab(arr[0]); let tab = this.findTab(arr[0]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment