Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #55 from ecnordbund/dev
Browse files Browse the repository at this point in the history
Release 0.1.5
  • Loading branch information
mathe42 authored Jul 2, 2018
2 parents 84ad03a + c6baecc commit 5546179
Show file tree
Hide file tree
Showing 39 changed files with 1,375 additions and 1,122 deletions.
Empty file removed .tmp/.gitkeep
Empty file.
3 changes: 0 additions & 3 deletions dev.bat

This file was deleted.

3 changes: 0 additions & 3 deletions dev.sh

This file was deleted.

2 changes: 1 addition & 1 deletion electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ec-verwaltungs-app",
"version": "0.1.4",
"version": "0.1.5",
"description": "EC-Verwaltungs Application",
"keywords": [],
"homepage": "https://ec-nordbund.de",
Expand Down
34 changes: 31 additions & 3 deletions electron/src/main/main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
// Import Electron
const { app, BrowserWindow } = require('electron')
const { app, BrowserWindow, Tray } = require('electron')

// On Install do Stuff
if (require('electron-squirrel-startup')) {
app.quit()
}

//Single Instance
const isSecondInstance = app.makeSingleInstance(() => {
BrowserWindow.getAllWindows()[0].show()
})

if (isSecondInstance) {
app.quit()
}

//=================================================================================================================================================

//Get URL's
Expand All @@ -19,12 +28,18 @@ const loadingURL =
? 'http://localhost:8080/loading.html'
: `file://${__dirname}/../renderer/loading.html`

const logoURL =
process.env.NODE_ENV === 'development'
? `${__dirname}/../../../public/ec-logo-128.png`
: `${__dirname}/../renderer/ec-logo-128.png`

//Get Settings
const mainWindowOptions = {
height: 563,
useContentSize: true,
width: 1000,
show: false
show: false,
icon: logoURL
}

const loadingWindowOptions = {
Expand All @@ -34,7 +49,8 @@ const loadingWindowOptions = {
width: 470,
show: false,
closable: false,
resizable: false
resizable: false,
icon: logoURL
}

//=================================================================================================================================================
Expand Down Expand Up @@ -64,6 +80,17 @@ function createLoadingWindow() {
createWindow()
}, 2000)
})
setupTray()
}

let tray

function setupTray() {
tray = new Tray(logoURL)
tray.setToolTip('EC-Verwaltungs-Application')
tray.on('click', () => {
BrowserWindow.getAllWindows()[0].show()
})
}

//=================================================================================================================================================
Expand All @@ -74,6 +101,7 @@ app.once('ready', createLoadingWindow)
// Wenn alle Fenster zu dann quit (außer macOS)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
tray.destroy()
app.quit()
}
})
Expand Down
Loading

0 comments on commit 5546179

Please sign in to comment.