kopia lustrzana https://github.com/OpenBuilds/OpenBuilds-CONTROL
MacOS Quit
rodzic
4da4c1abe4
commit
d464d8732e
106
index.js
106
index.js
|
@ -1887,56 +1887,68 @@ if (electronApp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTrayIcon() {
|
function createTrayIcon() {
|
||||||
appIcon = new Tray(
|
if (process.platform !== 'darwin') {
|
||||||
nativeImage.createFromPath(iconPath)
|
appIcon = new Tray(
|
||||||
)
|
nativeImage.createFromPath(iconPath)
|
||||||
const contextMenu = Menu.buildFromTemplate([{
|
)
|
||||||
label: 'Quit Machine Driver (Disables all integration until started again)',
|
const contextMenu = Menu.buildFromTemplate([{
|
||||||
click() {
|
label: 'Quit Machine Driver (Disables all integration until started again)',
|
||||||
appIcon.destroy();
|
click() {
|
||||||
electronApp.exit(0);
|
appIcon.destroy();
|
||||||
}
|
electronApp.exit(0);
|
||||||
}])
|
}
|
||||||
appIcon.on('click', function() {
|
}])
|
||||||
// console.log("Clicked Systray")
|
appIcon.on('click', function() {
|
||||||
if (jogWindow === null) {
|
// console.log("Clicked Systray")
|
||||||
createJogWindow();
|
if (jogWindow === null) {
|
||||||
jogWindow.show()
|
createJogWindow();
|
||||||
jogWindow.setAlwaysOnTop(true);
|
jogWindow.show()
|
||||||
jogWindow.focus();
|
jogWindow.setAlwaysOnTop(true);
|
||||||
jogWindow.setAlwaysOnTop(false);
|
jogWindow.focus();
|
||||||
} else {
|
jogWindow.setAlwaysOnTop(false);
|
||||||
jogWindow.show()
|
} else {
|
||||||
jogWindow.setAlwaysOnTop(true);
|
jogWindow.show()
|
||||||
jogWindow.focus();
|
jogWindow.setAlwaysOnTop(true);
|
||||||
jogWindow.setAlwaysOnTop(false);
|
jogWindow.focus();
|
||||||
}
|
jogWindow.setAlwaysOnTop(false);
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
|
||||||
appIcon.on('balloon-click', function() {
|
appIcon.on('balloon-click', function() {
|
||||||
// console.log("Clicked Systray")
|
// console.log("Clicked Systray")
|
||||||
if (jogWindow === null) {
|
if (jogWindow === null) {
|
||||||
createJogWindow();
|
createJogWindow();
|
||||||
jogWindow.show()
|
jogWindow.show()
|
||||||
jogWindow.setAlwaysOnTop(true);
|
jogWindow.setAlwaysOnTop(true);
|
||||||
jogWindow.focus();
|
jogWindow.focus();
|
||||||
jogWindow.setAlwaysOnTop(false);
|
jogWindow.setAlwaysOnTop(false);
|
||||||
} else {
|
} else {
|
||||||
jogWindow.show()
|
jogWindow.show()
|
||||||
jogWindow.setAlwaysOnTop(true);
|
jogWindow.setAlwaysOnTop(true);
|
||||||
jogWindow.focus();
|
jogWindow.focus();
|
||||||
jogWindow.setAlwaysOnTop(false);
|
jogWindow.setAlwaysOnTop(false);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Call this again for Linux because we modified the context menu
|
// Call this again for Linux because we modified the context menu
|
||||||
appIcon.setContextMenu(contextMenu)
|
appIcon.setContextMenu(contextMenu)
|
||||||
|
|
||||||
|
appIcon.displayBalloon({
|
||||||
|
icon: nativeImage.createFromPath(iconPath),
|
||||||
|
title: "Driver Started",
|
||||||
|
content: "OpenBuilds Machine Driver has started successfully: Active on " + ip.address() + ":" + config.webPort
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const dockMenu = Menu.buildFromTemplate([{
|
||||||
|
label: 'Quit Machine Driver (Disables all integration until started again)',
|
||||||
|
click() {
|
||||||
|
appIcon.destroy();
|
||||||
|
electronApp.exit(0);
|
||||||
|
}
|
||||||
|
}])
|
||||||
|
app.dock.setMenu(dockMenu)
|
||||||
|
};
|
||||||
|
|
||||||
appIcon.displayBalloon({
|
|
||||||
icon: nativeImage.createFromPath(iconPath),
|
|
||||||
title: "Driver Started",
|
|
||||||
content: "OpenBuilds Machine Driver has started successfully: Active on " + ip.address() + ":" + config.webPort
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "OpenBuildsMachineDriver",
|
"name": "OpenBuildsMachineDriver",
|
||||||
"version": "1.0.68",
|
"version": "1.0.70",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1443,6 +1443,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
|
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
|
||||||
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg="
|
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg="
|
||||||
},
|
},
|
||||||
|
"growly": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz",
|
||||||
|
"integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE="
|
||||||
|
},
|
||||||
"har-schema": {
|
"har-schema": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
|
||||||
|
@ -1711,8 +1716,7 @@
|
||||||
"isexe": {
|
"isexe": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
|
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"isstream": {
|
"isstream": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
|
@ -2053,6 +2057,17 @@
|
||||||
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz",
|
||||||
"integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk="
|
"integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk="
|
||||||
},
|
},
|
||||||
|
"node-notifier": {
|
||||||
|
"version": "5.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.2.1.tgz",
|
||||||
|
"integrity": "sha512-MIBs+AAd6dJ2SklbbE8RUDRlIVhU8MaNLh1A9SUZDUHPiZkWLFde6UNwG41yQHZEToHgJMXqyVZ9UcS/ReOVTg==",
|
||||||
|
"requires": {
|
||||||
|
"growly": "1.3.0",
|
||||||
|
"semver": "5.5.0",
|
||||||
|
"shellwords": "0.1.1",
|
||||||
|
"which": "1.3.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"noms": {
|
"noms": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz",
|
||||||
|
@ -3746,6 +3761,11 @@
|
||||||
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
|
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"shellwords": {
|
||||||
|
"version": "0.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz",
|
||||||
|
"integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww=="
|
||||||
|
},
|
||||||
"signal-exit": {
|
"signal-exit": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||||
|
@ -4243,7 +4263,6 @@
|
||||||
"version": "1.3.1",
|
"version": "1.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||||
"integrity": "sha1-pFBD1U9YBTFtqNYvn1CRjT2nCwo=",
|
"integrity": "sha1-pFBD1U9YBTFtqNYvn1CRjT2nCwo=",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"isexe": "2.0.0"
|
"isexe": "2.0.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "OpenBuildsMachineDriver",
|
"name": "OpenBuildsMachineDriver",
|
||||||
"version": "1.0.70",
|
"version": "1.0.71",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"description": "Machine Interface Driver for OpenBuilds",
|
"description": "Machine Interface Driver for OpenBuilds",
|
||||||
"author": "github.com/openbuilds <webmaster@openbuilds.com>",
|
"author": "github.com/openbuilds <webmaster@openbuilds.com>",
|
||||||
|
@ -35,6 +35,7 @@
|
||||||
],
|
],
|
||||||
"repository": "https://github.com/OpenBuilds/SW-Machine-Drivers",
|
"repository": "https://github.com/OpenBuilds/SW-Machine-Drivers",
|
||||||
"build": {
|
"build": {
|
||||||
|
"icon": "build/icon.icns",
|
||||||
"appId": "openbuilds.projectmakr",
|
"appId": "openbuilds.projectmakr",
|
||||||
"productName": "OpenBuildsMachineDriver",
|
"productName": "OpenBuildsMachineDriver",
|
||||||
"asar": true,
|
"asar": true,
|
||||||
|
|
Ładowanie…
Reference in New Issue