summaryrefslogtreecommitdiff
path: root/src/main.ts
diff options
context:
space:
mode:
authorLawnCable <lawncable.tmw2@simonlaux.de>2018-05-20 20:51:35 -0400
committerLawnCable <lawncable.tmw2@simonlaux.de>2018-05-20 20:51:35 -0400
commit5f86ae2995cad6044c1c8fe3ebf98e5085658a90 (patch)
tree456cecdf6fb5338d1f74cbc09931d7ee7b077736 /src/main.ts
parentfb8104900abcc7b38e912a051ab046bc257167b9 (diff)
downloadelectron-5f86ae2995cad6044c1c8fe3ebf98e5085658a90.tar.gz
electron-5f86ae2995cad6044c1c8fe3ebf98e5085658a90.tar.bz2
electron-5f86ae2995cad6044c1c8fe3ebf98e5085658a90.tar.xz
electron-5f86ae2995cad6044c1c8fe3ebf98e5085658a90.zip
social buttons and debug btn
Diffstat (limited to 'src/main.ts')
-rw-r--r--src/main.ts15
1 files changed, 12 insertions, 3 deletions
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);
});