From 5f86ae2995cad6044c1c8fe3ebf98e5085658a90 Mon Sep 17 00:00:00 2001 From: LawnCable Date: Sun, 20 May 2018 20:51:35 -0400 Subject: social buttons and debug btn --- src/main.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/main.ts') diff --git a/src/main.ts b/src/main.ts index dc2e47d..40e999f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,7 +2,7 @@ import { app, BrowserWindow, ipcMain, remote } from 'electron'; // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. -let mainWindow: BrowserWindow; +export let mainWindow: BrowserWindow; const isSecondInstance = app.makeSingleInstance(() => { // Someone tried to run a second instance, we should focus our window. if (mainWindow) { @@ -30,8 +30,6 @@ const createWindow = () => { // Open the DevTools. mainWindow.webContents.openDevTools(); - //mainWindow.setProgressBar(0.5); - // Emitted when the window is closed. mainWindow.on('closed', () => { // Dereference the window object, usually you would store windows @@ -71,8 +69,19 @@ ipcMain.on('minimize', (event:any, arg:any)=> { mainWindow.minimize(); }); +ipcMain.on('debug', (event:any, arg:any)=> { + if(mainWindow.webContents.isDevToolsOpened()) + mainWindow.webContents.closeDevTools(); + else + mainWindow.webContents.openDevTools(); +}); + +import {Status} from './main/status'; ipcMain.on('play', (event:any, arg:any)=> { console.log("play", arg); + Status.setPlaying(true); + Status.setProgress(500); + setTimeout(()=>{Status.setPlaying(false);Status.removeProgress();}, 10000); }); -- cgit v1.2.3-60-g2f50