mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-16 00:03:45 +00:00
Added ability to close message-box for linux
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -290,8 +290,8 @@ function linux_messageBox()
|
|||||||
ret.child = require('child_process').execFile(this.zenity.path, ['zenity', layout == null ? '--question' : '--warning', '--title=' + title, '--text=' + caption], { uid: uid, env: { XAUTHORITY: xinfo.xauthority ? xinfo.xauthority : "", DISPLAY: xinfo.display } });
|
ret.child = require('child_process').execFile(this.zenity.path, ['zenity', layout == null ? '--question' : '--warning', '--title=' + title, '--text=' + caption], { uid: uid, env: { XAUTHORITY: xinfo.xauthority ? xinfo.xauthority : "", DISPLAY: xinfo.display } });
|
||||||
ret.child.timeout = setTimeout(function (c)
|
ret.child.timeout = setTimeout(function (c)
|
||||||
{
|
{
|
||||||
c.promise._rej('timeout');
|
|
||||||
c.timeout = null;
|
c.timeout = null;
|
||||||
|
c.promise._rej('timeout');
|
||||||
c.kill();
|
c.kill();
|
||||||
}, timeout * 1000, ret.child);
|
}, timeout * 1000, ret.child);
|
||||||
}
|
}
|
||||||
@@ -388,6 +388,16 @@ function linux_messageBox()
|
|||||||
{
|
{
|
||||||
ret._rej('Unable to create dialog box');
|
ret._rej('Unable to create dialog box');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret.close = function close()
|
||||||
|
{
|
||||||
|
if (this.timeout) { clearTimeout(this.timeout); }
|
||||||
|
if (this.child)
|
||||||
|
{
|
||||||
|
this._rej('denied');
|
||||||
|
this.child.kill();
|
||||||
|
}
|
||||||
|
}
|
||||||
return (ret);
|
return (ret);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user