mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-08 11:33:42 +00:00
Fixed Toast and Message-Box for non-english characters for older linux releases, like Ubuntu 10-14
This commit is contained in:
@@ -126,7 +126,6 @@ function Toaster()
|
||||
{
|
||||
if (process.platform == 'linux' && !require('linux-dbus').hasService('org.freedesktop.Notifications'))
|
||||
{
|
||||
|
||||
// No D-Bus service to handle notifications, so we must fake a notification with ZENITY --info
|
||||
if (require('message-box').zenity.timeout)
|
||||
{
|
||||
@@ -168,7 +167,11 @@ function Toaster()
|
||||
if (require('message-box').zenity.timeout)
|
||||
{
|
||||
// Timeout Supported
|
||||
retVal.child = require('child_process').execFile(require('message-box').zenity.path, ['zenity', '--info', '--title=' + retVal.title, '--text=' + retVal.caption, '--timeout=5'], { uid: retVal.consoleUid, env: { XAUTHORITY: retVal.xinfo.xauthority, DISPLAY: retVal.xinfo.display } });
|
||||
retVal._mb = require('message-box').create(retVal.title, retVal.caption, 5, 1);
|
||||
retVal._mb.toast = retVal;
|
||||
retVal._mb.then(function () { this.toast._res('DISMISSED'); }, function (e) { this.toast._rej(e); });
|
||||
return (retVal);
|
||||
//retVal.child = require('child_process').execFile(require('message-box').zenity.path, ['zenity', '--info', '--title=' + retVal.title, '--text=' + retVal.caption, '--timeout=5'], { uid: retVal.consoleUid, env: { XAUTHORITY: retVal.xinfo.xauthority, DISPLAY: retVal.xinfo.display } });
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -181,7 +184,6 @@ function Toaster()
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// Use ZENITY Notification
|
||||
retVal.child = require('child_process').execFile(require('message-box').zenity.path, ['zenity', '--notification', '--title=' + title, '--text=' + caption, '--timeout=5'], { uid: retVal.consoleUid, env: { XAUTHORITY: retVal.xinfo.xauthority, DISPLAY: retVal.xinfo.display } });
|
||||
retVal.child.descriptorMetadata = 'toaster (zenity/notification)'
|
||||
|
||||
Reference in New Issue
Block a user