function setBadgeCount(count) { if (process.platform === 'darwin') { remote.app.setBadgeCount(count); } }
app.on('window-all-closed', () => { promptOnClose = false; if (process.platform !== 'darwin') { app.quit(); } });
(() => { const compose_ = window && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__; if (process.env.NODE_ENV === 'development' && compose_) { return compose_({ actionCreators }); } return compose; })()
const installExtensions = async () => { devtron.install(); const installer = require('electron-devtools-installer'); const extensions = ['REACT_DEVELOPER_TOOLS', 'REDUX_DEVTOOLS']; const forceDownload = !!process.env.UPGRADE_EXTENSIONS; for (const name of extensions) { try { await installer.default(installer[name], forceDownload); } catch (e) { console.log(`Error installing ${name} extension: ${e.message}`); } } }
addImages(menuItems) { if(process.platform !== 'darwin') { return; } const nativeImage = require('electron').nativeImage; let promptMenu = menuItems[4]; let langMenu = _.find(promptMenu.submenu, (item) => item.label === 'Language'); _.each(langMenu.submenu, (menu) => { menu.icon = nativeImage.createFromPath(join(__dirname, '..', 'logos', `${menu.value}.png`)) }); }
gulp.task('run', (cb) => { (async function() { try { await spawn( process.platform !== 'win32' ? './node_modules/.bin/electron' : '.\\node_modules\\.bin\\electron.cmd' , [PATHS.APP, '--debug']); cb(); } catch(err) { onError(err); cb(err); } })(); });
getActiveHandle() { let twoDigit = x => `${(x < 10 ? '0' : '')}${x}`; let handles = process._getActiveHandles(); let now = new Date(); let [hh, mm, ss] = [now.getHours(), now.getMinutes(), now.getSeconds()]; let ts = `${twoDigit(hh)}:${twoDigit(mm)}:${twoDigit(ss)}`; let msg = _.chain(handles) .map(h => ReplCommon.type(h)) .sort() .reduce((acc, h) => (acc[h] = acc[h] ? acc[h] + 1 : 1, acc), {}) .map((v, k) => `${k}(${v})`) .tap(o => o.join(', ')) .value(); return [handles.length, `Active handles(at ${ts}): ${msg}`] }
app.on('window-all-closed', () => { db.set("auto_page", "0"); db.set("is_mouse", "0"); if (isMac) { db.set("curr_model", "1") } if (process.platform !== 'darwin') { app.quit() } })
async function authenticate(api) { api.authenticate({ type: "oauth", token: process.env.GITHUB_TOKEN }); }
(function() { if (process.platform === 'darwin') { return 'Ctrl+Command+F'; } else { return 'F11'; } })()
ipcMain.on('application:dock-message-notification', function(event, id) { dockNotificationCache[id] = dockNotificationCache[id] + 1; if (process.platform === 'darwin' || (process.platform === 'linux' && app.isUnityRunning && app.isUnityRunning())) { app.setBadgeCount(dockNotificationCache[id]); } if (process.platform === 'darwin') { app.dock.bounce(); } });
(function() { if (process.platform === 'darwin') { return 'Alt+Command+I'; } else { return 'Ctrl+Shift+I'; } })()
// Quit when all windows are closed. app.on('window-all-closed', () => { // On OS X it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q if (process.platform !== 'darwin') { app.quit(); } });