summaryrefslogtreecommitdiff
path: root/src/main.ts
diff options
context:
space:
mode:
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);
});