1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-03 09:03:48 +00:00

Added pseudo privacy bar support to macOS

This commit is contained in:
Bryan Roe
2020-04-28 11:33:46 -07:00
parent dbbc47e751
commit 875c5ef2b1
3 changed files with 85 additions and 26 deletions

View File

@@ -291,7 +291,17 @@ function x_notifybar(title)
return (ret);
}
function macos_messagebox(title)
{
var ret = {};
require('events').EventEmitter.call(ret, true)
.createEvent('close')
.addMethod('close', function close() { this._messageBox.close(); });
ret._messageBox = require('message-box').create('', title, 0, ['Disconnect']);
ret._messageBox.that = ret;
ret._messageBox.then(function () { this.that.emit('close'); }, function () { this.that.emit('close'); });
return (ret);
}
switch(process.platform)
{
@@ -303,6 +313,9 @@ switch(process.platform)
case 'freebsd':
module.exports = x_notifybar_check;
break;
case 'darwin':
module.exports = macos_messagebox;
break;
}