1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00
This commit is contained in:
Dick Choi
2016-07-23 15:41:30 +09:00
parent 45b1cd3942
commit 286739f770
7 changed files with 61 additions and 69 deletions

View File

@@ -3,7 +3,7 @@ const ipc = electron.ipcMain
const Menu = electron.Menu
const globalShortcut = electron.globalShortcut
const mainWindow = require('./main-window')
const nodeIpc = require('@rokt33r/node-ipc')
// const nodeIpc = require('@rokt33r/node-ipc')
function emitToFinder (type, data) {
var payload = {
@@ -11,7 +11,7 @@ function emitToFinder (type, data) {
data: data
}
nodeIpc.server.broadcast('message', payload)
// nodeIpc.server.broadcast('message', payload)
}
function toggleFinder () {

View File

@@ -6,7 +6,6 @@ const autoUpdater = electron.autoUpdater
const path = require('path')
const ChildProcess = require('child_process')
const _ = require('lodash')
const nodeIpc = require('@rokt33r/node-ipc')
const GhReleases = require('electron-gh-releases')
// electron.crashReporter.start()
@@ -154,37 +153,37 @@ updater.on('update-downloaded', (info) => {
}
})
nodeIpc.config.id = 'node'
nodeIpc.config.retry = 1500
nodeIpc.config.silent = true
// nodeIpc.config.id = 'node'
// nodeIpc.config.retry = 1500
// nodeIpc.config.silent = true
nodeIpc.serve(
path.join(app.getPath('userData'), 'boost.service'),
function () {
nodeIpc.server.on(
'connect',
function (socket) {
socket.on('close', function () {
console.log('socket dead')
if (!appQuit) spawnFinder()
})
}
)
nodeIpc.server.on(
'message',
function (data, socket) {
console.log('>>', data)
handleIpcEvent(data)
}
)
nodeIpc.server.on(
'error',
function (err) {
console.log('>>', err)
}
)
}
)
// nodeIpc.serve(
// path.join(app.getPath('userData'), 'boost.service'),
// function () {
// nodeIpc.server.on(
// 'connect',
// function (socket) {
// socket.on('close', function () {
// console.log('socket dead')
// if (!appQuit) spawnFinder()
// })
// }
// )
// nodeIpc.server.on(
// 'message',
// function (data, socket) {
// console.log('>>', data)
// handleIpcEvent(data)
// }
// )
// nodeIpc.server.on(
// 'error',
// function (err) {
// console.log('>>', err)
// }
// )
// }
// )
function handleIpcEvent (payload) {
switch (payload.type) {
@@ -303,12 +302,12 @@ app.on('ready', function () {
// // Do nothing.
// }
nodeIpc.server.start(function (err) {
if (err.code === 'EADDRINUSE') {
notify('Error occurs!', 'You have to kill other Boostnote processes.')
quitApp()
}
})
// nodeIpc.server.start(function (err) {
// if (err.code === 'EADDRINUSE') {
// notify('Error occurs!', 'You have to kill other Boostnote processes.')
// quitApp()
// }
// })
require('./hotkey')
})

View File

@@ -49,14 +49,7 @@ var file = {
label: 'New Post',
accelerator: OSX ? 'Command + N' : 'Control + N',
click: function () {
mainWindow.webContents.send('top-new-post')
}
},
{
label: 'New Folder',
accelerator: OSX ? 'Command + Shift + N' : 'Control + Shift + N',
click: function () {
mainWindow.webContents.send('nav-new-folder')
mainWindow.webContents.send('top:new-note')
}
},
{
@@ -66,7 +59,7 @@ var file = {
label: 'Delete Post',
accelerator: OSX ? 'Control + Backspace' : 'Control + Delete',
click: function () {
mainWindow.webContents.send('detail-delete')
mainWindow.webContents.send('detail:delete')
}
}
]
@@ -127,16 +120,6 @@ var edit = {
var view = {
label: 'View',
submenu: [
{
label: 'Focus Search',
accelerator: 'Control + Alt + F',
click: function () {
mainWindow.webContents.send('top-focus-search')
}
},
{
type: 'separator'
},
{
label: 'Reload',
accelerator: (function () {
@@ -192,12 +175,8 @@ var help = {
click: function () { shell.openExternal('https://b00st.io/') }
},
{
label: 'Tutorial page',
click: function () { shell.openExternal('https://b00st.io/tutorial.html') }
},
{
label: 'Discussions',
click: function () { shell.openExternal('https://github.com/BoostIO/boost-app-discussions/issues') }
label: 'Issue Tracker',
click: function () { shell.openExternal('https://github.com/BoostIO/Boostnote/issues') }
},
{
label: 'Changelog',