Added IPC Handlers
This commit is contained in:
parent
58b50a09e7
commit
693d383a69
1 changed files with 9 additions and 1 deletions
10
src/main.js
10
src/main.js
|
@ -4,6 +4,7 @@ var Menu = require('menu');
|
||||||
var globalShortcut = require('global-shortcut')
|
var globalShortcut = require('global-shortcut')
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var Tray = require('tray');
|
var Tray = require('tray');
|
||||||
|
var ipc = require('ipc');
|
||||||
|
|
||||||
require('crash-reporter').start(); // Start crash reporter
|
require('crash-reporter').start(); // Start crash reporter
|
||||||
|
|
||||||
|
@ -12,7 +13,6 @@ var menu = new Menu();
|
||||||
Menu.setApplicationMenu(menu);
|
Menu.setApplicationMenu(menu);
|
||||||
var mainWindow = null;
|
var mainWindow = null;
|
||||||
|
|
||||||
|
|
||||||
// Make sure the application closes
|
// Make sure the application closes
|
||||||
app.on('window-all-closed', function () {
|
app.on('window-all-closed', function () {
|
||||||
app.quit();
|
app.quit();
|
||||||
|
@ -32,4 +32,12 @@ app.on('ready', function () {
|
||||||
mainWindow.on('closed', function() {
|
mainWindow.on('closed', function() {
|
||||||
mainWindow = undefined;
|
mainWindow = undefined;
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
ipc.on('hide', function () {
|
||||||
|
mainWindow.hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
ipc.on('show', function () {
|
||||||
|
mainWindow.show();
|
||||||
});
|
});
|
Reference in a new issue